Page 14 of 36

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

Posted: Friday 11 November 2016 12:48
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.

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

Posted: Friday 11 November 2016 13:08
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

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

Posted: Friday 11 November 2016 13:13
by Madgeni
it depends. If they allow 3rd party customisations, it's probably ok

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

Posted: Friday 11 November 2016 13:21
by Thelion
I will ask them to check..

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

Posted: Friday 11 November 2016 19:20
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)

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

Posted: Saturday 12 November 2016 23:58
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!

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

Posted: Sunday 13 November 2016 16:31
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)

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

Posted: Sunday 13 November 2016 22:42
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.

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

Posted: Monday 14 November 2016 9:02
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.

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

Posted: Monday 14 November 2016 16:55
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.

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

Posted: Tuesday 15 November 2016 16:59
by Madgeni
i know it's not related to Domoticz - but my Kodi integration (Alpha) is on my repo.

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

Posted: Wednesday 16 November 2016 23:04
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.

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

Posted: Thursday 17 November 2016 8:41
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');
}

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

Posted: Thursday 17 November 2016 14:08
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.

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

Posted: Thursday 17 November 2016 14:12
by Madgeni
Thanks @nigels0 - accepted with thanks!

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

Posted: Thursday 24 November 2016 16:33
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!

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

Posted: Thursday 24 November 2016 19:29
by Madgeni
Hi there -
glad it's of some use. Thermostats weren't supported, but i've made a change - please test it.

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

Posted: Thursday 24 November 2016 19:56
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!

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

Posted: Thursday 24 November 2016 20:02
by Madgeni
Hi there
according to the doc:

SetTargetTemperatureRequest

Example Utterances:
“Alexa, set the hall temp to x degrees”

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

Posted: Thursday 24 November 2016 20:24
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