Page 18 of 36

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

Posted: Thursday 15 December 2016 15:38
by Madgeni
hah :)

The friendlyName is just lifted from Domoticz - so i'm afraid you'd need to change them in Domoticz, delete the discovered devices in ALexa, then rediscover.

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

Posted: Thursday 15 December 2016 16:26
by heggink
Apologies if this was asked before but can I use this to trigger scenes and/of groups?

Sent from mTalk

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

Posted: Thursday 15 December 2016 16:28
by Madgeni
Groups yes, Scenes no

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

Posted: Thursday 12 January 2017 18:04
by fergalom
fergalom wrote:
Madgeni wrote:1. Argh! This seems to be a very strange issue, where it seems fine for some people, and wrong for others. What type of Dimmers do you have out of interest?
2. I'll take a look - not sure what happens to the payload, as the integer seems to be there, so not sure why Alexa doesn't interpret it
3. I'm afraid that currently Alexa doesn't support asking via the Smart Home Skill. As soon as it does, i'll implement it. The only way to get this would be to rebuild it as a Custom skill (Alexa, ask 'Home' what the temperature is in the front room etc etc) - but would be a piece of work to do this. I'm loathe to whilst this is allegedly on Alexa's roadmap for Smart Home
4. Can you give me a couple of user stories for multi-selector switches to work with?
They are all dummy dimmers - Type: Light/switch - Switch: Dimmer

Using multi-selectors to enable various airplay speakers around the house, quickly set heating modes, select & play some radio channels.
Interestingly if you ask alexa to set a multi-selector switch to a percentage, it works sort of (the dimming issue skews it).

Coming back to this topic on dimmers, it seems there are 3 types
Dimmer - setlevel range 0-16
Dimmer - setlevel range 0-32
Dimmer - setlevel range 0-100

From a /json.htm?type=devices&rid=348 query, each dimmer lists a "MaxDimLevel:"

Can this be used in your code to implement the correct dimming scale?

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

Posted: Friday 13 January 2017 11:18
by thos
fergalom wrote:
fergalom wrote:
Madgeni wrote:1. Argh! This seems to be a very strange issue, where it seems fine for some people, and wrong for others. What type of Dimmers do you have out of interest?
2. I'll take a look - not sure what happens to the payload, as the integer seems to be there, so not sure why Alexa doesn't interpret it
3. I'm afraid that currently Alexa doesn't support asking via the Smart Home Skill. As soon as it does, i'll implement it. The only way to get this would be to rebuild it as a Custom skill (Alexa, ask 'Home' what the temperature is in the front room etc etc) - but would be a piece of work to do this. I'm loathe to whilst this is allegedly on Alexa's roadmap for Smart Home
4. Can you give me a couple of user stories for multi-selector switches to work with?
They are all dummy dimmers - Type: Light/switch - Switch: Dimmer

Using multi-selectors to enable various airplay speakers around the house, quickly set heating modes, select & play some radio channels.
Interestingly if you ask alexa to set a multi-selector switch to a percentage, it works sort of (the dimming issue skews it).

Coming back to this topic on dimmers, it seems there are 3 types
Dimmer - setlevel range 0-16
Dimmer - setlevel range 0-32
Dimmer - setlevel range 0-100

From a /json.htm?type=devices&rid=348 query, each dimmer lists a "MaxDimLevel:"

Can this be used in your code to implement the correct dimming scale?
Take a look at this change - https://github.com/thosirl/alexa_domo/c ... c13480fd7c

It passes through MaxDimLevel as part of the additionalApplianceDetails, and then uses it to calculate a 'proper'' percentage based on the level range.

This works for my LightwaveRF dimmers, where they have a range of 0-32, so diving by 3.125 (100/32) gives me the proper percentage.

Let me know if this works for, and I can make a pull request.

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

Posted: Friday 13 January 2017 12:36
by fergalom
Thanks for this - will do.

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

Posted: Friday 13 January 2017 13:34
by Madgeni
That's great thos- thanks :)
In my defence, i'm not sure MaxDimLevel is in the domoticz API doc :)

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

Posted: Saturday 14 January 2017 1:53
by fergalom
Thos, had to do another minor change to domoticz.js to get all dimmers to work as you would expect.
https://github.com/fergalom/alexa_domo/ ... 70a6e39c34

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

Posted: Saturday 14 January 2017 10:56
by thos
Cool, yes, works for me now too. (That'll teach me for testing remotely!)

Can you make a pull request, and I'll do same back to Madgeni and we can maybe get this all back together?

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

Posted: Saturday 14 January 2017 15:53
by fergalom
thos wrote:Cool, yes, works for me now too. (That'll teach me for testing remotely!)

Can you make a pull request, and I'll do same back to Madgeni and we can maybe get this all back together?
Will do this afternoon, thanks for your help

Sent from my SM-G930F using Tapatalk

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

Posted: Saturday 14 January 2017 19:02
by Itschi
Hi

I followed Madgeni's instructions and got the Lambda funtion to work. The discovery results in

Code: Select all

{
  "header": {
    "namespace": "Alexa.ConnectedHome.Discovery",
    "name": "DiscoverAppliancesResponse",
    "payloadVersion": "2"
  },
  "payload": {
    "discoveredAppliances": [
      {
        "applianceId": "509",
        "manufacturerName": "Y-Hub",
        "modelName": "RGBW",
        "version": "Dimmer",
        "friendlyName": "Wohnzimmer Stehlampe",
        "friendlyDescription": "Lighting Limitless/Applamp",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Dimmer",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "257",
        "manufacturerName": "TRX",
        "modelName": "AC",
        "version": "On/Off",
        "friendlyName": "Jonas Lampinons",
        "friendlyDescription": "Lighting 2",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "55",
        "manufacturerName": "Temperatur Büro",
        "modelName": "THR128/138, THC138",
        "version": "temp",
        "friendlyName": "Büro",
        "friendlyDescription": "Temp",
        "isReachable": true,
        "actions": [
          "setTargetTemperature"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
      {
        "applianceId": "17",
        "manufacturerName": "Brauchwasserwärmepumpe",
        "modelName": "AC",
        "version": "On/Off",
        "friendlyName": "Brauchwasserwärmepumpe",
        "friendlyDescription": "Lighting 2",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "477",
        "manufacturerName": "TRX",
        "modelName": "ELRO AB400",
        "version": "On/Off",
        "friendlyName": "Lichterkette DG",
        "friendlyDescription": "Lighting 1",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "199",
        "manufacturerName": "Sauna",
        "modelName": "SetPoint",
        "version": "temp",
        "friendlyName": "Sauna Temperatur",
        "friendlyDescription": "Thermostat",
        "isReachable": true,
        "actions": [
          "setTargetTemperature"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
      {
        "applianceId": "35",
        "manufacturerName": "TRX",
        "modelName": "RFY",
        "version": "Venetian Blinds US",
        "friendlyName": "Jonas",
        "friendlyDescription": "RFY",
        "isReachable": true,
        "actions": [
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Venetian Blinds US",
          "WhatAmI": "blind"
        }
      },
      {
        "applianceId": "478",
        "manufacturerName": "Harmony Hub",
        "modelName": "AC",
        "version": "Push On Button",
        "friendlyName": "Alles aus",
        "friendlyDescription": "Lighting 2",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Push On Button",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "203",
        "manufacturerName": "Brauchwasserwärmepumpe",
        "modelName": "THR128/138, THC138",
        "version": "temp",
        "friendlyName": "Brauchwasser",
        "friendlyDescription": "Temp",
        "isReachable": true,
        "actions": [
          "setTargetTemperature"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
      {
        "applianceId": "523",
        "manufacturerName": "Samsung Navibot",
        "modelName": "Switch",
        "version": "Push On Button",
        "friendlyName": "Saugroboter Start/Stop",
        "friendlyDescription": "Light/Switch",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Push On Button",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "256",
        "manufacturerName": "TRX",
        "modelName": "AC",
        "version": "On/Off",
        "friendlyName": "Jonas Licht",
        "friendlyDescription": "Lighting 2",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "13",
        "manufacturerName": "Keller-Temperatur",
        "modelName": "THR128/138, THC138",
        "version": "temp",
        "friendlyName": "WP-Ablufttemperatur",
        "friendlyDescription": "Temp",
        "isReachable": true,
        "actions": [
          "setTargetTemperature"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
      {
        "applianceId": "202",
        "manufacturerName": "Sauna",
        "modelName": "THR128/138, THC138",
        "version": "temp",
        "friendlyName": "Sauna",
        "friendlyDescription": "Temp",
        "isReachable": true,
        "actions": [
          "setTargetTemperature"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
      {
        "applianceId": "34",
        "manufacturerName": "TRX",
        "modelName": "RFY",
        "version": "Blinds Inverted",
        "friendlyName": "Wintergarten horizontal",
        "friendlyDescription": "RFY",
        "isReachable": true,
        "actions": [
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Blinds Inverted",
          "WhatAmI": "blind"
        }
      },
      {
        "applianceId": "488",
        "manufacturerName": "Harmony Hub",
        "modelName": "AC",
        "version": "Push On Button",
        "friendlyName": "Ambiente Beleuchtung",
        "friendlyDescription": "Lighting 2",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Push On Button",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "200",
        "manufacturerName": "Sauna",
        "modelName": "AC",
        "version": "On/Off",
        "friendlyName": "Sauna",
        "friendlyDescription": "Lighting 2",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "526",
        "manufacturerName": "TRX",
        "modelName": "ARC",
        "version": "On/Off",
        "friendlyName": "Heizlüfter Bad DG",
        "friendlyDescription": "Lighting 1",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "490",
        "manufacturerName": "TRX",
        "modelName": "ELRO AB400",
        "version": "On/Off",
        "friendlyName": "Luftbefeuchter",
        "friendlyDescription": "Lighting 1",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "33",
        "manufacturerName": "TRX",
        "modelName": "RFY",
        "version": "Blinds Inverted",
        "friendlyName": "Wintergarten vertikal",
        "friendlyDescription": "RFY",
        "isReachable": true,
        "actions": [
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Blinds Inverted",
          "WhatAmI": "blind"
        }
      },
      {
        "applianceId": "460",
        "manufacturerName": "TRX",
        "modelName": "Alecto WS1700",
        "version": "temp",
        "friendlyName": "Wohnzimmer",
        "friendlyDescription": "Temp + Humidity",
        "isReachable": true,
        "actions": [
          "setTargetTemperature"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
      {
        "applianceId": "39",
        "manufacturerName": "TRX",
        "modelName": "Imagintronix",
        "version": "temp",
        "friendlyName": "Erdfeuchte Pflanzen DG",
        "friendlyDescription": "Temp + Humidity",
        "isReachable": true,
        "actions": [
          "setTargetTemperature"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
      {
        "applianceId": "36",
        "manufacturerName": "TRX",
        "modelName": "RFY",
        "version": "Venetian Blinds US",
        "friendlyName": "Charlotte",
        "friendlyDescription": "RFY",
        "isReachable": true,
        "actions": [
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Venetian Blinds US",
          "WhatAmI": "blind"
        }
      },
      {
        "applianceId": "468",
        "manufacturerName": "TRX",
        "modelName": "Alecto WS1700",
        "version": "temp",
        "friendlyName": "Flur im DG",
        "friendlyDescription": "Temp + Humidity",
        "isReachable": true,
        "actions": [
          "setTargetTemperature"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
      {
        "applianceId": "491",
        "manufacturerName": "Y-Hub",
        "modelName": "RGBW",
        "version": "Dimmer",
        "friendlyName": "Schlafzimmer Nachtlicht",
        "friendlyDescription": "Lighting Limitless/Applamp",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Dimmer",
          "WhatAmI": "light"
        }
      },
      {
        "applianceId": "236",
        "manufacturerName": "FritzBox",
        "modelName": "AC",
        "version": "On/Off",
        "friendlyName": "Anruf",
        "friendlyDescription": "Lighting 2",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      }
    ]
  }
}
If I try to discover the devices in the Alexa App I can see according Lambda log entries but the App doesn't find any devices

Code: Select all


17:54:43
START RequestId: 87103a08-da82-11e6-9da3-3fb737760ad9 Version: $LATEST
START RequestId: 87103a08-da82-11e6-9da3-3fb737760ad9 Version: $LATEST

17:54:55
END RequestId: 87103a08-da82-11e6-9da3-3fb737760ad9
END RequestId: 87103a08-da82-11e6-9da3-3fb737760ad9

17:54:55
REPORT RequestId: 87103a08-da82-11e6-9da3-3fb737760ad9	Duration: 12433.59 ms	Billed Duration: 12500 ms Memory Size: 512 MB	Max Memory Used: 41 MB
REPORT RequestId: 87103a08-da82-11e6-9da3-3fb737760ad9	Duration: 12433.59 ms	Billed Duration: 12500 ms Memory Size: 512 MB	Max Memory Used: 41 MB	


Any idea what I can do?

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

Posted: Sunday 15 January 2017 8:12
by Lokonli
Did you run the lambda function from US East (N. Virginia)? EU (Ireland) didn't work for me.

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

Posted: Sunday 15 January 2017 10:31
by Itschi
Yes, tried EU Ireland and N. Verginia. As I said, the Lambda test works and discovers my devices and I can see that searching the devices with the app results in a log entry for the Lambda function (also in EU). The alexa skill definitly triggers the Lambda function. The device dicovery takes 15s. Maybe that's a problem?

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

Posted: Sunday 15 January 2017 11:19
by Lokonli
Itschi wrote:Yes, tried EU Ireland and N. Verginia. As I said, the Lambda test works and discovers my devices and I can see that searching the devices with the app results in a log entry for the Lambda function (also in EU). The alexa skill definitly triggers the Lambda function. The device dicovery takes 15s. Maybe that's a problem?
The lambda test function indeed runs correctly in EU, but somehow the communication between Alexa Smarthome skill and a lambda function in EU goes wrong.
Just to be sure (I've no other ideas): did you update the endpoint in the skill to the US East lambda function as well? And disabled and enabled the skill?

Verstuurd vanaf mijn SM-G800F met Tapatalk

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

Posted: Sunday 15 January 2017 11:22
by renerene
What do I have to do to automatic start HA Bridge after reboot of my Pi?
These commands are used to start HA Bridge:
cd habridge
sudo ./starthabridge.sh

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

Posted: Sunday 15 January 2017 11:33
by dwmw2
It fails to return any devices if the last room in the plan has none. Temporary fix has it working locally; I'll follow up with a PR when I don't have to marshal children....

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

Posted: Sunday 15 January 2017 14:49
by Itschi
Hi Lokonli,

Yes, I change the endpoint as well and also disabled / enabled the skill. The only thing that is a bit wired is that in Virgina the Lambda logging doesn't work. It states "There was an error loading Log Streams.". That's why I don't see whether or not the Lambda function is really called like in EU. However, the Lambda test works in Virginia and EU but in Virgina it takes almost twice a s long.

Regards, Itschi

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

Posted: Sunday 15 January 2017 17:00
by dwmw2
For me it works in the EU but although *testing* invocations take only 8s or so, the real invocations from Alexa to discover devices seem to take more than 20 seconds, and thus they time out and fail. I'm going to experiment with not using 'Connection: close', and more efficient ways to enumerate devices...

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

Posted: Monday 16 January 2017 11:54
by Madgeni
Hi -

I feel i should defend the code and it's organic growth..
Originally, i was getting all devices, and depending on Type, discovering. PlanID isn't documented, and tbh I don't recall seeing it when I first started out on this. Whilst it is no doubt cleaner, as it's 1 API call, rather than several - i'm concerned at the time your discovery is taking, given I can discover 40 odd devices across several rooms in <5 sec via Alexa, so performance was acceptable, and the solution valid.

Saying that, happy with PlanID to be used as the control method, definitely easier to revert back to the original logic.

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

Posted: Wednesday 18 January 2017 23:42
by markk
Hi. Just got my echo dot and would love to integrate it with my Domoticz. I have no programming skills whatsoever but I am pretty good at following instructions. I have been all through this thread and am still confused. Someone asked if there were any step by step instructions but I can't see any. Did anything come of this?