Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Alexa, Google Home and Siri

Moderator: leecollings

Post Reply
legacy1981
Posts: 2
Joined: Wednesday 10 April 2019 13:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by legacy1981 »

Hi Guys,

I found a new node for node-red which enables Google home integration very very easy and free!!.
https://flows.nodered.org/node/node-red-contrib-nora

I'm not a programmer. But i managed to get it working with MQTT in and out. So it works both ways. You just bind your google account to the node and add NORA to your google home app. Next the numbers in the switches and the "topic" in the node needs to match the domoticz IDX which you want to control.

You can add as many google assistant devices as you want. Works like a charm!!


Here is my example flow.

Code: Select all

[{"id":"4528e53.782fb1c","type":"mqtt in","z":"fd35c454.ee407","name":"","topic":"domoticz/out","qos":"2","broker":"34e4d2fc.90d346","x":70,"y":440,"wires":[["3e9a9a76.9cb2f6"]]},{"id":"3e9a9a76.9cb2f6","type":"json","z":"fd35c454.ee407","name":"","property":"payload","action":"","pretty":false,"x":230,"y":440,"wires":[["681631c8.dbc208","738ce63c.4f5c3"]]},{"id":"681631c8.dbc208","type":"switch","z":"fd35c454.ee407","name":"","property":"payload.switchType","propertyType":"msg","rules":[{"t":"cont","v":"On/Off","vt":"str"},{"t":"eq","v":"Dimmer","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":370,"y":440,"wires":[["f9798848.30054"],["e3793bc5.9aa94"]]},{"id":"f9798848.30054","type":"function","z":"fd35c454.ee407","name":"Function In on/off","func":"msg.topic = msg.payload.idx\nif (msg.payload.nvalue == 1)\n{\n    msg.payload = true\n}\nelse if (msg.payload.nvalue === 0)\n{\n    msg.payload = false\n}\n    return msg;\n","outputs":1,"noerr":0,"x":550,"y":380,"wires":[["c7d42d19.b2e198"]]},{"id":"e3793bc5.9aa94","type":"function","z":"fd35c454.ee407","name":"Function Dimmer","func":"msg.topic = msg.payload.idx\nvar brightness = msg.payload.svalue1\nif (msg.payload.nvalue === 1)\n{\n    msg.payload = 100\n}\nelse if (msg.payload.nvalue === 0)\n{\n    msg.payload = 0\n}\nelse if (msg.payload.nvalue === 2)\n{\n    msg.payload = brightness\n}\n    return msg;\n\n","outputs":1,"noerr":0,"x":550,"y":480,"wires":[["b8c784d7.203388"]]},{"id":"c7d42d19.b2e198","type":"switch","z":"fd35c454.ee407","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"158","vt":"str"},{"t":"eq","v":"168","vt":"str"},{"t":"eq","v":"620","vt":"str"},{"t":"eq","v":"176","vt":"str"},{"t":"eq","v":"365","vt":"str"},{"t":"eq","v":"482","vt":"str"},{"t":"eq","v":"349","vt":"str"},{"t":"eq","v":"530","vt":"str"},{"t":"eq","v":"336","vt":"str"}],"checkall":"true","repair":false,"outputs":9,"x":750,"y":260,"wires":[["2829642d.fb748c"],["9a731c14.437d5"],["3e545d4c.299352"],["39746777.4cd46"],["72282919.51404"],["ff689805.dc7098"],["160ad1c9.3c1426"],["b1ca6005.2e93f"],["d100ba7b.ea6938"]]},{"id":"b8c784d7.203388","type":"switch","z":"fd35c454.ee407","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"113","vt":"str"},{"t":"eq","v":"516","vt":"str"},{"t":"eq","v":"92","vt":"str"},{"t":"eq","v":"144","vt":"str"},{"t":"eq","v":"610","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":750,"y":800,"wires":[["257f1795.0e50f8"],["dba00889.f2775"],["c67e2421.cbd0d"],["c9ac25c4.1eaaf"],["e7f419af.b6062"]]},{"id":"257f1795.0e50f8","type":"nora-light","z":"fd35c454.ee407","devicename":"Keuken","lightcolor":false,"brightnesscontrol":true,"passthru":false,"statepayload":false,"brightnessoverride":"100","roomhint":"Keuken","name":"Keuken","nora":"48bacfcb.9887b8","topic":"113","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":920,"y":780,"wires":[["a1c7a6cf.d4bcb"]]},{"id":"39746777.4cd46","type":"nora-switch","z":"fd35c454.ee407","devicename":"het Haardvuur","roomhint":"Woonkamer","name":"Haardvuur","passthru":false,"nora":"48bacfcb.9887b8","topic":"176","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":930,"y":300,"wires":[["805526ff.cf4d08"]]},{"id":"805526ff.cf4d08","type":"function","z":"fd35c454.ee407","name":"Function out On/Off","func":"var idx = parseInt(msg.topic);\nif ( msg.payload === true )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"On\" };\n}\nelse if ( msg.payload === false )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Off\" };\n}\nreturn msg\n","outputs":1,"noerr":0,"x":1380,"y":280,"wires":[["7d584545.8c9544"]]},{"id":"a1c7a6cf.d4bcb","type":"function","z":"fd35c454.ee407","name":"Function out Dimmer","func":"var idx = parseInt(msg.topic)\nvar brightness = msg.payload\nif ( msg.payload === 0 )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Off\" };\nreturn [msg, null]\n}\nelse\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Set Level\", \"level\": brightness };\nreturn [null, msg]\n}\n\n\n","outputs":2,"noerr":0,"x":1300,"y":700,"wires":[["7d584545.8c9544"],["7d584545.8c9544"]]},{"id":"55a04197.0e6f9","type":"nora-scene","z":"fd35c454.ee407","devicename":"beveiliging","roomhint":"","scenereversible":true,"name":"beveiliging","nora":"48bacfcb.9887b8","topic":"5","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":920,"y":1180,"wires":[["e63a5889.fbb5b8"]]},{"id":"e63a5889.fbb5b8","type":"function","z":"fd35c454.ee407","name":"Function Scene","func":"var idx = parseInt(msg.topic)\nif ( msg.payload === true )\n{\nmsg.payload = { \"command\": \"switchscene\", \"idx\": idx, \"switchcmd\": \"On\" };\nreturn msg\n}\n\n","outputs":1,"noerr":0,"x":1320,"y":820,"wires":[["7d584545.8c9544"]]},{"id":"7d584545.8c9544","type":"json","z":"fd35c454.ee407","name":"","property":"payload","action":"","pretty":false,"x":1630,"y":580,"wires":[["caefbcc2.78bf18"]]},{"id":"caefbcc2.78bf18","type":"mqtt out","z":"fd35c454.ee407","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"34e4d2fc.90d346","x":1870,"y":580,"wires":[]},{"id":"34e4d2fc.90d346","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"48bacfcb.9887b8","type":"nora-config","z":"","name":"nora config","group":""}]
Let me know what you think!
Last edited by legacy1981 on Thursday 16 May 2019 10:40, edited 1 time in total.
pabloalcantara
Posts: 8
Joined: Sunday 31 December 2017 19:02
Target OS: -
Domoticz version:
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by pabloalcantara »

Works perfectly - in less than one hour I migrate from Controlicz 20 itens.
thsi
Posts: 1
Joined: Tuesday 07 May 2019 10:10
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by thsi »

(sorry for my bad English because I am French).
Hello, first of all, thank you for this topic. I do not understand why we do not talk about it anymore.
This solution is perfect. I got your code and it works perfectly.
By cons I have temperature probes in domoticz and I would like to integrate in Google Assistant in the form of thermostat that will indicate only the temperature and humidity.
I tried several manipulations, but I can not do it. (I'm really bad at code)
Would it be possible to have a sample code to be able to do what I want.

Thank you in advance.
User avatar
Phantom
Posts: 87
Joined: Saturday 31 December 2016 14:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11652
Location: The Netherlands
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by Phantom »

This works great :)
And thanks for the example flow that helped a lot.
legacy1981
Posts: 2
Joined: Wednesday 10 April 2019 13:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by legacy1981 »

thsi wrote: Tuesday 07 May 2019 10:18 (sorry for my bad English because I am French).
Hello, first of all, thank you for this topic. I do not understand why we do not talk about it anymore.
This solution is perfect. I got your code and it works perfectly.
By cons I have temperature probes in domoticz and I would like to integrate in Google Assistant in the form of thermostat that will indicate only the temperature and humidity.
I tried several manipulations, but I can not do it. (I'm really bad at code)
Would it be possible to have a sample code to be able to do what I want.

Thank you in advance.
Humidity is not supported with NORA. I tried something. You can display the temperature in home. And ask assistant how hot it is in the livingroom.

Just change the idx for the sensor in the switch.

Code: Select all

[{"id":"611b7dec.63fc14","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"4b97fb74.2597c4","type":"mqtt in","z":"611b7dec.63fc14","name":"","topic":"domoticz/out","qos":"2","broker":"34e4d2fc.90d346","x":650,"y":360,"wires":[["63ac7659.1bb328"]]},{"id":"63ac7659.1bb328","type":"json","z":"611b7dec.63fc14","name":"","property":"payload","action":"","pretty":false,"x":850,"y":360,"wires":[["fee6befc.05fce8"]]},{"id":"fee6befc.05fce8","type":"switch","z":"611b7dec.63fc14","name":"","property":"payload.idx","propertyType":"msg","rules":[{"t":"eq","v":"588","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1030,"y":360,"wires":[["b8351a5c.9a5278"]]},{"id":"bfeeb6f.76ca648","type":"nora-thermostat","z":"611b7dec.63fc14","devicename":"Thermostat","roomhint":"","name":"","modes":"off","unit":"C","topic":"","passthru":false,"nora":"48bacfcb.9887b8","x":1490,"y":380,"wires":[[]]},{"id":"b8351a5c.9a5278","type":"function","z":"611b7dec.63fc14","name":"Function In on/off","func":"temperature = msg.payload.svalue1\nmsg.payload.temperature = temperature\nreturn msg\n","outputs":1,"noerr":0,"x":1250,"y":380,"wires":[["bfeeb6f.76ca648"]]},{"id":"34e4d2fc.90d346","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"48bacfcb.9887b8","type":"nora-config","z":"","name":"nora config","group":""}]
Bob123bob
Posts: 31
Joined: Monday 09 March 2015 7:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by Bob123bob »

How are the blinds working ? I tried to connect one on the dimmer function as they work with level % as well but it was not working :(
Can you help ?
edwin1234
Posts: 249
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by edwin1234 »

How do i switch a light i have a lamp on idx12
And its commands are send by rfxcom trough domoticz.
Can someone give me an example flow please?

Thanks
Edwin
serfer
Posts: 3
Joined: Wednesday 26 September 2018 13:41
Target OS: Windows
Domoticz version:
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by serfer »

Welcome
I have such errors as in the attached file.
will you help?
Attachments
nora.jpg
nora.jpg (67.6 KiB) Viewed 13353 times
Jofre
Posts: 12
Joined: Sunday 12 May 2019 14:09
Target OS: Raspberry Pi / ODroid
Domoticz version: Latest
Location: Netherlands
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by Jofre »

@serfer,

Line 10 should read: return msg;
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by pvklink »

works great!

only a switch with the property name "TV Lamp links" does not work, google does not recognize the device because off the used spaces.
a propertyname "TVLamplinks" (without spaces) does work but google does not recognize the voice command for this...
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
JuanUil
Posts: 497
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by JuanUil »

looks great will try this
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
domogijs
Posts: 99
Joined: Monday 17 August 2015 23:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by domogijs »

Hi i would really lik this to work.

did all the steps but i do not understand the last one.

please provide a screenshot with this step: Next the numbers in the switches and the "topic" in the node needs to match the domoticz IDX which you want to control.

Greets Gijs
Raspberry Pi3, RFlink, PiZigate, Yeelight, klikaanklikuit, Kodi, harmony hub, Zwave, ThermoSmart, XiaomiGateway (Aqara), Google home hub, roomba,
quazar
Posts: 18
Joined: Wednesday 22 January 2014 7:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by quazar »

Great, a small howto for Dummies would be much appreciated...
DAVIZINHO
Posts: 234
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Spain
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by DAVIZINHO »

hello,
Can someone detail this? it will be interesting. But i dont understand the basics :-(
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by freijn »

much interested as well. please the dummies version ?
salvacalatayud
Posts: 112
Joined: Monday 26 June 2017 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Spain
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by salvacalatayud »

freijn wrote: Wednesday 28 August 2019 13:27 much interested as well. please the dummies version ?
+1
domogijs
Posts: 99
Joined: Monday 17 August 2015 23:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by domogijs »

Hi Guys

This is what i did so far.

Copy this code. Go to the node red. --> hamburger menu upper right. -->Select import. --> Paste clipbord.

Hopes this helps.

Here is my example flow.

Code: Select all

[{"id":"4528e53.782fb1c","type":"mqtt in","z":"fd35c454.ee407","name":"","topic":"domoticz/out","qos":"2","broker":"34e4d2fc.90d346","x":70,"y":440,"wires":[["3e9a9a76.9cb2f6"]]},{"id":"3e9a9a76.9cb2f6","type":"json","z":"fd35c454.ee407","name":"","property":"payload","action":"","pretty":false,"x":230,"y":440,"wires":[["681631c8.dbc208","738ce63c.4f5c3"]]},{"id":"681631c8.dbc208","type":"switch","z":"fd35c454.ee407","name":"","property":"payload.switchType","propertyType":"msg","rules":[{"t":"cont","v":"On/Off","vt":"str"},{"t":"eq","v":"Dimmer","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":370,"y":440,"wires":[["f9798848.30054"],["e3793bc5.9aa94"]]},{"id":"f9798848.30054","type":"function","z":"fd35c454.ee407","name":"Function In on/off","func":"msg.topic = msg.payload.idx\nif (msg.payload.nvalue == 1)\n{\n    msg.payload = true\n}\nelse if (msg.payload.nvalue === 0)\n{\n    msg.payload = false\n}\n    return msg;\n","outputs":1,"noerr":0,"x":550,"y":380,"wires":[["c7d42d19.b2e198"]]},{"id":"e3793bc5.9aa94","type":"function","z":"fd35c454.ee407","name":"Function Dimmer","func":"msg.topic = msg.payload.idx\nvar brightness = msg.payload.svalue1\nif (msg.payload.nvalue === 1)\n{\n    msg.payload = 100\n}\nelse if (msg.payload.nvalue === 0)\n{\n    msg.payload = 0\n}\nelse if (msg.payload.nvalue === 2)\n{\n    msg.payload = brightness\n}\n    return msg;\n\n","outputs":1,"noerr":0,"x":550,"y":480,"wires":[["b8c784d7.203388"]]},{"id":"c7d42d19.b2e198","type":"switch","z":"fd35c454.ee407","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"158","vt":"str"},{"t":"eq","v":"168","vt":"str"},{"t":"eq","v":"620","vt":"str"},{"t":"eq","v":"176","vt":"str"},{"t":"eq","v":"365","vt":"str"},{"t":"eq","v":"482","vt":"str"},{"t":"eq","v":"349","vt":"str"},{"t":"eq","v":"530","vt":"str"},{"t":"eq","v":"336","vt":"str"}],"checkall":"true","repair":false,"outputs":9,"x":750,"y":260,"wires":[["2829642d.fb748c"],["9a731c14.437d5"],["3e545d4c.299352"],["39746777.4cd46"],["72282919.51404"],["ff689805.dc7098"],["160ad1c9.3c1426"],["b1ca6005.2e93f"],["d100ba7b.ea6938"]]},{"id":"b8c784d7.203388","type":"switch","z":"fd35c454.ee407","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"113","vt":"str"},{"t":"eq","v":"516","vt":"str"},{"t":"eq","v":"92","vt":"str"},{"t":"eq","v":"144","vt":"str"},{"t":"eq","v":"610","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":750,"y":800,"wires":[["257f1795.0e50f8"],["dba00889.f2775"],["c67e2421.cbd0d"],["c9ac25c4.1eaaf"],["e7f419af.b6062"]]},{"id":"257f1795.0e50f8","type":"nora-light","z":"fd35c454.ee407","devicename":"Keuken","lightcolor":false,"brightnesscontrol":true,"passthru":false,"statepayload":false,"brightnessoverride":"100","roomhint":"Keuken","name":"Keuken","nora":"48bacfcb.9887b8","topic":"113","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":920,"y":780,"wires":[["a1c7a6cf.d4bcb"]]},{"id":"39746777.4cd46","type":"nora-switch","z":"fd35c454.ee407","devicename":"het Haardvuur","roomhint":"Woonkamer","name":"Haardvuur","passthru":false,"nora":"48bacfcb.9887b8","topic":"176","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":930,"y":300,"wires":[["805526ff.cf4d08"]]},{"id":"805526ff.cf4d08","type":"function","z":"fd35c454.ee407","name":"Function out On/Off","func":"var idx = parseInt(msg.topic);\nif ( msg.payload === true )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"On\" };\n}\nelse if ( msg.payload === false )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Off\" };\n}\nreturn msg\n","outputs":1,"noerr":0,"x":1380,"y":280,"wires":[["7d584545.8c9544"]]},{"id":"a1c7a6cf.d4bcb","type":"function","z":"fd35c454.ee407","name":"Function out Dimmer","func":"var idx = parseInt(msg.topic)\nvar brightness = msg.payload\nif ( msg.payload === 0 )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Off\" };\nreturn [msg, null]\n}\nelse\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Set Level\", \"level\": brightness };\nreturn [null, msg]\n}\n\n\n","outputs":2,"noerr":0,"x":1300,"y":700,"wires":[["7d584545.8c9544"],["7d584545.8c9544"]]},{"id":"55a04197.0e6f9","type":"nora-scene","z":"fd35c454.ee407","devicename":"beveiliging","roomhint":"","scenereversible":true,"name":"beveiliging","nora":"48bacfcb.9887b8","topic":"5","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":920,"y":1180,"wires":[["e63a5889.fbb5b8"]]},{"id":"e63a5889.fbb5b8","type":"function","z":"fd35c454.ee407","name":"Function Scene","func":"var idx = parseInt(msg.topic)\nif ( msg.payload === true )\n{\nmsg.payload = { \"command\": \"switchscene\", \"idx\": idx, \"switchcmd\": \"On\" };\nreturn msg\n}\n\n","outputs":1,"noerr":0,"x":1320,"y":820,"wires":[["7d584545.8c9544"]]},{"id":"7d584545.8c9544","type":"json","z":"fd35c454.ee407","name":"","property":"payload","action":"","pretty":false,"x":1630,"y":580,"wires":[["caefbcc2.78bf18"]]},{"id":"caefbcc2.78bf18","type":"mqtt out","z":"fd35c454.ee407","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"34e4d2fc.90d346","x":1870,"y":580,"wires":[]},{"id":"34e4d2fc.90d346","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"48bacfcb.9887b8","type":"nora-config","z":"","name":"nora config","group":""}]
Let me know what you think!
[/quote]


To understand how it works i made this one. (not sophisticated but works for me..)

Code: Select all

[{"id":"a87d68b.8d28498","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"8429a357.ecfe","type":"inject","z":"a87d68b.8d28498","name":"Muurlamp uit","topic":"domoticz/in","payload":"{\"command\": \"switchlight\", \"idx\": 793, \"switchcmd\": \"Off\" }","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":120,"wires":[["94505c26.ae7dd"]]},{"id":"67fbb756.e36e18","type":"mqtt in","z":"a87d68b.8d28498","name":"","topic":"domoticz/#","qos":"2","datatype":"auto","broker":"bc4b9707.63ee58","x":120,"y":580,"wires":[["8e00c342.8b497"]]},{"id":"8e00c342.8b497","type":"debug","z":"a87d68b.8d28498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":490,"y":620,"wires":[]},{"id":"94505c26.ae7dd","type":"mqtt out","z":"a87d68b.8d28498","name":"","topic":"","qos":"","retain":"","broker":"bc4b9707.63ee58","x":570,"y":100,"wires":[]},{"id":"c187aecf.0bd52","type":"nora-light","z":"a87d68b.8d28498","devicename":"Muurlamp","lightcolor":false,"brightnesscontrol":false,"passthru":false,"statepayload":true,"brightnessoverride":"","roomhint":"Woonkamer","name":"Muurlamp","nora":"45fbca16.592194","topic":"domoticz/in","onvalue":"{\"command\": \"switchlight\", \"idx\": 793, \"switchcmd\": \"On\" }","onvalueType":"str","offvalue":"{\"command\": \"switchlight\", \"idx\": 793, \"switchcmd\": \"Off\" }","offvalueType":"str","x":160,"y":180,"wires":[["94505c26.ae7dd"]]},{"id":"df99a830.c52af8","type":"nora-scene","z":"a87d68b.8d28498","devicename":"Sleep","roomhint":"Woonkamer","scenereversible":false,"name":"Sleep","nora":"45fbca16.592194","topic":"domoticz/in","onvalue":"{\"command\": \"switchscene\", \"idx\": 2, \"switchcmd\": \"On\" }","onvalueType":"str","offvalue":"false","offvalueType":"bool","x":150,"y":240,"wires":[["94505c26.ae7dd"]]},{"id":"f7dfc4cf.952ed8","type":"nora-scene","z":"a87d68b.8d28498","devicename":"Scene","roomhint":"Woonkamer","scenereversible":false,"name":"avond","nora":"45fbca16.592194","topic":"domoticz/in","onvalue":"{\"command\": \"switchscene\", \"idx\": 1, \"switchcmd\": \"On\" }","onvalueType":"str","offvalue":"false","offvalueType":"bool","x":140,"y":320,"wires":[["94505c26.ae7dd"]]},{"id":"bc4b9707.63ee58","type":"mqtt-broker","z":"","name":"Domoticz mqqt client","broker":"http://192.168.178.19","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"45fbca16.592194","type":"nora-config","z":"","name":"nora config","group":"","notify":false}]
Please share your solutions.
Raspberry Pi3, RFlink, PiZigate, Yeelight, klikaanklikuit, Kodi, harmony hub, Zwave, ThermoSmart, XiaomiGateway (Aqara), Google home hub, roomba,
andersbz
Posts: 13
Joined: Sunday 03 April 2016 20:51
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Sweden
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by andersbz »

I've got lamps and switches working but I don't get scenes to work. Can anyone give any tips? The scene never gets connected.

Problem solved. It should never show connect. The icon for the scene appears in Google Assistant and can only be activated by voice
andersbz
Posts: 13
Joined: Sunday 03 April 2016 20:51
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Sweden
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by andersbz »

I want Domoticz to update the status of a device in node-red when a change occurs in Domoticz, for example, when a lamp switches on. As it is now, node-red is not updated and then it is not possible to switch off a lamp thru node-red (via Google Home) when the status in node-red is off but in Domoticz it is on. Anyone have a solution for this?
xury
Posts: 48
Joined: Monday 10 December 2018 23:32
Target OS: Linux
Domoticz version:
Location: Poland
Contact:

Re: Domoticz Google Assistant integration with node-red Easy Free Controlicz alternative!

Post by xury »

Its very simple. You must do feedback from domoticz/out, as in following example:

Code: Select all

[
    {
        "id": "76efc51b.db2e8c",
        "type": "mqtt in",
        "z": "46580878.ba4bd8",
        "name": "",
        "topic": "domoticz/out",
        "qos": "0",
        "datatype": "auto",
        "broker": "9748a36f.44bdd",
        "x": 230,
        "y": 240,
        "wires": [
            [
                "ed9342a4.d56ec"
            ]
        ]
    },
    {
        "id": "ed9342a4.d56ec",
        "type": "json",
        "z": "46580878.ba4bd8",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 370,
        "y": 240,
        "wires": [
            [
                "ebe7e2e1.4a69d"
            ]
        ]
    },
    {
        "id": "ebe7e2e1.4a69d",
        "type": "function",
        "z": "46580878.ba4bd8",
        "name": "Function In on/off",
        "func": "msg.topic = msg.payload.idx\nif (msg.payload.nvalue === 1)\n{\n    msg.payload = true\n}\nelse if (msg.payload.nvalue === 0)\n{\n    msg.payload = false\n}\n    return msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 570,
        "y": 240,
        "wires": [
            [
                "cd626796.602738"
            ]
        ]
    },
    {
        "id": "cd626796.602738",
        "type": "switch",
        "z": "46580878.ba4bd8",
        "name": "",
        "property": "topic",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "112",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "92",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "42",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "151",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "66",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "169",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "170",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "171",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "172",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "173",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "174",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "53",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "155",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 13,
        "x": 750,
        "y": 240,
        "wires": [
            [],
            [],
            [],
            [],
            [],
            [
                "89c0375f.018278"
            ],
            [],
            [],
            [],
            [],
            [],
            [],
            []
        ]
    },
    {
        "id": "89c0375f.018278",
        "type": "nora-light",
        "z": "46580878.ba4bd8",
        "devicename": "Dining table",
        "lightcolor": false,
        "brightnesscontrol": false,
        "passthru": false,
        "statepayload": true,
        "brightnessoverride": "",
        "roomhint": "Living room",
        "name": "Dining table",
        "nora": "4aa17da2.220c54",
        "topic": "169",
        "onvalue": "true",
        "onvalueType": "bool",
        "offvalue": "false",
        "offvalueType": "bool",
        "x": 910,
        "y": 220,
        "wires": [
            [
                "d4f7bf20.d6a37"
            ]
        ]
    },
    {
        "id": "d4f7bf20.d6a37",
        "type": "function",
        "z": "46580878.ba4bd8",
        "name": "Funkcja ON/OFF",
        "func": "var idx = msg.topic\nif ( msg.payload === true )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"On\" };\n}\nelse if ( msg.payload === false )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Off\" };\n}\nreturn msg\n",
        "outputs": 1,
        "noerr": 0,
        "x": 1130,
        "y": 220,
        "wires": [
            [
                "bf3249c4.4cabd8"
            ]
        ]
    },
    {
        "id": "bf3249c4.4cabd8",
        "type": "template",
        "z": "46580878.ba4bd8",
        "name": "Gen MQTT On/Off",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\"command\": \"switchlight\", \"idx\": {{payload.idx}}, \"switchcmd\": \"{{payload.switchcmd}}\" }",
        "output": "str",
        "x": 1350,
        "y": 220,
        "wires": [
            [
                "152b62fe.c8183d"
            ]
        ]
    },
    {
        "id": "152b62fe.c8183d",
        "type": "mqtt out",
        "z": "46580878.ba4bd8",
        "name": "",
        "topic": "domoticz/in",
        "qos": "",
        "retain": "",
        "broker": "9748a36f.44bdd",
        "x": 1410,
        "y": 300,
        "wires": []
    },
    {
        "id": "9748a36f.44bdd",
        "type": "mqtt-broker",
        "z": "",
        "broker": "localhost",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "compatmode": true,
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "willTopic": "",
        "willQos": "0",
        "willPayload": ""
    },
    {
        "id": "4aa17da2.220c54",
        "type": "nora-config",
        "z": "",
        "name": "nora config",
        "group": "",
        "notify": false
    }
]
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest