alexa_domo icon indicating copy to clipboard operation
alexa_domo copied to clipboard

Alexa not discovering scenes

Open dwmw2 opened this issue 6 years ago • 2 comments

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
    }
}
,
…

dwmw2 avatar May 01 '18 21:05 dwmw2

Hm, these scenes are actually being reported twice in the output. I wonder if that's the problem?

dwmw2 avatar May 10 '18 10:05 dwmw2

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.

dwmw2 avatar May 10 '18 11:05 dwmw2