Alexicz - FREE Domoticz to Alexa Integration

Alexa, Google Home and Siri

Moderator: leecollings

ldeutsch
Posts: 1
Joined: Thursday 23 May 2019 20:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by ldeutsch »

Hi,

I wanted to express my gratitude to the author of that skill. I have been using domoticz for nearly three years and was struggling with habridge and its limitations.

I was on the verge to develop such a skill myself out of sheer frustration with my previous solution.

By luck I found that topic - seriously: not having native Alexa integration is one of the most serious drawbacks of Domoticz - until now.😁💪

Here are my gotchas I encountered along the way to set up that skill:

- you might share a link how to use domoticz ssl port from the outside. In fact I was wondering why the skill does not use MyDomoticz.
- the walk thru to set up the skill is not quite up to date - I had to improvise at some points...
- choosing Ireland for the lambda location is essential _ otherwise the account linking throws weird errors
- the name of the lambda function in the git repository needs to be adapted to the current version
- the final hurdle: make sure to create a floor plan, assign the devices you want to be discovered by Alexa and set the plan ID in the config Jason to your Alexa devices plan I was struggling quite a bit with that last one..


I recommend to link to that topic from the starting page of the forum... It's a huge benefit. I can now set the colors of my MySensors and z-wave rgb strips... Hurray 😁

Cheers,
Lars
tarmacalastair
Posts: 94
Joined: Wednesday 30 October 2019 14:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Great Britain
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by tarmacalastair »

@Lars,
I wonder, can you remember what your improvisations were? I tried to set up this skill following the instructions here earlier this year and failed miserably because the steps required have changed so much.
Thanks.
Running Domoticz and Dashticz beta on Raspberry Pi OS 32 bit - has anyone had success with 64 bit?

Desktop access from Ubuntu Linux
fireport
Posts: 27
Joined: Friday 03 January 2020 21:14
Target OS: Linux
Domoticz version:
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by fireport »

Dear all, I added 3 aqara door sensors to domoticz using zigbee2mqtt. Alexa sees them but is unable to update the state.
If I change the switch type from door sensor to "on/off" the status is updated. Do you have a solution to solve this problem?
This is the json config of one of my aqara sensors.

Code: Select all

{
	"ActTime" : 1597933860,
	"AstrTwilightEnd" : "21:46",
	"AstrTwilightStart" : "04:41",
	"CivTwilightEnd" : "20:33",
	"CivTwilightStart" : "05:55",
	"DayLength" : "13:39",
	"NautTwilightEnd" : "21:08",
	"NautTwilightStart" : "05:19",
	"ServerTime" : "2020-08-20 16:31:00",
	"SunAtSouth" : "13:14",
	"Sunrise" : "06:25",
	"Sunset" : "20:03",
	"app_version" : "2020.2",
	"result" : 
	[
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 100,
			"CustomImage" : 0,
			"Data" : "Open",
			"Description" : "",
			"DimmerType" : "none",
			"Favorite" : 0,
			"HardwareID" : 24,
			"HardwareName" : "Zigbee2MQTT",
			"HardwareType" : "Zigbee2MQTT",
			"HardwareTypeVal" : 94,
			"HaveDimmer" : true,
			"HaveGroupCmd" : true,
			"HaveTimeout" : false,
			"ID" : "0x00158d00047dd1c3_sensor",
			"Image" : "Door",
			"InternalState" : "Open",
			"IsSubDevice" : false,
			"LastUpdate" : "2020-08-20 15:55:04",
			"Level" : 1,
			"LevelInt" : 1,
			"MaxDimLevel" : 100,
			"Name" : "Z porta cucina",
			"Notifications" : "false",
			"PlanID" : "2",
			"PlanIDs" : 
			[
				2
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : 1,
			"Status" : "Open",
			"StrParam1" : "",
			"StrParam2" : "",
			"SubType" : "Switch",
			"SwitchType" : "Door Contact",
			"SwitchTypeVal" : 11,
			"Timers" : "false",
			"Type" : "Light/Switch",
			"TypeImg" : "door",
			"Unit" : 29,
			"Used" : 1,
			"UsedByCamera" : false,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "222"
		}
	],
	"status" : "OK",
	"title" : "Devices"
}
User avatar
philchillbill
Posts: 396
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by philchillbill »

fireport wrote: Thursday 20 August 2020 16:33 Dear all, I added 3 aqara door sensors to domoticz using zigbee2mqtt. Alexa sees them but is unable to update the state.
If I change the switch type from door sensor to "on/off" the status is updated. Do you have a solution to solve this problem?
Well, Domoticz itself does not update the skill's Lambda with changed state. You have to run a python script locally whenever anything changes in Domoticz to push the change(s). See my posts from
philchillbill wrote: Tuesday 26 November 2019 21:17
and before (no idea how to link to a specific post).
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
fireport
Posts: 27
Joined: Friday 03 January 2020 21:14
Target OS: Linux
Domoticz version:
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by fireport »

I modified python scripts following your instructions and now the door sensors are shown as a contact but Alexa doesn't understand the query to know door status (open ad close). Any helps?
User avatar
philchillbill
Posts: 396
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by philchillbill »

fireport wrote:I modified python scripts following your instructions and now the door sensors are shown as a contact but Alexa doesn't understand the query to know door status (open ad close). Any helps?
Did you include EndpointHealth ? I mentioned that in some posts around the same time.
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
fireport
Posts: 27
Joined: Friday 03 January 2020 21:14
Target OS: Linux
Domoticz version:
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by fireport »

I added all the three pieces of code into the python scripts.
This is the output of a discovery of one of the three sensors

Code: Select all

{
          "endpointId": "Contact-222",
          "friendlyName": "porta cucina",
          "description": "Light/Switch",
          "manufacturerName": "Zigbee2MQTT",
          "displayCategories": [
            "CONTACT_SENSOR"
          ],
          "additionalApplianceDetails": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.ContactSensor",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "detectionState"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            }
          ]
        },
        {
phil12
Posts: 1
Joined: Thursday 10 September 2020 17:36
Target OS: -
Domoticz version:
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by phil12 »

hello all
i just installed alexicz and followed the how to pdf , i hope all was made correctly

just on point on chapter 5.11

5.11. Click on « alexicz » to configure the function (1)  Change the handler information to
« lambda.event_handler » (2)  Select the « Upload a ZIP file » option (3)  Click to upload your
function (4) and select the package you created previously (§4)

first : i never founded where to change the handler information to "lambda.event_handler"
second : when i upload the zip file the system request to have a "lambda_function.py" file
so i had renamed lambda.py to lambda_function.py and system was quiet !! :)

But now in chapter 9 ( Tests) i have problems

whan i test i got this message
{
"errorMessage": "Handler 'lambda_handler' missing on module 'lambda_function'"
}

is somebody can help me
thanks in advance
Harryb17
Posts: 6
Joined: Tuesday 08 November 2016 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by Harryb17 »

Is anyone using this successfully with an IPv6 only server?

I've used Alexicz in the past with a domain name which pointed to a static IPv4 address.
Now my ISP are charging for static IPs and because of the particular setup in our apartment building, using something like DuckDNS doesn't work.
With this change my ISP started giving us IPv6 addresses which don't change so I assumed everything would continue working.
I can still connect to my Domoticz sever successfully using my domain name but the Alexicz function has stopped working.

I now get the following error when running a test inside of the Lambda function.

Code: Select all

urllib.error.URLError: <urlopen error [Errno 97] Address family not supported by protocol>
I've read a few things about using the urllib2 library but I'm not familiar with python.

Any advice would be appreciated!

Thanks
User avatar
philchillbill
Posts: 396
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by philchillbill »

I'm nearly sure Amazon does not support IPv6 endpoints. For the hell of it, you could setup a quick ngrok tunnel and see if that resolves.
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
alexjcgdf
Posts: 1
Joined: Tuesday 17 November 2020 14:59
Target OS: Linux
Domoticz version:
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by alexjcgdf »

Hey sir;

I am stuck on step 5.4 5.5 5.6 5.7 since the AWS platform has changed and it does not reflect with the actual option anymore. I got stuck exactly on creating the new IAM Role. Can you help me on that one? I am not a developer so I really dont know what to do if it is not explicitly on the HOWTO.

:)
ldeutsch wrote: Thursday 06 August 2020 19:59 Hi,

I wanted to express my gratitude to the author of that skill. I have been using domoticz for nearly three years and was struggling with habridge and its limitations.

I was on the verge to develop such a skill myself out of sheer frustration with my previous solution.

By luck I found that topic - seriously: not having native Alexa integration is one of the most serious drawbacks of Domoticz - until now.😁💪

Here are my gotchas I encountered along the way to set up that skill:

- you might share a link how to use domoticz ssl port from the outside. In fact I was wondering why the skill does not use MyDomoticz.
- the walk thru to set up the skill is not quite up to date - I had to improvise at some points...
- choosing Ireland for the lambda location is essential _ otherwise the account linking throws weird errors
- the name of the lambda function in the git repository needs to be adapted to the current version
- the final hurdle: make sure to create a floor plan, assign the devices you want to be discovered by Alexa and set the plan ID in the config Jason to your Alexa devices plan I was struggling quite a bit with that last one..


I recommend to link to that topic from the starting page of the forum... It's a huge benefit. I can now set the colors of my MySensors and z-wave rgb strips... Hurray 😁

Cheers,
Lars
wolfguru
Posts: 6
Joined: Tuesday 27 September 2016 22:25
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by wolfguru »

Hello, thank you for the great effort and documentation.

I managed to follow all the steps, and worked around the ones that are changed due to changes in AWS. Now my lambda function is working, but the discovery is returning HTTP Error 401: Unauthorized

I have the port open on my router, and I created the user in domoticz with the password and added them to the json file. I'm using HTTPS. I think it is not liking my username/passowrd.

When I try to execute https://<my dns namel>:<my port>/json.htm?type=devices on mobile connected in my wifi (inside my lan) it works fine, but when if I trun off wifi and use 4G and try the same then I get unauthorized ... but that is also because my domoticz does not need username/password within ny LAN.

Anyone have the same issue? Any suggestions?

Thanks
wolfguru
Posts: 6
Joined: Tuesday 27 September 2016 22:25
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by wolfguru »

wolfguru wrote: Tuesday 08 December 2020 1:10 Hello, thank you for the great effort and documentation.

I managed to follow all the steps, and worked around the ones that are changed due to changes in AWS. Now my lambda function is working, but the discovery is returning HTTP Error 401: Unauthorized

I have the port open on my router, and I created the user in domoticz with the password and added them to the json file. I'm using HTTPS. I think it is not liking my username/passowrd.

When I try to execute https://<my dns namel>:<my port>/json.htm?type=devices on mobile connected in my wifi (inside my lan) it works fine, but when if I trun off wifi and use 4G and try the same then I get unauthorized ... but that is also because my domoticz does not need username/password within ny LAN.

Anyone have the same issue? Any suggestions?

Thanks
The issue is fixed if I use the username and password for "Website Protection" ... I was trying to use another Domoticz user.
Can I not use another domoticz user created specifically for this skill? I can create other users in Setup->More Options -> Edit Users

Thanks for help.
DrMacabre
Posts: 71
Joined: Monday 26 December 2016 16:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11590
Location: France
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by DrMacabre »

Hello,

Everything was working fine until may be a month from now, alexa keeps saying device not responding almost every time then eventually the device turns on, sometimes it works fine but 80% of the time, there this not responding message then a few seconds later, the device turns on like if domoticz was stalled and then able again to process the incoming command. I can’t think of anything explaining this issue.

Any idea ?
User avatar
philchillbill
Posts: 396
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by philchillbill »

DrMacabre wrote:Hello,

Everything was working fine until may be a month from now, alexa keeps saying device not responding almost every time then eventually the device turns on, sometimes it works fine but 80% of the time, there this not responding message then a few seconds later, the device turns on like if domoticz was stalled and then able again to process the incoming command. I can’t think of anything explaining this issue.

Any idea ?
Have you checked the Cloudwatch logs ?
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
DrMacabre
Posts: 71
Joined: Monday 26 December 2016 16:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11590
Location: France
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by DrMacabre »

philchillbill wrote: Saturday 12 December 2020 9:53
DrMacabre wrote:Hello,

Everything was working fine until may be a month from now, alexa keeps saying device not responding almost every time then eventually the device turns on, sometimes it works fine but 80% of the time, there this not responding message then a few seconds later, the device turns on like if domoticz was stalled and then able again to process the incoming command. I can’t think of anything explaining this issue.

Any idea ?
Have you checked the Cloudwatch logs ?
Nope, actually it’s also doing the same with your LMS light skill so I think it’s more related to alexa rather than any of the skills. Anyone is using pi-hole and alexa ?
kitopopo
Posts: 59
Joined: Monday 03 December 2018 11:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by kitopopo »

philchillbill wrote: Tuesday 23 July 2019 9:51 @grasuoare The skill code needs to be able to reach Domoticz via HTTPS - that's simply an Amazon requirement. The url for your instance is hard-coded in the configdz.json file and is e.g. https://myhouse.ddns.net:443. I've never used a VPN but if it gives you a url to allow external traffic to talk to your server at will, you can use it. If not, it won't work. What *will* work is a reverse proxy that sits between Alexa and Domoticz and adds more security, albeit still requiring a port to be opened. I personally think people get too hung up on open ports. If properly done with a reverse proxy behind them only accepting TLS and with X509 authentication (or basic auth with a huge password), they are not a security issue.

@poudenes What exactly do you mean by Security Profile? Forgive me, but I cannot match that term to Amazon terminology.
Dear friend, i test all the process and alexa works correctly.

I had to modify one of the files to make it work for me. Change https to http, because I connect to domoticz by http. Could you talk about the security issues? I don't really like to introduce my public ip, my external port, my username and my domoticz password in that file. Could this be a security problem? Could you explain how to increase security with the reverse proxy or some other way? thanks in advance
User avatar
philchillbill
Posts: 396
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by philchillbill »

What/where did you change https to http? Alexa can only work with an external https URL with a domain name. Your internal IP address like http://192.168.1.10:8080 cannot be reached from the cloud.
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
kitopopo
Posts: 59
Joined: Monday 03 December 2018 11:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by kitopopo »

philchillbill wrote: Monday 22 February 2021 10:57 What/where did you change https to http? Alexa can only work with an external https URL with a domain name. Your internal IP address like http://192.168.1.10:8080 cannot be reached from the cloud.
I changed https by http in configdz-template.json or configdz.json in "url" https://myexternalip was replaced by "url" http://myexternalip.
making this change alexa works with my domoticz perfectly but I am afraid of security problems, either because I use http or because I give my username, password, public ip and port in that configuration file. I am giving all my data.

Do you think it is safer if I use https? Besides this, is it not dangerous to put all my data in that file? thanks in advance
User avatar
philchillbill
Posts: 396
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Alexicz - FREE Domoticz to Alexa Integration

Post by philchillbill »

kitopopo wrote: Monday 22 February 2021 11:08 I changed https by http in configdz-template.json or configdz.json in "url" https://myexternalip was replaced by "url" http://myexternalip.
making this change alexa works with my domoticz perfectly but I am afraid of security problems, either because I use http or because I give my username, password, public ip and port in that configuration file. I am giving all my data.

Do you think it is safer if I use https? Besides this, is it not dangerous to put all my data in that file? thanks in advance
Aha, that's allowed because you are not publishing the skill and it's for personal use only in your dev-account. It's a very bad idea though, as your Domoticz is fully exposed with no protection. It's not 'if' you will be hacked, but 'when'...

You already have an external IP address, right? Have you tried getting an SSL cert for it from LetsEncrypt?
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest