Page 1 of 1

Auto-alias Light to Lights and Lamp

Posted: Saturday 29 December 2018 15:19
by philchillbill
I realise all the current Alexa integrations for smart home are gratefully using the standard Amazon API with its pre-defined utterances. So that 'turn on kitchen light' just works. I have some variations on 'light' in my Domoticz setup - e.g. 'lights' (plural) and 'lamp'. I notice Alexa is sometimes picky and when I accidentally say 'turn on kitchen light' instead of 'kitchen lights', she refuses. I also have a device called 'dining light'. Sometimes she just turns it on but sometimes she complains about not finding a device named 'dining ROOM light', which I didn't ask for and which I indeed don't have. Hmm.

A manual work-around I've found (in the Alexa app/console) is to create a group name as an alias to a similar device name. So if I create a group called 'kitchen light' and it contains the device 'kitchen lights', all is ok. Same with e.g. a group called 'dining room light' which contains my device 'dining light'. The similarity in group name and device name solves any mistakes I make in my utterance and any times that Alexa is PMS'ing. :mrgreen:

Does anybody know a way to auto-create groups during the discovery process so I don't have to do it manually with each new device? Meaning, if a device called 'XXX light' or 'XXX lights' or 'XXX lamp' is discovered, automatically create groups with entries that match my other variations on the device name. I'm building my own skill in python and haven't found any examples of doing this in the Amazon docs or forums.

Re: Auto-alias Light to Lights and Lamp

Posted: Sunday 30 December 2018 11:57
by Madgeni
Hi - it's a good question. I find Alexa much more fussy than Google on understanding also.

There's no means for creating Alexa groups on the fly as far as i know. Google do allow you to send a 'room hint' with a device, which I could use to help that recomendation, the issue with that is it means discovery is multiple calls to Domoticz as Room ID is in the getalldevices, but I have to make another call to get the Room Name. I think this would make discovery too slow.

Re: Auto-alias Light to Lights and Lamp

Posted: Monday 14 January 2019 9:09
by philchillbill
In the end, I got a solution working by adding the alias name to the device Description field in Domoticz for devices where I feel it's needed. A regex parses out the desired alias name during discovery, and, if an alias name exists, a second identical endpoint is created in Alexa but using the alias name as friendlyname and with the same Domoticz idx as the main device. Works perfectly.