Page 5 of 17
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Thursday 23 May 2019 20:31
by abaratian
I Followed the very well written documment to create the alexa skill. When i test the script in the website it is OK. I can discover devices and read temperature sensor but. when i add the skill on my phone it doesn't discover any devices. any help?
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Saturday 25 May 2019 9:19
by philchillbill
Sounds like a region vs locale issue. Alexa discovers devices for the ARN location linked to the Amazon store account of the echo in use. So e.g. if you are in Germany and your store is Amazon.de, the ARN for discovery is EU-west-1 (Ireland). If your skill was created with US-east-1 and is en-US, you will not discover any devices. Hope that's clear.
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Saturday 25 May 2019 18:41
by abaratian
philchillbill wrote: ↑Saturday 25 May 2019 9:19
Sounds like a region vs locale issue. Alexa discovers devices for the ARN location linked to the Amazon store account of the echo in use. So e.g. if you are in Germany and your store is Amazon.de, the ARN for discovery is EU-west-1 (Ireland). If your skill was created with US-east-1 and is en-US, you will not discover any devices. Hope that's clear.
Hi, my arn is eu-west-1 and my location is sweden. I also checked my amazon account country and it is set to sweden. I also tried with arn us-west-2 and account location set to us. still no luck
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Saturday 25 May 2019 18:45
by philchillbill
Hmm. Do you work with room plans? Only devices in room plans are discovered. If you don’t use them then a tiny change to the Python is necessary.
Sent from my iPhone using Tapatalk
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Sunday 26 May 2019 5:44
by abaratian
philchillbill wrote: ↑Saturday 25 May 2019 18:45
Hmm. Do you work with room plans? Only devices in room plans are discovered. If you don’t use them then a tiny change to the Python is necessary.
Sent from my iPhone using Tapatalk
yes, i use room plans. as i said in my first post when i run the test discovery script in the lambda management console it works fine and it discovers my devices. i also tried to read a temp sensor and the value was right. the problem is with the alexa not discovering the devices when i add the skill.
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Thursday 13 June 2019 8:07
by abaratian
philchillbill wrote: ↑Saturday 25 May 2019 9:19
Sounds like a region vs locale issue. Alexa discovers devices for the ARN location linked to the Amazon store account of the echo in use. So e.g. if you are in Germany and your store is Amazon.de, the ARN for discovery is EU-west-1 (Ireland). If your skill was created with US-east-1 and is en-US, you will not discover any devices. Hope that's clear.
Hi again,
It was a region issue indeed! Curiously enough, for me, it only works when region is set to N. Virginia!! I had to try possible combinations to make it work.
Does anyone know how can I query status of a device or switch? I can see a light is 'Off' or a door is 'Closed' by tapping on the device in the alexa app. But when i ask her what's the status of the DEVICENAME? Or is the DEVICENAME open? or is DEVICENAME on? It doesn't work and alexa replies DEVICENAME doesn't support that. How can i make it work?
Another thing is that when i ask alexa what is the temperature inside, the temperature she says is around 5 degrees less than the average temperature of my sensors. (i.e. all my sensors are in the 24.x range and she reports a temp in 19.x range.) My thermostat is set at 24.5 now. (Just to clarify that is not what she reports)
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Thursday 13 June 2019 10:15
by philchillbill
It's not mentioned in the Amazon docs and it took me a long time to find it, but querying state ("Alexa, is the front door open?") only works when the endpoint device in question has the
Alexa.EndpointHealth interface included during discovery.
In AlexaSmartHome.py, you need to paste:
Code: Select all
@INTERFACES.register('Alexa.EndpointHealth')
class AlexaEndpointHealth(AlexaInterface):
def name(self):
return 'Alexa.EndpointHealth'
def propertiesSupported(self):
return [{'name': 'connectivity'}]
and in the code for the method
serializeProperties, add the line
Code: Select all
if prop_name == 'connectivity': prop_value = { 'value': 'OK' }
in DomoticzHandler.py, add this line to the __init__ for class Domoticz (it then gets added to all endpoints):
Code: Select all
self.addCapability(AlexaEndpointHealth(self, 'Alexa.EndpointHealth',[{'name': 'connectivity'}]))
Now re-discover devices and state-querying should work. I've asked Amazon to update their docs with this.
Note that you
cannot request the state of a switch as it's simply not (yet) supported by Alexa. Querying only works for devices of type Alexa.ContactSensor and Alexa.MotionSensor.
Regarding your thermostat temperature reporting, take a look in the Cloudwatch logs to see if you can debug. In DomoticzHandler.py the
getProperty method has a test "elif prop == 'temperature'" and whatever that is returning must be incorrect.
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Saturday 15 June 2019 16:05
by abaratian
philchillbill wrote: ↑Thursday 13 June 2019 10:15
It's not mentioned in the Amazon docs and it took me a long time to find it, but querying state ("Alexa, is the front door open?") only works when the endpoint device in question has the
Alexa.EndpointHealth interface included during discovery.
In AlexaSmartHome.py, you need to paste:
Code: Select all
@INTERFACES.register('Alexa.EndpointHealth')
class AlexaEndpointHealth(AlexaInterface):
def name(self):
return 'Alexa.EndpointHealth'
def propertiesSupported(self):
return [{'name': 'connectivity'}]
and in the code for the method
serializeProperties, add the line
Code: Select all
if prop_name == 'connectivity': prop_value = { 'value': 'OK' }
in DomoticzHandler.py, add this line to the __init__ for class Domoticz (it then gets added to all endpoints):
Code: Select all
self.addCapability(AlexaEndpointHealth(self, 'Alexa.EndpointHealth',[{'name': 'connectivity'}]))
Now re-discover devices and state-querying should work. I've asked Amazon to update their docs with this.
Note that you
cannot request the state of a switch as it's simply not (yet) supported by Alexa. Querying only works for devices of type Alexa.ContactSensor and Alexa.MotionSensor.
Regarding your thermostat temperature reporting, take a look in the Cloudwatch logs to see if you can debug. In DomoticzHandler.py the
getProperty method has a test "elif prop == 'temperature'" and whatever that is returning must be incorrect.
THANKS A MILLION!
just adding addCapability to Domoticz class raises error. I added it to ContactSensor part and worked fine.
checking cloudwatch logs shows that when asked for "temperature inside" alexa polls every temp sensor
and thermostat in home and calculates average temp. any ideas how can i prevent thermostats from being included in average temp calculation?
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Saturday 15 June 2019 20:45
by philchillbill
Glad that worked. Yes, when you ask for the 'inside' temperature all your temp sensors are averaged, You can of course just ask for one specific location such as Livingroom and then you will just get that.
If you want to actually omit a thermostat during the discovery process (or any device in fact) you can put the following code in the discovery loop just under the
for device in devices statement in DomoticzHandler.py
Code: Select all
matchObj = re.match( r'.*no_alexa', device['Description'], re.M|re.I|re.DOTALL)
if matchObj: continue
Now, if you have the text
no_alexa in the Domoticz device description field, that device will be skipped during discovery. I personally use this approach instead of limiting to discovering devices in roomplans as I don't use roomplans myself.
Similarly, you can skip certain categories of Domoticz devices you'd never want Alexa to interface with (such as your P1 meter) with an array of types as follows:
Code: Select all
devType = device['Type']
if devType in (''General', 'Lux', 'P1 Smart Meter', 'RFXMeter', 'Temp + Humidity', 'Usage'): continue
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Sunday 16 June 2019 6:14
by abaratian
philchillbill wrote: ↑Saturday 15 June 2019 20:45
Glad that worked. Yes, when you ask for the 'inside' temperature all your temp sensors are averaged, You can of course just ask for one specific location such as Livingroom and then you will just get that.
If you want to actually omit a thermostat during the discovery process (or any device in fact) you can put the following code in the discovery loop just under the
for device in devices statement in DomoticzHandler.py
Code: Select all
matchObj = re.match( r'.*no_alexa', device['Description'], re.M|re.I|re.DOTALL)
if matchObj: continue
Now, if you have the text
no_alexa in the Domoticz device description field, that device will be skipped during discovery. I personally use this approach instead of limiting to discovering devices in roomplans as I don't use roomplans myself.
Similarly, you can skip certain categories of Domoticz devices you'd never want Alexa to interface with (such as your P1 meter) with an array of types as follows:
Code: Select all
devType = device['Type']
if devType in (''General', 'Lux', 'P1 Smart Meter', 'RFXMeter', 'Temp + Humidity', 'Usage'): continue
I use room plans and i have an "alexa" room plan that i have all my alexa devices in it. The problem is I want to use these thermostats with alexa (i have 3, 2 are dummy ones i use to control my IR controlled ACs so that when i set the thermostat to 23 an event is triggered and the IR code for 23 degrees is sent to AC and they are usually set to 0. I'm using thermostats instead of selector switches because they are not usable with alexa ). Is there a way to exclude thermostats from average temp calculations? Is there an actualTemp property for thermostats in domoticz? And will alexa read it? So i can update it with my average temp.
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Sunday 16 June 2019 9:26
by philchillbill
Nope, there's no way to influence the average calculation - it's just something she does 'herself'. You could 'fool' her as to what temp to use for a specific device. If device name == whatever then return fake value instead of actual value read from Domoticz. Play around with the code for the getProperty method in DomoticzHandler.py.
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Sunday 30 June 2019 13:26
by chrispazz
Hi, after first setup I added more switches in Domoticz but they are not visible in domoticz.
How to update Alexa devices to get new switches?
ty
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Sunday 30 June 2019 13:31
by philchillbill
Say “Alexa, discover devices”. If you didn’t put them in the correct room plan, they will not appear either.
Sent from my iPhone using Tapatalk
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Sunday 30 June 2019 13:48
by chrispazz
I did not have a specific room id, (-1).
In first setup it discovered all my devices.....
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Sunday 30 June 2019 13:54
by philchillbill
No idea what it might be. Did you try to disable the skill, then re-enable and rediscover devices? Might help.
Sent from my iPhone using Tapatalk
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Sunday 30 June 2019 13:57
by chrispazz
Yes I did but no luck....
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Sunday 30 June 2019 15:12
by chrispazz
Ok, for Alexics no roomplan is different from any roomplan.
I added it to a roomplan and now the device has been discovered!

Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Sunday 30 June 2019 16:11
by philchillbill
You can easily change that in the code if it’s not what you want...
Sent from my iPhone using Tapatalk
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Sunday 21 July 2019 20:41
by grasuoare
Hi there!
Thank you for this integration. It works like a charm!
Could you please tell me if it is possible to use it with pivpn? If yes, how?
Thank you!
Re: Alexicz - FREE Domoticz to Alexa Integration
Posted: Tuesday 23 July 2019 9:25
by poudenes
Hi All,
At the beginning I get problems. When I want create a Security Profile I always get a message:
Invalid security profile
What can that be?