Page 20 of 36

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Wednesday 01 February 2017 16:57
by dwmw2
markk, are you seeing this problem even after my fixes in https://github.com/madgeni/alexa_domo/issues/10 ? There should only be one call to Domoticz to discover all the devices now.

Domoticz lets you restrict which devices are visible to each user. Go to 'Edit Users', and see the 'Set Devices' button in the right-hand side of the table of users. You *did* add a separate Alexa user with a separate password, didn't you? :)

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Wednesday 01 February 2017 19:48
by markk
Hi. Thanks for this. No, I hadn't set up another user but have done that now :oops: . I changed the config.json to reflect the new user and password, re-zipped and uploaded and the test in Lambda is now loading just those devices. I then disabled and re-enabled the app and then discover devices on my phone but still can't see any devices loading. Should they be listed here?

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Wednesday 01 February 2017 21:34
by dwmw2
How long does the discovery take now? Is it quicker than Alexa's discovery timeout? You should be able to see the logs from when Alexa invokes the discovery, in your AWS console.

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Wednesday 01 February 2017 23:12
by markk
It takes just 7 seconds now to discover the devices in the Lambda test but still none of these are found by alexa. im really stumped. I can't see anything in the logs.

Code: Select all

{
  "header": {
    "namespace": "Alexa.ConnectedHome.Discovery",
    "name": "DiscoverAppliancesResponse",
    "payloadVersion": "2"
  },
  "payload": {
    "discoveredAppliances": [
      {
        "applianceId": "2",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "Dimmer",
        "friendlyName": "loungefrontlight",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "Dimmer",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "3",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "Dimmer",
        "friendlyName": "lounge back light",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "Dimmer",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "4",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "Dimmer",
        "friendlyName": "lounge wall light",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "Dimmer",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "7",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "lounge socket 1",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "8",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "Hallway socket",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "10",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "Dining room socket 1",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "11",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "Dimmer",
        "friendlyName": "Landinglight",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "Dimmer",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "13",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "Dimmer",
        "friendlyName": "Hallwaylight",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "Dimmer",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "14",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "Dimmer",
        "friendlyName": "Outsidelight",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "Dimmer",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "15",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "Gardenlights",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "18",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "Kitchen socket 1",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "19",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "Kitchen socket 2",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "20",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "Dimmer",
        "friendlyName": "Diningroomlight",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "Dimmer",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "22",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "Dimmer",
        "friendlyName": "Ourbedroomlight",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "Dimmer",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "33",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "Kitchen socket 3",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "34",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "Kitchen socket 4",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "135",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "Sparebedroom socket",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "402",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "Dimmer",
        "friendlyName": "Aimeeslight",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "Dimmer",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "653",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "Dimmer",
        "friendlyName": "Sparebedroomlight",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "Dimmer",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "666",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "Printer",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "2393",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "Aimee's Mirror",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "2464",
        "manufacturerName": "com",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "Bathroom UFH",
        "friendlyDescription": "Lighting 5",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "maxDimLevel": 32,
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "3204",
        "manufacturerName": "com",
        "modelName": "RollerTrol, Hasta new",
        "version": "Blinds",
        "friendlyName": "Lounge Blind",
        "friendlyDescription": "Blinds",
        "isReachable": true,
        "actions": [
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Blinds",
          "WhatAmI": "blind"
        }
      },
      {
        "applianceId": "3205",
        "manufacturerName": "com",
        "modelName": "RollerTrol, Hasta new",
        "version": "Blinds",
        "friendlyName": "Dining room blind",
        "friendlyDescription": "Blinds",
        "isReachable": true,
        "actions": [
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Blinds",
          "WhatAmI": "blind"
        }
      },
      {
        "applianceId": "3206",
        "manufacturerName": "com",
        "modelName": "RollerTrol, Hasta new",
        "version": "Blinds",
        "friendlyName": "Our Bedroom blind",
        "friendlyDescription": "Blinds",
        "isReachable": true,
        "actions": [
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Blinds",
          "WhatAmI": "blind"
        }
      }
    ]
  }
}
alexa.jpg
alexa.jpg (59.21 KiB) Viewed 2787 times

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Thursday 02 February 2017 10:15
by dwmw2
In node_modules/domoticz-api/api/domoticz.js around line 82 in the _request() function, uncomment some of the console.log() calls. You can potentially add/uncomment some in the top-level domapi.js too, to help see what's going on.

Now, in the AWS console where you're testing manually, find the 'Log output' section at the bottom right-hand side of the page, to the right of 'Summary', just below the 'Execution result' that you pasted above. It should say something like:

Code: Select all

The area below shows the logging calls in your code. These correspond to a single row within the
CloudWatch log group corresponding to this Lambda function. Click here to view the CloudWatch log group.
Where it says 'Click here', do so. There you'll be able to see the logs of the invocations that Alexa makes, as well as your own manual tests. Read the logs, see what's wrong... or add new console.log() calls and repeat until you can :)

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Thursday 02 February 2017 10:54
by markk
Thanks so much. I've just done this and the only calls in the log are the test ones. There's nothing else logged so it looks like when I hit "discover Devices" in alexa the command is getting through for some reason :?

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Thursday 02 February 2017 12:54
by markk
simonfr wrote:I'm using "English (U.S.)" as the language for the skill that I have created, and for the Lambda function I have the locale is set to "EU (Ireland)". I have taken the ARN for that Lambda function ("arn:aws:lambda:eu-west-1:xxxxxxxxxxxx:function:AlexaToDomiticzEUV4) and set it as the Service Endpoint Type for the Skill making sure that the region is set to Europe. I now have no Service Endpoint Type set for the North America region.

@simonrf

I think I have the same problem you had. I'm going to try to do what you did. Did you amend the OAUTH server details?

EDIT: I fixed it by following the instructions above and left all the 0AUTH server details as they were. I'm not at home to test but all my devices are now showing in alexa. Big thanks to all for being patient with me and to @dwmw2 for your help.

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Thursday 02 February 2017 22:54
by renerene
is there any news on Push norifications?
It would be great to send a notification from Domoticz to Alexa

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Friday 03 February 2017 10:28
by dwmw2
Alexa doesn't have any method at all for handling push notifications, does it? For any type of device or skill?

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Friday 03 February 2017 20:36
by Jem101
dwmw2 wrote:Alexa doesn't have any method at all for handling push notifications, does it? For any type of device or skill?
As far as I am aware, that indeed is the current situation.

Re: RE: Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Saturday 04 February 2017 9:00
by Lokonli
Jem101 wrote:
dwmw2 wrote:Alexa doesn't have any method at all for handling push notifications, does it? For any type of device or skill?
As far as I am aware, that indeed is the current situation.
Some workaround exists.

https://forums.developer.amazon.com/que ... tions.html

Verstuurd vanaf mijn SM-G800F met Tapatalk

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Saturday 04 February 2017 11:43
by Madgeni
I've been toying with the idea of push notifications - the 'cleanest' way would be to integrate MQTT with aws mq, then have a skill (via lambda) which reads those messages in turn. That way you keep your local domoticz decoupled. I've written something similar for my Kodi, so will take a look at it. However, it would require you to create some AWS MQ topics. I've written some brief instructions for my Kodi skill, but would need work.

Or Amazon could get a move on and implement push notifications like they said they would!

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Saturday 25 February 2017 20:13
by Madgeni
Amazon have just implemented the ability to ask Alexa for the temperature of a thermostat - but currently only for the US. I've written the code, but i'm guessing that if your Lambda/skill are not both hosted in the US & using English U.S it won't work.

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Wednesday 15 March 2017 19:28
by borcon
@Madgeni,

i need your help. The device discovery in alexa does not find any device. I have hosted your scripts in amazon virginia.
If i run the test with discovery or turn on/off on the webpage, it is working. But if search the devices in alexa, no device appears.
My friend tried it too, with the same result like me.
Please help us.
Thanks.

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Thursday 16 March 2017 12:38
by Madgeni
Is your alexa skill using English US?

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Friday 17 March 2017 8:21
by borcon
No, German DE.

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Friday 17 March 2017 11:06
by Madgeni
Hi there - can you host them in the EU (Ireland) region instead? Virginia doesn't support German language skills - thanks

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Friday 17 March 2017 18:02
by borcon
Hey Madgeni,
now it is working.
I am so happy.
Thank you very much for your help und these scripts, that makes the domoticz skill possible.

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Friday 17 March 2017 19:16
by Madgeni
Cool, really pleased it's working now :)

Re: Amazon Echo to Domoticz Bridge: switches, sensors & more

Posted: Thursday 06 April 2017 9:33
by Madgeni
Couple of changes - updated error handling with the backend. If your host is unavailable, or connection is refused, this should be handled more gracefully, and Alexa should tell you something a little more useful.
More importantly, Borcon has come up with a lovely way of making more useful names :) Read the manual, and have a play. I'd imagine you'd need to forget and rediscover your devices also