Amazon Echo to Domoticz Bridge: switches, sensors & more

Alexa, Google Home and Siri

Moderator: leecollings

Post Reply
User avatar
blackdog65
Posts: 311
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Norfolk, UK
Contact:

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

Post by blackdog65 »

Hi Madgeni,
I'm still in the same predicament here. I've grabbed the latest version, zipped the folder and 2 files but it still fails on test as it says it can't see the domoticz.js . I'm certain I'm doing the upload procedure correct. If I download the code, I get a zip file containing exactly what I uploaded.

Incidentally, the lamda page I see doesn't have "Add Event Source" but "Add Trigger"

Sean

PS Much kudos for all the hard work ;)
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
Lard2010
Posts: 6
Joined: Saturday 25 January 2014 20:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Lard2010 »

blackdog65 wrote:In the lamda console I get

Code: Select all

"errorMessage": "Cannot find module './node_modules/domoticz-api/api/domoticz'",
I thought the "domoticz" needed the .js suffix, but that just gives

Code: Select all

"errorMessage": "Cannot find module './node_modules/domoticz-api/api/domoticz.js'",
The pages I'm seeing in lamda are also different to those in your docx.... enough head scratching for one day ;)
You need to specify -r (recursive) on your zip command, perhaps?
Lard2010
Posts: 6
Joined: Saturday 25 January 2014 20:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Lard2010 »

I've tried this using both N. Virginia and Europe (Ireland) regions and still can't get Alexa to discover my devices, although the lambda test works. I know you said it's the link from the skill to the lambda, Madgeni, but I can't seem to get to the bottom of it. As a last resort I deleted all the skills, lambdas and security profiles I'd created and started from scratch, but no joy.

Has anyone got this working in Europe?

Cheers,

Lard
User avatar
blackdog65
Posts: 311
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Norfolk, UK
Contact:

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

Post by blackdog65 »

Lard2010 wrote:You need to specify -r (recursive) on your zip command, perhaps?
Hmmm.... I can see the logic of the -r argument but not how to apply it via the web console.
It may be down to how I'm zipping it. I'm using Linux so there may be a difference in how Linux creates .zip files.

I'll try to

Code: Select all

chmod -R 777
it and see if that helps.

Thanks for the tip :D
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
pdjm43
Posts: 30
Joined: Friday 12 December 2014 11:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: UK
Contact:

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

Post by pdjm43 »

Hi, I run Domoticz on a rapberry B+ (latest beta). I am waiting for the release of the Echo Dot next month (already ordered), but I decided to go with the HA Bridge (Hue emulator) for integration.
The bridge is installed on the same Pi and CPU is 10%, memory is 15%.
I've set up all the switches and thermostats I want to voice control and these work through the HA Bridge web page, I used the json calls that I use with Android Tasker.
But I can't find any information on retrieving data from the Pi, like temperature of rooms. Does anyone know how to do this yet?

I am also trying to control my Lifx lamps, the wiki has info for the beta API of Lifx, the API is out of beta and the controls on their test site don't match the wiki. I tried modifying the commands but ended up with the same errors that are experienced with the beta commands in LUA.
I don't want to have to say "alexa, tell lifx, turn on the wall light" or anything like that. I want to say "alexa, turn on the wall light"


Found lifxlan on github, now have dummy switches calling python scripts for on and off working through HA Bridge I'll use the Lifx skill for dimming and colours when I get the Dot.
Last edited by pdjm43 on Thursday 29 September 2016 17:58, edited 2 times in total.
Lard2010
Posts: 6
Joined: Saturday 25 January 2014 20:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Lard2010 »

OK, I've just spotted that even if I create the lambda under N. Virginia, when I link the account it uses the European (layla...) redirect URL (as is evident if I only have the US redirect URL in the allowed return URLs in the security profile).

Could that have anything to do with it? The fact I'm attempting to run my skill in Europe with a US lambda?

Having said that, it doesn't work if I create the lambda in Europe either :roll:

Again - has anyone got this working in Europe?

Cheers,

Lard
User avatar
blackdog65
Posts: 311
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Norfolk, UK
Contact:

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

Post by blackdog65 »

Lard2010 wrote:Again - has anyone got this working in Europe?
looks like N. Virginia only at the moment.

I took your advice and chmod -R everything prior to zipping and it worked... Thanks! :D

Now it looks like it's not getting authorised by my Domoticz server. I get remote access via https;//xxxxx.ddns.net which works fine via BT Homehub but I just can't get domapi.js to see it grrr :evil:
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
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 all - sorry, in Frankfurt today, so early start!

Right, glad you've made some more progress Blackdog65 - i have the same challenge around Virginia/Ireland.
I ended up defaulting back to the Virginia one also.

Re: Skill link redirecting to the wrong Lambda - I had this also, but in reverse. So when I had the lambda in Ireland, it was redirecting to virginia. I ended up putting both redirects into my security profile - try that if you haven't already.
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
User avatar
blackdog65
Posts: 311
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Norfolk, UK
Contact:

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

Post by blackdog65 »

At last! I get the lamda to run. Latest hassle was all down to remote access. bypassed my current method and used pagekite... yay!

Now to try and get it working with the app
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
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 - here's my skill and security settings - hopefully they will be of some use
Skill - global settings:

http://imgur.com/MLbCY4a

Security profile 1:
http://imgur.com/Nl4g2DM

Security profile 2:
http://imgur.com/N83S1lu
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
User avatar
blackdog65
Posts: 311
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Norfolk, UK
Contact:

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

Post by blackdog65 »

very odd. my security profile doesn't have a "Web Settings" tab.

I have the skill "Domexa" Installed now, but no devices found. I've been back and forth looking for typos. Console testing finds devices, so the lamda function is running ok. Just a matter of pinpointing the error in connecting the two halves... somehow.
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
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 -

can you access it via this:
https://developer.amazon.com/lwa/sp/overview.html
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
User avatar
blackdog65
Posts: 311
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Norfolk, UK
Contact:

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

Post by blackdog65 »

wow! Same security profile but by a different door... they like to make hard don't they?

Many many thanks :D I'll give it another try after taking the kids to cubs.
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
User avatar
l0gic
Posts: 107
Joined: Tuesday 08 October 2013 9:35
Target OS: Linux
Domoticz version: Latest
Contact:

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

Post by l0gic »

Hi Madgeni,
I've fired up the latest version of code (had to set the code run time to 20 sec in order for it to complete!)
I've run through the output and I think I've reduced the list to one of each type hopefully.
Some items in the 200 range are devices rather than scenes as I forgot to increase the scene numbering.

Code: Select all

{
  "header": {
    "namespace": "Alexa.ConnectedHome.Discovery",
    "name": "DiscoverAppliancesResponse",
    "payloadVersion": "2"
  },
  "payload": {
    "discoveredAppliances": [
	
	{
        "applianceId": 201,
        "manufacturerName": "Front Room Floor Lights",
        "modelName": "Front Room Floor Lights",
        "version": "1",
        "friendlyName": "Front Room Floor Lights",
        "isReachable": true,
        "actions": [
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "scene"
        }
      },
	  
	  
	    "applianceId": "10",
        "manufacturerName": "USB RFX 433Mhz Transceiver",
        "modelName": "LightwaveRF",
        "version": "On/Off",
        "friendlyName": "Kevin Lamp",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
	  
	  {
        "applianceId": "56",
        "manufacturerName": "USB RFX 433Mhz Transceiver",
        "modelName": "ARC",
        "version": "On/Off",
        "friendlyName": "Sharon Front Room Switch (B4)",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
	  
	  {
        "applianceId": "97",
        "manufacturerName": "USB RFX 433Mhz Transceiver",
        "modelName": "LightwaveRF",
        "version": "Contact",
        "friendlyName": "Garage Door Contact",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "Contact",
          "WhatAmI": "light"
        }
      },
	  
	  
	      {
        "applianceId": "40",
        "manufacturerName": "Home Weather Station",
        "modelName": "THB1 - BTHR918, BTHGN129",
        "friendlyName": "Home Station",
        "friendlyDescription": "Home Station",
        "isReachable": true,
        "actions": [
          "SetTargetTemperatureRequest",
          "SetTargetTemperatureConfirmation"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
	  
	        {
        "applianceId": "100",
        "manufacturerName": "EQ-3 Max! Heating Controls",
        "modelName": "RUBiCSON",
        "friendlyName": "Stat Front Room",
        "friendlyDescription": "Stat Front Room",
        "isReachable": true,
        "actions": [
          "SetTargetTemperatureRequest",
          "SetTargetTemperatureConfirmation"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
	  
	        {
        "applianceId": "173",
        "manufacturerName": "EQ-3 Max! Heating Controls",
        "modelName": "Rubicson/IW008T/TX95",
        "friendlyName": "RV Bathroom",
        "friendlyDescription": "RV Bathroom",
        "isReachable": true,
        "actions": [
          "SetTargetTemperatureRequest",
          "SetTargetTemperatureConfirmation"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
	  
	        {
        "applianceId": "198",
        "manufacturerName": "USB RFX 433Mhz Transceiver",
        "modelName": "RollerTrol, Hasta new",
        "version": "Blinds",
        "friendlyName": "Conservatory Blind 1",
        "friendlyDescription": "Conservatory Blind 1",
        "isReachable": true,
        "actions": [
          "SetTargetTemperatureRequest",
          "SetTargetTemperatureConfirmation"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
	  
	        {
        "applianceId": "248",
        "manufacturerName": "MySensors Tranceiver",
        "modelName": "LaCrosse TX3",
        "friendlyName": "Central Heating Flow",
        "friendlyDescription": "Central Heating Flow",
        "isReachable": true,
        "actions": [
          "SetTargetTemperatureRequest",
          "SetTargetTemperatureConfirmation"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
	  
	        {
        "applianceId": "257",
        "manufacturerName": "MySensors Tranceiver",
        "modelName": "WTGR800",
        "friendlyName": "Summer House TempHum",
        "friendlyDescription": "Summer House TempHum",
        "isReachable": true,
        "actions": [
          "SetTargetTemperatureRequest",
          "SetTargetTemperatureConfirmation"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
	  
	        {
        "applianceId": "271",
        "manufacturerName": "MySensors Tranceiver",
        "modelName": "AC",
        "version": "On/Off",
        "friendlyName": "Summer House Motion Sensor",
        "isReachable": true,
        "actions": [
          "incrementPercentage",
          "decrementPercentage",
          "setPercentage",
          "turnOn",
          "turnOff"
        ],
        "additionalApplianceDetails": {
          "switchis": "On/Off",
          "WhatAmI": "light"
        }
      },
	  
	      {
        "applianceId": "275",
        "manufacturerName": "MySensors Tranceiver",
        "modelName": "Lux",
        "friendlyName": "Summer House Light Level",
        "friendlyDescription": "Summer House Light Level",
        "isReachable": true,
        "actions": [
          "SetTargetTemperatureRequest",
          "SetTargetTemperatureConfirmation"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
	  
	        {
        "applianceId": "43",
        "manufacturerName": "Home Weather Station",
        "modelName": "WWW",
        "friendlyName": "Home Rain",
        "friendlyDescription": "Home Rain",
        "isReachable": true,
        "actions": [
          "SetTargetTemperatureRequest",
          "SetTargetTemperatureConfirmation"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
	  
	    "applianceId": "42",
        "manufacturerName": "Home Weather Station",
        "modelName": "UVN128,UV138",
        "friendlyName": "Home UV",
        "friendlyDescription": "Home UV",
        "isReachable": true,
        "actions": [
          "SetTargetTemperatureRequest",
          "SetTargetTemperatureConfirmation"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
	
	    "applianceId": "44",
        "manufacturerName": "Home Weather Station",
        "modelName": "Visibility",
        "friendlyName": "Home Visibility",
        "friendlyDescription": "Home Visibility",
        "isReachable": true,
        "actions": [
          "SetTargetTemperatureRequest",
          "SetTargetTemperatureConfirmation"
        ],
        "additionalApplianceDetails": {
          "WhatAmI": "temp"
        }
      },
	
	
	
	
	
	
	
	    ]
    }
}
Summary
Code SHA-256
As you can see some things have been tagged temp when they are not, I guess temp is the last available label.
Hopefully the output will assist with finessing the code :)
The EQ3 stuff is an app called maxbuddy pulling from an EQ-3 cube and pushing into Domoticz.
The weather station is a pull from weather underground.

If you want any thing else run / checked etc. just shout.

ATB

Kevin
Non credus crepitus
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, so the logic *should* be checking the Type in Domoticz, and if it starts with Light, it's a light, if it says Temp - you get the idea :)

Can you check your Domoticz and in Devices tell me what some of those devices that aren't temp sensors say?
Sorry, because I don't have Temp sensors, and the Node module i use didn't handle device listing that well, i've had to guess and improvise!

Also, 20 seconds is a long time..! Mine's hosted in the virginia instance and takes 1.5

can you get the App skill working yet, or are you still testing in the lambda? Would be nice to know it's at least able to control your lights/scenes for you!
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
User avatar
l0gic
Posts: 107
Joined: Tuesday 08 October 2013 9:35
Target OS: Linux
Domoticz version: Latest
Contact:

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

Post by l0gic »

Hiya,
I think this is the full list of device types

Code: Select all

Unit								Type							Sub Type									Notes

Oragon Temperature / Humidity Unit 			Temp + Humidity				THGN122/123, THGN132, THGR122/228/238/268

WUG Weather Station						Temp + Humidity + Baro			THB1 - BTHR918, BTHGN129

WUG Weather Station						Wind							TFA

WUG Weather Station						UV							UVN128,UV138

WUG Weather Station						Rain							WWW

WUG Weather Station						General 						Visibility

WUG Weather Station						General 						Solar Radiation

EQ-3 Max! Heating Controls				Temp							RUBiCSON									Thermostat

EQ-3 Max! Heating Controls				Temp + Humidity				Rubicson/IW008T/TX95						Radiator
Valve

Blinds								Blinds						RollerTrol, Hasta new								Has Up/Down/Stop

One Wire Sensor (My Sensors)				Temp							LaCrosse TX3

Temp&Humidity Sensor (My Sensors)			Temp + Humidity				WTGR800

Lux Sensor (My Sensors)					Lux							Lux

UV Sensor (My Sensors)					UV							UVN128,UV138
Yeah, regarding the timing I have an IDX list of 271 at the moment. It takes a while to chunk through them.
Same speed from Dublin and N Virginia.

Still no luck connecting from Alexa (Discover Devices)
Fails to find anything and Lambda does not show any connection / compute time, so currently at a bit of a loss with that at the moment.


Hope the above helps

Kevin
Non credus crepitus
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 - so to regain some confidence - for all of us! - that this works, i've reverted it to just Lights and Groups for now.

I've triple-checked this is working, and no doubt driven my wife mad with my remote testing alexa discoveries :)
For avoidance of doubt - running lambda in W.Virginia, and using the workaround oauth settings (so not amazon account linking - which is probably fine, but i've spent enough time on this over the last couple of days :) ):
auth url:
https://ve0kyj5tp5.execute-api.us-east- ... horization
Client id:
alexa-skill
scope
alexa
Client Secret: (can be anything)
1234
access token URI:
https://ve0kyj5tp5.execute-api.us-east- ... ccessToken
privacy policy url:
https://ve0kyj5tp5.execute-api.us-east- ... vacyPolicy


I'll work on Temp discovery and control over the weekend - offline - and will release it when i'm happy.
Native Alexa skill and Google app - register at https://www.controlicz.com - https://twitter.com/Controlicz
Bigted
Posts: 68
Joined: Friday 12 December 2014 14:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

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

Post by Bigted »

Resolved, another simply mistake by myself :?
Last edited by Bigted on Friday 30 September 2016 11:22, edited 1 time in total.
amz4u2nv
Posts: 31
Joined: Friday 21 August 2015 16:04
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

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

Post by amz4u2nv »

Hi,
Bit stuck at the moment -
I am following the word doc instrunctions, and have come to this point -
You will now see several tabs –
Go to Event Source:
Add event source – select Event Source Type – Alexa Smart Home

I can't figure out where the button is for event source, does anyone have any idea where I can find this.

Thanks,
amz
Bigted
Posts: 68
Joined: Friday 12 December 2014 14:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

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

Post by Bigted »

amz4u2nv wrote:Hi,
Bit stuck at the moment -
I am following the word doc instrunctions, and have come to this point -
You will now see several tabs –
Go to Event Source:
Add event source – select Event Source Type – Alexa Smart Home

I can't figure out where the button is for event source, does anyone have any idea where I can find this.

Thanks,
amz
Go to the Triggers tab instead, add a trigger, select Alexa Smart Home

the id is the application id from the skill i.e something like amzn1.ask.skill.1d023177-ce35-4377-8339-dd0fd132xxxx
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest