Page 1 of 12

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

Posted: Wednesday 10 April 2019 16:14
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!

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

Posted: Monday 22 April 2019 18:20
by pabloalcantara
Works perfectly - in less than one hour I migrate from Controlicz 20 itens.

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

Posted: Tuesday 07 May 2019 10:18
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.

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

Posted: Tuesday 07 May 2019 15:28
by Phantom
This works great :)
And thanks for the example flow that helped a lot.

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

Posted: Thursday 09 May 2019 15:13
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":""}]

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

Posted: Sunday 12 May 2019 19:43
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 ?

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

Posted: Sunday 23 June 2019 11:22
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

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

Posted: Monday 05 August 2019 11:55
by serfer
Welcome
I have such errors as in the attached file.
will you help?

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

Posted: Monday 05 August 2019 15:41
by Jofre
@serfer,

Line 10 should read: return msg;

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

Posted: Saturday 17 August 2019 17:57
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...

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

Posted: Sunday 18 August 2019 9:36
by JuanUil
looks great will try this

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

Posted: Sunday 18 August 2019 23:16
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

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

Posted: Sunday 25 August 2019 8:26
by quazar
Great, a small howto for Dummies would be much appreciated...

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

Posted: Wednesday 28 August 2019 12:56
by DAVIZINHO
hello,
Can someone detail this? it will be interesting. But i dont understand the basics :-(

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

Posted: Wednesday 28 August 2019 13:27
by freijn
much interested as well. please the dummies version ?

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

Posted: Wednesday 11 September 2019 18:44
by salvacalatayud
freijn wrote: Wednesday 28 August 2019 13:27 much interested as well. please the dummies version ?
+1

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

Posted: Saturday 14 September 2019 21:45
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.

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

Posted: Thursday 26 September 2019 20:39
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

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

Posted: Wednesday 16 October 2019 16:51
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?

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

Posted: Wednesday 16 October 2019 17:55
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
    }
]