question

JaniceFerguson-0739 avatar image
0 Votes"
JaniceFerguson-0739 asked AshokPeddakotla-MSFT commented

IoT Central raw data displays true/false as "On"/"Off"

I have a property defined as boolean in my IoT Central Template.
{
"@id": "urn:CompanyName:state:schema:info2:schema:enhanced:2",
"description": {
"en": "Enhanced Boolean Value"
},
"displayName": {
"en": "Enhanced"
},
"name": "enhanced",
"schema": "boolean"
},
After sending the message from my IoT device, in the IoT Central portal raw data, when I expand the Timestamp column I see this
"enhanced": true,
But in the raw data column for the specific telemetry message, I see this
"enhanced":"On",

Why is the true changed to "On"? Is there a way I can make the telemetry column display as true?

azure-iot-central
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@JaniceFerguson-0739 Did you check below suggestions? Do let us know if you need further help.

If the response is helpful, please click "Accept Answer" and upvote it.

0 Votes 0 ·

1 Answer

rkiss avatar image
1 Vote"
rkiss answered rkiss edited

Hi,

It looks like, this is a "annotated" issue for Semantic type = None and schema of the value = Boolean, where the Boolean value is mapped to the Off/On.

As a "dirty" workaround can be used to change its Sematic type to State, see my example:


   {
     "@id":"dtmi:rk2021iotcfree:demo12b:enhanced;1",
     "@type":[
       "Property",
       "State"
     ],
     "displayName":{
       "en":"Enhanced"
     },
     "name":"enhanced",
     "schema":{
       "@id":"dtmi:rk2021iotcfree:demo12b:enhanced:schema;1",
       "@type":"Enum",
       "enumValues":[
         {
                  
        "@id":"dtmi:rk2021iotcfree:demo12b:enhanced:schema:True;1",
           "displayName":{
             "en":"True"
           },
           "enumValue":"true",
           "name":"True"
         },
         {
           "@id":"dtmi:rk2021iotcfree:demo12b:enhanced:schema:False;1",
           "displayName":{
             "en":"False"
           },
           "enumValue":"false",
           "name":"False"
         }
       ],
       "valueSchema":"string"
     },
     "writable":false
   }



106188-image.png



Thanks
Roman



image.png (50.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.