GPS location for IoT central map tile - azure

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.

Related

Unable to invoke Task module in MS Teams botbuilder bot via adaptive card

I have been trying to invoke the task module using adaptive card in Microsoft Teams bot by modifying the echo bot sample from botbuilder framework v1.3 in nodejs. I'm using the TeamsActivityHandler as instructed by the docs. Normal buttons seems to work fine, but the button type with task/fetch doesn't seems to be working as expected. Here is the card json:
{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3",
"body": [
{
"type": "TextBlock",
"text": "TaskModule Card",
"wrap": true
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Invoke",
"data": {
"msteams": {
"type": "task/fetch"
}
}
}
]
}
]
}
When I click the button, it does not send any data back to the bot's backend to trigger handleTeamsTaskModuleFetch() method. Even the button animation that makes it gray while making call to the backend is not happening here.
Even the same happens with the example provided here github. How to fix this issue?

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

Azure IoT Central - Enum value displaying blank value in Dashboard

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.

how to map distinct custom skillset to index

trying to add custom skill in the skillset and map it in the index
here is in detail
I'm using the azure Named Entity Recognition in my skillset as
{
"#odata.type": "#Microsoft.Skills.Text.MergeSkill",
"description": "Merge text content with image tags",
"insertPreTag": " ",
"context": "/document",
"inputs": [
{
"name": "text",
"source": "/document/fullTextAndCaptions"
},
{
"name": "itemsToInsert",
"source": "/document/normalized_images/*/Tags/*/name"
}
],
"outputs": [
{
"name": "mergedText",
"targetName": "finalText"
}
]
}
and in the indexer as
{
"sourceFieldName": "/document/finalText/pages/*/entities/*/value",
"targetFieldName": "entities"
},
{
"sourceFieldName": "/document/finalText/pages/*/locations/*",
"targetFieldName": "locations"
},
and it works 100% now I want to add the Distinct custom skill from https://github.com/Azure-Samples/azure-search-power-skills/tree/master/Text/Distinct
I did publish the function and when I go to test it manually it works as expected.
however overall its not working in skillset. I want it to take the location and filter it and output the distinct only in it's own field in the search index.
I'm having a really hard time to configure the skillset and indexer to get it to work.
any help please?
You'll need to add the distinct custom skill like this, assuming you want to dedup over the whole document
{
"skills": [
...
{
"#odata.type": "#Microsoft.Skills.Custom.WebApiSkill",
"description": "Distinct skill",
"uri": "<https://distinct-skill>",
"context": "/document",
"inputs": [
{
"name": "locations",
"source": /document/finalText/pages/*/locations/*"
}
],
"outputs": [
{
"name": "distinct",
"targetName": "distinctLocations"
}
]
}
...
]
}
and an output field mapping to put it into the index.
{
"sourceFieldName": "/document/distinctLocations",
"targetFieldName": "distinctLocations"
}
See https://learn.microsoft.com/en-us/azure/search/cognitive-search-custom-skill-interface#consuming-custom-skills-from-skillset for adding a custom skill.
The skill inputs for the custom skill must be configured to point to the data you want to disambiguate. In this case, you didn't really need to modify the code, all you had to do was have an input with name 'words' and source '/document/finalText/pages//locations/'.

Amexon alexa development InvalidIntentSamplePhraseSlot issue

I'm getting an error: cannot include both a phrase slot and another intent slot. Error code: InvalidIntentSamplePhraseSlot while building Alexa skill.
Sample JSON is as follows,
{
"name": "HackathonListIntent",
"slots": [
{
"name": "resultCount",
"type": "AMAZON.NUMBER"
},
{
"name": "search1",
"type": "AMAZON.SearchQuery"
},
{
"name": "search2",
"type": "AMAZON.SearchQuery"
}
],
"samples": [
"{resultCount} for {search1} from {search2}",
]}
resultCount: skill fetch thousands of result from backend this parameter will restrict result length as per users convenience.
search1 and search2 are different independent search parameter which user may ask.
FYI: I have tried this
For the InvalidIntentSamplePhraseSlot issue, according to Amazon's documentation, you can only use one AMAZON.SearchQuery slot per intent.
"Make sure that your skill uses no more than one AMAZON.SearchQuery slot per intent."
https://developer.amazon.com/docs/custom-skills/slot-type-reference.html#amazonsearchquery
Also, for your sample entry make sure the array with one item does not include a comma. It will cause an Invalid JSON error.
"samples": [
"{resultCount} for {search1} from {search2}"
]}
AMAZON.SearchQuery are limited to 1 slot per intent and also it will need a phrase along with the slot. I would suggest you to use AMAZON.Person as it can take any value and dose not need a phrase.
{
"name": "HackathonListIntent",
"slots": [
{
"name": "resultCount",
"type": "AMAZON.NUMBER"
},
{
"name": "search2",
"type": "AMAZON.Person"
},
{
"name": "search2",
"type": "AMAZON.Person"
}
],
"samples": [
"{resultCount} for {search1} from {search2}"
]
}

Resources