alexa_domo
alexa_domo copied to clipboard
Alexa not discovering scenes
I have scenes which have been working for a long time, but I've just added a new one to Domoticz and Alexa doesn't discover it. She only discovers new devices, not scenes. Logs show that it's really in the results being given back (I've made it visible to the alexa
user in Domoticz, and added it to a room):
2018-05-01T21:03:00.489Z 07dabb83-4d83-11e8-8ff1-1583c7a5798f **** payload: : [
…
{
"applianceId": 202,
"manufacturerName": "Upstairs lights",
"modelName": "Upstairs lights",
"version": "2",
"friendlyName": "Upstairs lights",
"friendlyDescription": "Group",
"isReachable": true,
"actions": [
"turnOn",
"turnOff"
],
"additionalApplianceDetails": {
"WhatAmI": "scene",
"SceneIDX": 202
}
}
,
…
Hm, these scenes are actually being reported twice in the output. I wonder if that's the problem?
I have it working now. I think there were two problems: it needs a string, (i.e. { "applianceId": "202" }
)... and I already had an actual device with ID "202". I got it working by adding 2000 instead:
const idx = parseInt(device.idx) + 2000
appliancename.manufacturerName = device.name,
appliancename.modelName = device.name,
appliancename.version = device.idx,
appliancename.applianceId = idx.toString()
... but if it's a string, then we should be able to denote scenes by prefixing them with strings instead of playing numberspace games and praying to the deity of our choice that they don't conflict again. I'll see if I can get that working correctly and submit a PR.