Amazon Echo to Domoticz Bridge: switches, sensors & more

Alexa, Google Home and Siri

Moderator: leecollings

Madgeni
Posts: 1571
Joined: Friday 25 March 2016 17:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Madgeni »

ah ok - i remember now :)
So, setPercentage *should* work - Inc/Dec are for the future, when I get around to it. They require me to get current levels then increment/decrement from that.
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
Thelion
Posts: 54
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: The Netherlands
Contact:

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

Post by Thelion »

Hi!

There is a Kickstarter project called LUCY (https://www.kickstarter.com/projects/17 ... tal-butler), which uses AWS, should this bridge also work for LUCY ?

According to the project-owner, I should have LUCY somewhere in february, but it would be nice to have a start.

Thanks!

Regards,

Martijn
Madgeni
Posts: 1571
Joined: Friday 25 March 2016 17:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Madgeni »

it depends. If they allow 3rd party customisations, it's probably ok
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
Thelion
Posts: 54
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: The Netherlands
Contact:

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

Post by Thelion »

I will ask them to check..
Madgeni
Posts: 1571
Joined: Friday 25 March 2016 17:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Madgeni »

fixed an issue with discovery, Temp devices didn't have subtype, so version was missing. if you're having any issues, pull that one.

tested dimming - "set 'dimmer' to 50%" etc works fine (caveated with my testing a dummy light)
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

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

Post by nigels0 »

Strange - the dimming still isn't fully working for me.

set to 10% gives me 28% on Domoticz
20% 59%
30% 90%
40% upward 96%

Now it is consistent!
Madgeni
Posts: 1571
Joined: Friday 25 March 2016 17:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Madgeni »

clearly something strange going on.
Alexa will pass a percentage value - reading the domoticz API ref:
"Level should be a value between 1 (0%) and 16 (100%). Though in some cases you need to use the percentage, so if 1 to 16 doesn't work for you , then try 1 to 100 (without the percentage symbol)"

However, when I did that, it sets them to weird levels (again, it's only tested against a dummy dimmer).
I've done the conversion again, and it seems to work now (its just the Domoticz.api under node_modules/domoticz-api)
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

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

Post by nigels0 »

Indeed. I'll try the new version.

Just as a bug fix though, the blinds should be put back to the correct values in domapi.js (on = On, Off=Off - although they still don't work with Open/Close through Alexa, it is more logical that turn on closes the blinds and turn off opens them. Looking at the Lambda documentation, it seems that the functions should support a type of window blinds, but I'm really not sure how you would call them as Open/Close seems to be a bit tragic.
Madgeni
Posts: 1571
Joined: Friday 25 March 2016 17:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Madgeni »

ok, switched it back.
re: utterances, open/close aren't officially supported (i can't even find them available at all) at the moment.
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

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

Post by nigels0 »

yes, now Open and Close aren't recognised (they used to be - but the wrong way around!). Must be still in development.

Interesting that now German is a supported language.
Madgeni
Posts: 1571
Joined: Friday 25 March 2016 17:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Madgeni »

i know it's not related to Domoticz - but my Kodi integration (Alpha) is on my repo.
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

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

Post by nigels0 »

I built a bridge to B&O kit to do the similar thing to XBMC, but I find that if I'm controlling something that makes a noise - the Dot can't hear me! I tend only to use it to switch kit on and off.

I tried the dimmers and still has the same errors. I'm using lightwave protocols. Maybe that has something to do with it as Domoticz is reporting a completely different value as well - and the Lightwave switches are 1-way.

In your code though, the changeSwitchState procedure - the calc to get the right dimming number is commented out. Maybe I'm not understanding it well enough.

I've always used 1-32 with the JSON call and that works well enough with these dimmers.
Madgeni
Posts: 1571
Joined: Friday 25 March 2016 17:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Madgeni »

It's controlled through the domoticz.js (the API wrapper i use):
if (params.type == 'dimmable')
{
url.addSearch("level", parseInt((parseInt(params.state) / 32) * 100));
//url.addSearch("level", params.state)
url.addSearch("switchcmd", 'Set Level');
url.addSearch("param", 'switchlight');
}
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

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

Post by nigels0 »

There was a typo (100 and 32 reversed). You also need to add 1 - I've created a pull request in the git. I can say that this is now working well when asking for a certain percentage.
Madgeni
Posts: 1571
Joined: Friday 25 March 2016 17:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Madgeni »

Thanks @nigels0 - accepted with thanks!
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by cherowley »

Hi!

Fantastic skill!

I was hoping to be able to set my thermostats:

340 Virtual 00141A3 1 Hot Water Thermostat Thermostat SetPoint 50.0 - - Set UnusedRename Device Log ...
323 Virtual 0014192 1 House Thermostat Thermostat SetPoint 18.5 - - Set UnusedRename Device Log ...
335 Virtual 001419E 1 ThermTestSetPoint Thermostat SetPoint 21.5 - - Set UnusedRename Device Log ...

But none of these show up after discovering devices. Is this normal, I mean, are these device types not supported as yet?

Thanks!
Madgeni
Posts: 1571
Joined: Friday 25 March 2016 17:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Madgeni »

Hi there -
glad it's of some use. Thermostats weren't supported, but i've made a change - please test it.
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by cherowley »

Wow many thanks for the super quick code change :)

Dumbs questions:

How do I phrase the set temperature command?

And

How do phrase the ask temperature command? For example for a sensor called hall temp?

Currently I only get unable to answer that question response or she tells me the local forecast, doh!
Madgeni
Posts: 1571
Joined: Friday 25 March 2016 17:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Madgeni »

Hi there
according to the doc:

SetTargetTemperatureRequest

Example Utterances:
“Alexa, set the hall temp to x degrees”
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by cherowley »

HIya,

Hmm, the stats are still not discovered, also a few other devices are missing too.

Also, can't seem to find the correct phrase to ask for a temperature reading...

Ah, it's no longer working -

{
"errorMessage": "Unexpected token <<",
"errorType": "SyntaxError",
"stackTrace": [
"Module._compile (module.js:373:25)",
"Object.Module._extensions..js (module.js:416:10)",
"Module.load (module.js:343:32)",
"Function.Module._load (module.js:300:12)",
"Module.require (module.js:353:17)",
"require (internal/module.js:12:17)",
"Object.<anonymous> (/var/task/domapi.js:1:78)",
"Module._compile (module.js:409:26)",
"Object.Module._extensions..js (module.js:416:10)"
]
}


20:00:14
START RequestId: 9d5bb61c-b280-11e6-a783-19a6abfe8980 Version: $LATEST

20:00:14
Syntax error in module 'domapi': SyntaxError at Object.Module._extensions..js (module.js:416:10)

20:00:14
END RequestId: 9d5bb61c-b280-11e6-a783-19a6abfe8980

20:00:14
REPORT RequestId: 9d5bb61c-b280-11e6-a783-19a6abfe8980 Duration: 0.36 ms Billed Duration: 100 ms Memory Size: 512 MB Max Memory Used: 16 MB

20:00:20
START RequestId: a0ed4107-b280-11e6-9b20-2d8d92dbba44 Version: $LATEST

20:00:20
Syntax error in module 'domapi': SyntaxError at Object.Module._extensions..js (module.js:416:10)

20:00:20
END RequestId: a0ed4107-b280-11e6-9b20-2d8d92dbba44

20:00:20
REPORT RequestId: a0ed4107-b280-11e6-9b20-2d8d92dbba44 Duration: 0.35 ms Billed Duration: 100 ms Memory Size: 512 MB Max Memory Used: 16 MB

20:00:29
START RequestId: a6740ca8-b280-11e6-a0cd-c3e6f86484b8 Version: $LATEST

20:00:29
Syntax error in module 'domapi': SyntaxError at Object.Module._extensions..js (module.js:416:10)

20:00:29
END RequestId: a6740ca8-b280-11e6-a0cd-c3e6f86484b8

20:00:29
REPORT RequestId: a6740ca8-b280-11e6-a0cd-c3e6f86484b8 Duration: 0.34 ms Billed Duration: 100 ms Memory Size: 512 MB Max Memory Used: 16 MB
Last edited by cherowley on Thursday 24 November 2016 21:08, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest