Azure IoT Central - Enum value displaying blank value in Dashboard - azure-iot-central

We are using a telemetry property "Bulb status" with an enum as shown below
"#id": "urn:veeazigbeeappdemo:ZigbeeDeviceTemplate_12r3:on_off:1",
"#type": "Telemetry",
"displayName": {
"en": "Bulb Status"
},
"name": "on_off",
"schema": {
"#id": "urn:veeazigbeeappdemo:ZigbeeDeviceTemplate_12r3:on_off:hxdsbx1pp:1",
"#type": "Enum",
"displayName": {
"en": "Enum"
},
"valueSchema": "string",
"enumValues": [
{
"#id": "urn:veeazigbeeappdemo:ZigbeeDeviceTemplate_12r3:on_off:hxdsbx1pp:On:1",
"#type": "EnumValue",
"displayName": {
"en": "On"
},
"enumValue": "1",
"name": "On"
},
{
"#id": "urn:veeazigbeeappdemo:ZigbeeDeviceTemplate_12r3:on_off:hxdsbx1pp:Off:1",
"#type": "EnumValue",
"displayName": {
"en": "Off"
},
"enumValue": "0",
"name": "Off"
}
]
}
The tile is made to display "Last Known value" in Template
When we send a payload as follows
payload = '{"on_off": %s}' % (random.choice([0, 1]))
we are getting the Bulb status correctly displayed as follows
when we send a payload which doesn't have Bulb status(on_off) telemetry property in it as below
payload = '{"current_level": %f}' % random.randrange(10.0, 100.0)
we are getting the Bulb status being shown as blank as follows
Correct Behaviour:
The Bulb status should show last know value from on_off property and should not display as blank when we don't send that telemetry property.
This kind of behavior with enum is causing an issue for us. Please provide the solution to overcome this.
Please let me know Where can I post this as a bug of Enum in Azure IoT Central?

It looks like an enum type is handling a null value differently than the other types. It seems to me, the unmodeled data should be not modify a dashboard.
As a workaround, Can you change type to the SemanticType/State? The State History is working well:
The feedback to the IoT Central team is here.

Related

MS teams adaptive card not sending input text value on submit

I am 500% sure it used to work and all of a sudden this is broken. The card for getting input is no longer passing the value back to nodejs.
The card looks like below:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Note text"
},
{
"type": "Input.Text",
"placeholder": "Type a note",
"isMultiline": true,
"id": "noteIdVal"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Save",
"data": { "action" : "add_note", "objNumber": objId, "objType": objectType }
},
{
"type": "Action.Submit",
"title": "Cancel",
"data" : {"action": "cancel"}
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
On the submit action, in my nodejs i am getting the data in the values node which are passed in the data field. However, it is no longer attaching noteIdVal. Did something changed from MS side?
MS Teams Adaptive card required special property with the name msteams to the object in an object submit action’s data property in order to access this functionality.
{
"type": "Action.Submit",
"title": "Click me for messageBack",
"data": {
"msteams": {
"type": "messageBack",
"displayText": "I clicked this button",
"text": "text to bots",
"value": "{\"bfKey\": \"bfVal\", \"conflictKey\": \"from value\"}"
},
"extraData": {}
}
}
The type property is "messageBack" the submit action will behave like a messageBack card action, which is like a combination of imBack and postBack.
Reference :
Microsoft Docs for MS Teams Adaptive Card
So, may be useful to other folks here. I have two showCards and the content of both the show cards has a common text field with same id name "noteIdVal". As ultimately it is a single json and hence was the culprit.
Lesson, have all fields unique id values which is easy to miss when you have multiple show cards

GPS location for IoT central map tile

I am trying to get my IoT Central app to show the GPS location using a map tile. My JSON file sends over the location and i have this tied to the map tile but the map tile keeps saying "Waiting for data" I have tried everything to get this to show and i can't seem to get it to work.
I have followed the JSON layout as shown here
You can see the raw data tab below which shows the data coming in and that it is associating the data with the gps capability but the map shows nothing.
enter image description here
I have just made a quick test and it looks like everything is working well:
New App with a custom device template
Creating a View
Exporting a device template for my tester (simulator):
{
"#id": "urn:custom6ec42lhnjx:gps38u:1",
"#type": "CapabilityModel",
"contents": [],
"displayName": {
"en": "gps"
},
"implements": [
{
"#type": "InterfaceInstance",
"displayName": {
"en": "Interface"
},
"name": "gpsea",
"schema": {
"#id": "urn:custom6ec42lhnjx:gpsea:1",
"#type": "Interface",
"contents": [
{
"#type": [
"Telemetry",
"SemanticType/Location"
],
"displayName": {
"en": "gps"
},
"name": "gps",
"schema": "geopoint"
},
{
"#type": [
"Telemetry",
"SemanticType/Temperature"
],
"displayName": {
"en": "temp"
},
"name": "temp",
"schema": "double"
}
],
"displayName": {
"en": "Interface"
}
}
}
],
"#context": [
"http://azureiot.com/v1/contexts/IoTModel.json"
]
}
Provisioning and Simulating device (with a random values):
Dashboard IoT Central App:
Example with simulating your telemetry data:
I finally got it working, unfortunately only by starting again and deleting everything i had done thus far, as soon as i recreated my IoTC app and reimplemented the function that deals with the webhook everything worked perfectly. Still strange as the data format and everything else remained unchanged. But thank you for your help.

IoT Central - State values error: Another instance with the same id already exists

I just don't get it.
If I want to define a status, I must be able to refer to a value several times, right?
Sensor value is occupancy with value 0 (Free) or 1 (Occupied). So I have 2 states, but I can only use "occupancy" in the Name it once ...
Regards,
Matthias
enter image description here
For better understanding, let's call the State property (such as a device twin reported property) as an Occupancy.
The following screen snippet shows its declaration, where the Occupancy state property has two states such as the Free and Occupied (Occupancy.Free and Occupancy.Occupied):
and its declaration in the Interface instance of the Capability Model (in my example):
{
"#id": "urn:rigado:interfaces:S1_Sensor:Occupancy:3",
"#type": [
"Property",
"SemanticType/State"
],
"displayName": {
"en": "Occupancy"
},
"name": "Occupancy",
"schema": {
"#id": "urn:rigado:interfaces:S1_Sensor:Occupancy:xkuwdf9p:3",
"#type": "Enum",
"valueSchema": "integer",
"enumValues": [
{
"#id": "urn:rigado:interfaces:S1_Sensor:Occupancy:xkuwdf9p:Free:3",
"#type": "EnumValue",
"displayName": {
"en": "Free"
},
"enumValue": 0,
"name": "Free"
},
{
"#id": "urn:rigado:interfaces:S1_Sensor:Occupancy:xkuwdf9p:Occupied:3",
"#type": "EnumValue",
"displayName": {
"en": "Occupied"
},
"enumValue": 1,
"name": "Occupied"
}
]
}
}
As you can see in the above schema, the names in the enumValues array must be unique, that is a reason why you get the error, when you used the same enum name.
Note, that the device can change the state of the Occupancy property between the values such as Free (0) and Occupied (1).
For testing purpose can be used the Azure IoT Hub Tester, see the following screen snippet:
The following screen snippets show changing a state in the Occupancy reported property on the PnP device (sensor3) connected to the IoTC App:
Publishing a Occupancy state:
Get the device twin properties:
and the IoTC App Dashboard for Occupancy State property:
As you can see, the about state has a value Free.

Seperate Body/Header in logic app custom connector

Hi have an ARM Template that deploys some custom connectors. I have a connector called Start in that when i try to use this below piece of code which sets message body and header seperately it works fine. But when i do the same on a following connector , Assue Connector-Start as A and its followed by connector B. The input is not showing in different fields. Instead its not even relevant. can anyone help.
In the connector parameters here's the first block
{
"name": "Body",
"in": "body",
"schema": {
"type": "object",
"properties": {
"MessageBody": {
"type": "object",
"description": "Message body passed to the http trigger"
},
"MessageHeader": {
"type": "object",
"description": "Message header passed to the http trigger"
}
},
"required": [
"MessageBody",
"MessageHeader"
]
},
"description": "Message body to get properties from the message payload.",
"required": true
},
Here's the input shown in portal for connector-A
It seems, after deployment the old connector is cached. Removing it and adding it again worked.

Is it possible to change verbiage of listAuditEvents?

The current [Envelopes: listAuditEvents] creates the following verbiage for correction:
"eventFields": [
{
"name": "logTime",
"value": "2018-09-18T19:09:01.3603686Z"
},
{
"name": "Source",
"value": "api"
},
{
"name": "UserName",
"value": "Staging"
},
{
"name": "UserId",
"value": "8c57af14-e46a-4965-ae8b-42bb0c29b706"
},
{
"name": "Action",
"value": "Correction Initiated"
},
{
"name": "Message",
"value": "Staging initiated correction"
},
{
"name": "EnvelopeStatus",
"value": "correct"
},
I would like to modify the Message values. I have gone through Docusigns API but I have not found any indication that this is possible.
Has anyone had the same need? and if so were you able to add custom message verbiage for certain events/actions?
Thanks.
It's not possible for you to configure the contents of the API response for the listAuditEvents operation. However, you could (in your code) include logic to parse the API response and based on certain values in the response, substitute values (for purposes in your app) with the verbiage you prefer.
For example, let's say that you have a page in your app that displays the various events that have occurred for an Envelope, but you don't want to display the verbiage "[UserName] initiated correction" as the text in your UI when a user initiates an envelope correction -- instead you want to display the text "[UserName] changed envelope settings." The logic in your code could do something like this psuedo code shows (where auditEvent represents an object within the API response body for the listAuditEvents operation):
if (auditEvent.ActionInitiated == "Correction Initiated") {
displayMessageInUI(auditEvent.UserName + " changed envelope settings.");
}

Resources