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

Alexa, Google Home and Siri

Moderator: leecollings

Post Reply
DennisHermse
Posts: 2
Joined: Saturday 16 May 2020 10:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

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

Post by DennisHermse »

Hey FireWizard,

Thanks for your quick response!

With the "Google Home" node from the "node-red-contrib-cast" library I got it to work.
Thank you!

Below a screenshot if people are interested:
GoogleHomeNodeRed.png
GoogleHomeNodeRed.png (47.73 KiB) Viewed 2629 times
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hi,

@DennisHermse

If you have finished your complete solution, would you like to post your flow.
Perhaps other users are looking for such a solution as well.

Regards
atmfrenki
Posts: 25
Joined: Monday 17 April 2017 13:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by atmfrenki »

Hi, thanks all for the explanations and stuff on how to get this working.
I got switches and dimming lights working.

The only struggle I have is with the blinds.
I have implemented the code that was given by salvacalatayud.

The problem is that I can open my blinds, but they won't shut.
Perhaps I am using a wrong value somewhere?

Can somebody share a working flow?
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hi,

@atmfrenki

Do you want to control your blinds from Domoticz with a switch type "Blind percentage"?

Screenshot_Shelly2.png
Screenshot_Shelly2.png (41.32 KiB) Viewed 2596 times
If so, a flow is quite easy.
Can you publish, what you have made so far?

Regards
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hi,

@atmfrenki
Can somebody share a working flow?
Please find attached a working flow.

1. First drag and drop the Nora Blinds node on the canvas and configure it, so that it is connected to Google Home.

As I don't want to interfere with your Nora configuration, I do not send the Nora node (and Nora config node)

2. Below you will find the input (left) side of the Nora Blinds node.
You have to change the IDX number in the Switch node, for the IDX of your Blinds Percentage Switch.
For the MQTT input, it is assumed that Mosquitto, Node Red and Domoticz are running on the same hardware.

Code: Select all

[{"id":"65113d1c.b3e4ac","type":"function","z":"56f1881a.2a6b9","name":"Function Shutter In","func":"msg.topic = msg.payload.idx;\n\nif (msg.payload.nvalue === 0) {\n    msg.payload = {\n        openPercent : 100\n    }\n}\nelse if (msg.payload.nvalue === 1) {\n    msg.payload = {\n        openPercent : 0\n    }\n}\nelse if (msg.payload.nvalue === 2) {\n    msg.payload = {\n        openPercent : (100 - parseInt(msg.payload.svalue1))\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"x":650,"y":600,"wires":[[]]},{"id":"603efd57.26379c","type":"mqtt in","z":"56f1881a.2a6b9","name":"Domoticz Out","topic":"domoticz/out","qos":"2","datatype":"json","broker":"c2d9657a.d81bf8","x":170,"y":600,"wires":[["3147de88.8ec8ca"]]},{"id":"3147de88.8ec8ca","type":"switch","z":"56f1881a.2a6b9","name":"Filter Shutter Switch","property":"payload.idx","propertyType":"msg","rules":[{"t":"eq","v":"18","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":400,"y":600,"wires":[["65113d1c.b3e4ac"]]},{"id":"c2d9657a.d81bf8","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
3, For the output (right) side of the Nora Blinds node, you will find the flow below.

Code: Select all

[{"id":"60d44acd.c874bc","type":"mqtt out","z":"56f1881a.2a6b9","name":"Domoticz In","topic":"domoticz/in","qos":"2","retain":"false","broker":"f9f13036.e28b58","x":950,"y":700,"wires":[]},{"id":"d8cd2804.40f7c8","type":"function","z":"56f1881a.2a6b9","name":"Function Shutter Out","func":"var idx = parseInt(msg.topic);\n\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Set Level\", \"level\": (100 - msg.payload.openPercent)};\nreturn msg","outputs":1,"noerr":0,"x":720,"y":700,"wires":[["60d44acd.c874bc"]]},{"id":"f9f13036.e28b58","type":"mqtt-broker","z":"","name":"RPI1_ MQTT_Broker","broker":"192.168.10.51","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Test it and report in case of problems.

Regards
atmfrenki
Posts: 25
Joined: Monday 17 April 2017 13:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by atmfrenki »

FireWizard wrote: Saturday 06 June 2020 17:58 Hi,

@atmfrenki
Can somebody share a working flow?
Please find attached a working flow.

1. First drag and drop the Nora Blinds node on the canvas and configure it, so that it is connected to Google Home.

As I don't want to interfere with your Nora configuration, I do not send the Nora node (and Nora config node)

2. Below you will find the input (left) side of the Nora Blinds node.
You have to change the IDX number in the Switch node, for the IDX of your Blinds Percentage Switch.
For the MQTT input, it is assumed that Mosquitto, Node Red and Domoticz are running on the same hardware.

Code: Select all

[{"id":"65113d1c.b3e4ac","type":"function","z":"56f1881a.2a6b9","name":"Function Shutter In","func":"msg.topic = msg.payload.idx;\n\nif (msg.payload.nvalue === 0) {\n    msg.payload = {\n        openPercent : 100\n    }\n}\nelse if (msg.payload.nvalue === 1) {\n    msg.payload = {\n        openPercent : 0\n    }\n}\nelse if (msg.payload.nvalue === 2) {\n    msg.payload = {\n        openPercent : (100 - parseInt(msg.payload.svalue1))\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"x":650,"y":600,"wires":[[]]},{"id":"603efd57.26379c","type":"mqtt in","z":"56f1881a.2a6b9","name":"Domoticz Out","topic":"domoticz/out","qos":"2","datatype":"json","broker":"c2d9657a.d81bf8","x":170,"y":600,"wires":[["3147de88.8ec8ca"]]},{"id":"3147de88.8ec8ca","type":"switch","z":"56f1881a.2a6b9","name":"Filter Shutter Switch","property":"payload.idx","propertyType":"msg","rules":[{"t":"eq","v":"18","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":400,"y":600,"wires":[["65113d1c.b3e4ac"]]},{"id":"c2d9657a.d81bf8","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
3, For the output (right) side of the Nora Blinds node, you will find the flow below.

Code: Select all

[{"id":"60d44acd.c874bc","type":"mqtt out","z":"56f1881a.2a6b9","name":"Domoticz In","topic":"domoticz/in","qos":"2","retain":"false","broker":"f9f13036.e28b58","x":950,"y":700,"wires":[]},{"id":"d8cd2804.40f7c8","type":"function","z":"56f1881a.2a6b9","name":"Function Shutter Out","func":"var idx = parseInt(msg.topic);\n\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Set Level\", \"level\": (100 - msg.payload.openPercent)};\nreturn msg","outputs":1,"noerr":0,"x":720,"y":700,"wires":[["60d44acd.c874bc"]]},{"id":"f9f13036.e28b58","type":"mqtt-broker","z":"","name":"RPI1_ MQTT_Broker","broker":"192.168.10.51","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Test it and report in case of problems.

Regards
Thanks!!! I will try it out!
Could take a few days until i get home, but thanks and I'll let you know!

Regards
atmfrenki
Posts: 25
Joined: Monday 17 April 2017 13:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by atmfrenki »

Hi
@FireWizard

I managed to test your script.
De shutter went open just fine, works great, but to close it unfortunately not so mutch....

It is a Kaku ASUN-650 switch, don't know if that matters?
Here is my flow and all properties for the shutter based on your scripts:
Knipsel.JPG
Knipsel.JPG (74.7 KiB) Viewed 2533 times
Thanks again for the trouble!
I know how to read, use and apply existing code, but i can't make it up myself.....

I made a workaround in Domoticz, i added a virtual on/off switch and a blockly script for the shutter.
So now when I flip the switch (through nora) the shutter works....... I know it's not realy clean, but it works.... 8-)

Regards!
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

HI,

@atmfrenki
Thanks again for the trouble!
It's my pleasure :)
It is a Kaku ASUN-650 switch, don't know if that matters?
The flow has been made for a switch (Blinds Percentage), as presented in the post, dated June 05, 2020 22:43h

My question is: How do you control your blinds with the KAKU ASUN-650?
Do you use also a "Blinds Percentage" switch or has other devices been created.
If so, tell me, as the flow needs some modification.

Regards
atmfrenki
Posts: 25
Joined: Monday 17 April 2017 13:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by atmfrenki »

@FireWizard

In Domoticz the "Blinds" switch has no percentages.

I have made a screenshot of the switch. (i don't use the "Blinds Percentage" switch, is that the problem?)
If this is not what you mean please let me know!
blinds.JPG
blinds.JPG (82.47 KiB) Viewed 2502 times
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hi,

@atmfrenki

I have modified the "Function" nodes, according to the "Switch" type, you use.
The previous code doesn't work with your "Switch" type (Blinds)

Please, try the following code as input into the "Nora" node (type "blinds").
It might be necessary to modify the "Split" node, called "Filter Shutter Switch" and to give in the right IDX number (currently 58).

Code: Select all

[{"id":"38ef7df0.38f0c2","type":"function","z":"56f1881a.2a6b9","name":"Function Shutter In","func":"msg.topic = msg.payload.idx;\n\nif (msg.payload.nvalue === 0) {\n    msg.payload = {\n        openPercent : 100\n    }\n}\nelse if (msg.payload.nvalue === 1) {\n    msg.payload = {\n        openPercent : 0\n    }\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":653,"y":780,"wires":[["e723267f.5e1718"]]},{"id":"f86c0630.9afe","type":"mqtt in","z":"56f1881a.2a6b9","name":"Domoticz Out","topic":"domoticz/out","qos":"2","datatype":"json","broker":"c2d9657a.d81bf8","x":173,"y":780,"wires":[["b7cd724e.9591c"]]},{"id":"b7cd724e.9591c","type":"switch","z":"56f1881a.2a6b9","name":"Filter Shutter Switch","property":"payload.idx","propertyType":"msg","rules":[{"t":"eq","v":"58","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":403,"y":780,"wires":[["38ef7df0.38f0c2"]]},{"id":"c2d9657a.d81bf8","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Find below the code for the output from the "Nora" node to Domoticz.

Code: Select all

[{"id":"e4c0f4e4.e75cb8","type":"function","z":"56f1881a.2a6b9","name":"Function Shutter Out","func":"var idx = parseInt(msg.topic);\n\nif (msg.payload.openPercent === 100) {\n    msg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Off\"};\n    }\nelse if (msg.payload.openPercent === 0) {\n    msg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"On\"};\n    }\nreturn msg","outputs":1,"noerr":0,"x":723,"y":884,"wires":[["148668e7.94fcaf","860b5193.ae5c6"]]},{"id":"148668e7.94fcaf","type":"mqtt out","z":"56f1881a.2a6b9","name":"Domoticz In","topic":"domoticz/in","qos":"2","retain":"false","broker":"f9f13036.e28b58","x":953,"y":884,"wires":[]},{"id":"f9f13036.e28b58","type":"mqtt-broker","z":"","name":"RPI1_ MQTT_Broker","broker":"192.168.10.51","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
I have a question, just curiosity. How do you you handle, let's say 50% (or whatever, what value) open of the Blinds with a KAKU ASUN-650 switch?
Or isn't that possible?

Awaiting you results.

Regards
Last edited by FireWizard on Friday 19 June 2020 9:04, edited 2 times in total.
atmfrenki
Posts: 25
Joined: Monday 17 April 2017 13:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by atmfrenki »

Hi

@FireWizard

Thanks for the solution, works like a charm!

The Asun-650 doesn't work with percentages.
I tried it, changed the devicetype in domoticz, but than it does not work anymore.

When I want the shutter half open I have to use the same command again to open or close, than it stops the shutter from closing or further opening.
You can call it a dumb "smart switch" .

Thanks for the Help!
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hi,

@atmfrenki

You wrote:
When I want the shutter half open I have to use the same command again to open or close, than it stops the shutter from closing or further opening.
I have considered a solution for that, but it didn't work well.
So I think, you have to live with that.

Regards
EvJd
Posts: 13
Joined: Tuesday 11 February 2020 11:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by EvJd »

Hello,
I used to controll my Milights with Nora and Domoticz . Only the last days something is wrong. I have 3 lights in total, but only 2 lights respond to my voice. "Eetkamerlamp" and "Keukenlamp" respond, but "woonkamerlamp" won't.

In Node red- NORA I can see that the lights give a different response. My "woonkamerlamp" has IDX7 and don't recieve command like my other lights with IDX8 en IDX9. Can someone tells me whats wrong and were I should fix it?

9 : msg.payload : string[96]
"{"command":"setcolbrightnessvalue","idx":9,"color":{"m":3,"t":0,"cw":0,"ww":0},"brightness":100}"
29-9-2020 11:20:23node: 480dbe04.c35948 : msg.payload : string[120]
"{"command":"setcolbrightnessvalue","idx":8,"color":{"m":3,"t":0,"r":255,"g":255,"b":255,"cw":0,"ww":0},"brightness":100}"
29-9-2020 11:20:23node: 480dbe04.c3594

7 : msg.payload : string[71]
"[{"red":255,"green":255,"blue":255},{"red":255,"green":255,"blue":255}]"

This is my flow:

Code: Select all

[{"id":"3c92e734.171818","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"3e8e912c.e1adde","type":"mqtt-broker","z":"","name":"Domoticz Master","broker":"192.168.2.104","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"db75ebcb.8d79b8","type":"nora-config","z":"","name":"NoraEline","group":"","notify":false},{"id":"41536b1a.23a72c","type":"mqtt in","z":"3c92e734.171818","name":"","topic":"domoticz/out","qos":"0","datatype":"auto","broker":"3e8e912c.e1adde","x":90,"y":660,"wires":[["e43daed7.afcb1"]]},{"id":"e285baf1.c8221","type":"mqtt out","z":"3c92e734.171818","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"3e8e912c.e1adde","x":2210,"y":760,"wires":[]},{"id":"c423af4b.628d48","type":"nora-light","z":"3c92e734.171818","devicename":"Eettafellamp","lightcolor":true,"brightnesscontrol":true,"turnonwhenbrightnesschanges":true,"passthru":false,"statepayload":true,"brightnessoverride":"","roomhint":"Woonkamer","name":"Eettafellamp","nora":"db75ebcb.8d79b8","topic":"8","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":1010,"y":700,"wires":[["ff05268d.4ef5d8","79711b8f.ccc17c"]]},{"id":"29a47fec.b643b8","type":"nora-light","z":"3c92e734.171818","devicename":"Keukenlamp","lightcolor":true,"brightnesscontrol":true,"turnonwhenbrightnesschanges":true,"passthru":false,"statepayload":true,"brightnessoverride":"","roomhint":"Woonkamer","name":"Keukenlamp","nora":"db75ebcb.8d79b8","topic":"9","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":1010,"y":620,"wires":[["ff05268d.4ef5d8","79711b8f.ccc17c"]]},{"id":"b8adff89.f50118","type":"nora-light","z":"3c92e734.171818","devicename":"Slaapkamerlamp","lightcolor":true,"brightnesscontrol":true,"turnonwhenbrightnesschanges":true,"passthru":false,"statepayload":true,"brightnessoverride":"","roomhint":"Slaapkamer","name":"Slaapkamerlamp","nora":"db75ebcb.8d79b8","topic":"10","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":1030,"y":920,"wires":[["79711b8f.ccc17c","ff05268d.4ef5d8"]]},{"id":"e43daed7.afcb1","type":"json","z":"3c92e734.171818","name":"","property":"payload","action":"","pretty":false,"x":50,"y":920,"wires":[["c59303a0.79cbc"]]},{"id":"5f86d0be.611a18","type":"function","z":"3c92e734.171818","name":"Function In ","func":"msg.topic = msg.payload[0].idx;\nif (msg.payload[0].nvalue !== 0)\n{\n    msg.payload = {\n        on : true,\n        brightness : msg.payload[0].Level,\n        color : {\n            spectrumHsv : {\n                hue : msg.payload[1].red,\n                saturation : msg.payload[1].green/100,\n                value : msg.payload[1].blue/100\n            }\n        }\n    }\n}\nelse if (msg.payload[0].nvalue === 0)\n{\n    msg.payload = {\n        on : false,\n        brightness : msg.payload[0].Level,\n        color : {\n            spectrumHsv : {\n                hue : msg.payload[1].red,\n                saturation : msg.payload[1].green/100,\n                value : msg.payload[1].blue/100\n            }\n        }\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":920,"wires":[["cdddfc9a.330d8"]]},{"id":"cdddfc9a.330d8","type":"switch","z":"3c92e734.171818","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"12","vt":"str"},{"t":"eq","v":"107","vt":"str"},{"t":"eq","v":"101","vt":"str"},{"t":"eq","v":"108","vt":"str"},{"t":"eq","v":"109","vt":"str"},{"t":"eq","v":"110","vt":"str"},{"t":"eq","v":"111","vt":"str"},{"t":"eq","v":"112","vt":"str"},{"t":"eq","v":"113","vt":"str"},{"t":"eq","v":"114","vt":"str"}],"checkall":"true","repair":false,"outputs":10,"x":810,"y":920,"wires":[[],[],[],[],[],[],["51395171.440228"],["c423af4b.628d48"],["29a47fec.b643b8"],["b8adff89.f50118"]]},{"id":"cf6fe547.d77c","type":"function","z":"3c92e734.171818","name":"Function Out","func":"var idx = parseInt(msg.topic);\nif ( msg.payload[0].on === true )\n{\n    msg.payload = {\n        \"command\" : \"setcolbrightnessvalue\",\n        \"idx\" : idx,\n        \"color\" : {\"m\":3,\"t\":0,\"r\":msg.payload[1].red,\"g\":msg.payload[1].green,\"b\":msg.payload[1].blue,\"cw\":0,\"ww\":0},\n        \"brightness\": msg.payload[0].brightness\n    };\n}\nelse if ( msg.payload[0].on === false )\n{\n    msg.payload = {\n        \"command\": \"switchlight\",\n        \"idx\": idx,\n        \"switchcmd\": \"Off\"\n        \n    };\n}\nreturn msg","outputs":1,"noerr":0,"x":1830,"y":920,"wires":[["b2e67708.d6308"]]},{"id":"b2e67708.d6308","type":"json","z":"3c92e734.171818","name":"","property":"payload","action":"","pretty":false,"x":2010,"y":920,"wires":[["480dbe04.c3594","e285baf1.c8221"]]},{"id":"480dbe04.c3594","type":"debug","z":"3c92e734.171818","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":2250,"y":920,"wires":[]},{"id":"102be427.6e565c","type":"color-convert","z":"3c92e734.171818","input":"rgb","output":"hsv","outputType":"object","scaleInput":false,"x":490,"y":1020,"wires":[["d137d46e.829698"]]},{"id":"c59303a0.79cbc","type":"filter","z":"3c92e734.171818","name":"Filter Dimmer","property":"payload.switchType","propertyType":"msg","asArray":false,"itemProperty":"","itemPropertyType":"item","rules":[{"t":"eq","v":"Dimmer","vt":"str","output":1}],"checkall":"true","outputs":1,"x":240,"y":920,"wires":[["a5fc3301.232308","d137d46e.829698"]]},{"id":"a5fc3301.232308","type":"function","z":"3c92e734.171818","name":"Create RGB Array","func":"msg.payload = {\n    red : msg.payload.Color.r,\n    green : msg.payload.Color.g,\n    blue : msg.payload.Color.b\n};\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":1020,"wires":[["102be427.6e565c"]]},{"id":"d137d46e.829698","type":"join","z":"3c92e734.171818","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":510,"y":880,"wires":[["5f86d0be.611a18"]]},{"id":"85201815.ea3dc","type":"color-convert","z":"3c92e734.171818","input":"hsv","output":"rgb","outputType":"object","scaleInput":true,"x":1330,"y":1060,"wires":[["ff05268d.4ef5d8"]]},{"id":"79711b8f.ccc17c","type":"function","z":"3c92e734.171818","name":"Create HSV Array","func":"msg.payload = {\n    hue : msg.payload.color.spectrumHsv.hue,\n    saturation : msg.payload.color.spectrumHsv.saturation,\n    value : msg.payload.color.spectrumHsv.value,\n};\nreturn msg;","outputs":1,"noerr":0,"x":1390,"y":640,"wires":[["85201815.ea3dc"]]},{"id":"ff05268d.4ef5d8","type":"join","z":"3c92e734.171818","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1650,"y":920,"wires":[["cf6fe547.d77c"]]},{"id":"51395171.440228","type":"nora-light","z":"3c92e734.171818","devicename":"Woonkamerlamp","lightcolor":true,"brightnesscontrol":true,"turnonwhenbrightnesschanges":true,"passthru":false,"statepayload":true,"brightnessoverride":"","roomhint":"Woonkamer","name":"Woonkamerlamp","nora":"db75ebcb.8d79b8","topic":"7","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":1030,"y":820,"wires":[["79711b8f.ccc17c","ff05268d.4ef5d8"]]}]
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

@EvJd

Hi,

I checked the supplied flow, with the flow we made initially. I don't see any issues.
As I do not expect that code changes randomly, I don't think it is related to the Node Red flow.

1. Is there anything that you may remember, that has changed recently? Not only Domoticz or Node Red, but also the configuration of the Google Assistant.

2. Could you connect a "Debug" node to the output of the NORA node and compare the results of the functioning lamp with the not-functioning lamp.
Any differences? Check in Node Red that the NORA node for Woonkamerlamp is showing "connected (on)" or "(off).

3. Check in the Google Assistant app (on your phone), if the light is still configured.

4. If above is not giving a hint/result try to reconnect your NORA account in the Google Assistant app (on your phone).

Regards
EvJd
Posts: 13
Joined: Tuesday 11 February 2020 11:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by EvJd »

FireWizard wrote: Tuesday 29 September 2020 21:23 @EvJd

Hi,

I checked the supplied flow, with the flow we made initially. I don't see any issues.
As I do not expect that code changes randomly, I don't think it is related to the Node Red flow.

1. Is there anything that you may remember, that has changed recently? Not only Domoticz or Node Red, but also the configuration of the Google Assistant.

2. Could you connect a "Debug" node to the output of the NORA node and compare the results of the functioning lamp with the not-functioning lamp.
Any differences? Check in Node Red that the NORA node for Woonkamerlamp is showing "connected (on)" or "(off).

3. Check in the Google Assistant app (on your phone), if the light is still configured.

4. If above is not giving a hint/result try to reconnect your NORA account in the Google Assistant app (on your phone).

Regards

No I can't think of anything changed. Only difference I see is that IDX9 gives "command" (see my message) and IDX7 doenst.
Nora allready disconnected and connected again to google, but no luck.
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hi,

@EvJd

Could you connect a "Debug" node to the output of the NORA node and compare the results of the functioning lamp with the not-functioning lamp.
Also at other places down in the chain.

Publish, what you see.

Regards
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 »

Hi all.

I've just installed new milights cct, I can change colour and switch them off, but there is no way of turning them on. I have other milight working fine.
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hi.

@salvacalatayud

Can you share your flow, so that I can have a look at it?

Regards
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 »

FireWizard wrote: Thursday 08 October 2020 13:18 Hi.

@salvacalatayud

Can you share your flow, so that I can have a look at it?

Regards
This is my flow,

Code: Select all

[{"id":"95f6c581.d87378","type":"tab","label":"Nora colores","disabled":false,"info":""},{"id":"bb81d891.fa9768","type":"function","z":"95f6c581.d87378","name":"Function In ","func":"msg.topic = msg.payload[0].idx;\nif (msg.payload[0].nvalue !== 0)\n{\n    msg.payload = {\n        on : true,\n        brightness : msg.payload[0].Level,\n        color : {\n            spectrumHsv : {\n                hue : msg.payload[1].red,\n                saturation : msg.payload[1].green/100,\n                value : msg.payload[1].blue/100\n            }\n        }\n    }\n}\nelse if (msg.payload[0].nvalue === 0)\n{\n    msg.payload = {\n        on : false,\n        brightness : msg.payload[0].Level,\n        color : {\n            spectrumHsv : {\n                hue : msg.payload[1].red,\n                saturation : msg.payload[1].green/100,\n                value : msg.payload[1].blue/100\n            }\n        }\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"x":813.6666564941406,"y":376.0000057220459,"wires":[["6ae448ec.0ec3d8"]]},{"id":"ba887175.7f0b6","type":"color-convert","z":"95f6c581.d87378","input":"rgb","output":"hsv","outputType":"object","scaleInput":false,"x":512,"y":206,"wires":[["86f8ffd.3b99"]]},{"id":"4cc581f6.785c3","type":"function","z":"95f6c581.d87378","name":"Create RGB Array","func":"msg.payload = {\n    red : msg.payload.Color.r,\n    green : msg.payload.Color.g,\n    blue : msg.payload.Color.b\n};\nreturn msg;","outputs":1,"noerr":0,"x":292,"y":206,"wires":[["ba887175.7f0b6"]]},{"id":"86f8ffd.3b99","type":"join","z":"95f6c581.d87378","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":610.3333320617676,"y":369.33332920074463,"wires":[["bb81d891.fa9768"]]},{"id":"d45de94.d29fb18","type":"nora-light","z":"95f6c581.d87378","devicename":"Armario","lightcolor":true,"brightnesscontrol":true,"turnonwhenbrightnesschanges":true,"passthru":false,"statepayload":true,"brightnessoverride":"","roomhint":"papas","name":"Armario","nora":"549f1c7c.ed3b64","topic":"152","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":1370.7141952514648,"y":294.4761161804199,"wires":[["d95bef79.b57f4","fe446fb2.19ccf"]]},{"id":"b349dee4.07dbb","type":"nora-light","z":"95f6c581.d87378","devicename":"Techo Cabezal","lightcolor":true,"brightnesscontrol":true,"turnonwhenbrightnesschanges":true,"passthru":false,"statepayload":true,"brightnessoverride":"","roomhint":"papas","name":"Cabezal","nora":"549f1c7c.ed3b64","topic":"133","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":1412.000072479248,"y":532.333330154419,"wires":[["67a1c1c6.a3d13","5067560f.92d9b8"]]},{"id":"6ae448ec.0ec3d8","type":"switch","z":"95f6c581.d87378","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"152","vt":"str"},{"t":"eq","v":"28","vt":"str"},{"t":"eq","v":"133","vt":"str"},{"t":"eq","v":"144","vt":"str"},{"t":"eq","v":"172","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":1051.666660308838,"y":379.6666450500488,"wires":[["d45de94.d29fb18"],[],["b349dee4.07dbb"],[],["35dec0c1.9c53b"]]},{"id":"cb4a4426.043378","type":"mqtt in","z":"95f6c581.d87378","name":"","topic":"domoticz/out","qos":"2","broker":"d7099359.70a6d","x":75,"y":276.6666531562805,"wires":[["e447f48b.ef0948"]]},{"id":"e447f48b.ef0948","type":"json","z":"95f6c581.d87378","name":"","property":"payload","action":"","pretty":false,"x":235,"y":276.6666531562805,"wires":[["f47ccbb6.ee5c78"]]},{"id":"f47ccbb6.ee5c78","type":"switch","z":"95f6c581.d87378","name":"","property":"payload.switchType","propertyType":"msg","rules":[{"t":"cont","v":"On/Off","vt":"str"},{"t":"eq","v":"Dimmer","vt":"str"},{"t":"cont","v":"color switch","vt":"str"},{"t":"cont","v":"Thermostat","vt":"str"},{"t":"eq","v":"Temperature","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":375,"y":276.6666531562805,"wires":[[],["4cc581f6.785c3","86f8ffd.3b99"],[],[],[]]},{"id":"90fbed01.f0b84","type":"function","z":"95f6c581.d87378","name":"Function Out","func":"var idx = parseInt(msg.topic);\nif ( msg.payload[0].on === true )\n{\n    msg.payload = {\n        \"command\" : \"setcolbrightnessvalue\",\n        \"idx\" : idx,\n        \"color\" : {\"m\":3,\"t\":0,\"r\":msg.payload[1].red,\"g\":msg.payload[1].green,\"b\":msg.payload[1].blue,\"cw\":0,\"ww\":0},\n        \"brightness\": msg.payload[0].brightness\n    };\n}\nelse if ( msg.payload[0].on === false )\n{\n    msg.payload = {\n        \"command\": \"switchlight\",\n        \"idx\": idx,\n        \"switchcmd\": \"Off\"\n        \n    };\n}\nreturn msg","outputs":1,"noerr":0,"x":1830,"y":295,"wires":[["9b8f2bfe.74ef28"]]},{"id":"9b8f2bfe.74ef28","type":"json","z":"95f6c581.d87378","name":"","property":"payload","action":"","pretty":false,"x":2020,"y":295,"wires":[["8fc0e552.2f2b68"]]},{"id":"fe139bea.d09d78","type":"color-convert","z":"95f6c581.d87378","input":"hsv","output":"rgb","outputType":"object","scaleInput":false,"x":1640,"y":355,"wires":[["fe446fb2.19ccf"]]},{"id":"d95bef79.b57f4","type":"function","z":"95f6c581.d87378","name":"Create HSV Array","func":"msg.payload = {\n    hue : msg.payload.color.spectrumHsv.hue,\n    saturation : msg.payload.color.spectrumHsv.saturation,\n    value : msg.payload.color.spectrumHsv.value,\n};\nreturn msg;","outputs":1,"noerr":0,"x":1420,"y":355,"wires":[["fe139bea.d09d78"]]},{"id":"fe446fb2.19ccf","type":"join","z":"95f6c581.d87378","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1640,"y":295,"wires":[["90fbed01.f0b84"]]},{"id":"8fc0e552.2f2b68","type":"mqtt out","z":"95f6c581.d87378","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"d7099359.70a6d","x":2240,"y":291.6666564941406,"wires":[]},{"id":"b4132630.ffd818","type":"function","z":"95f6c581.d87378","name":"Function Out","func":"var idx = parseInt(msg.topic);\nif ( msg.payload[0].on === true )\n{\n    msg.payload = {\n        \"command\" : \"setcolbrightnessvalue\",\n        \"idx\" : idx,\n        \"color\" : {\"m\":3,\"t\":0,\"r\":msg.payload[1].red,\"g\":msg.payload[1].green,\"b\":msg.payload[1].blue,\"cw\":0,\"ww\":0},\n        \"brightness\": msg.payload[0].brightness\n    };\n}\nelse if ( msg.payload[0].on === false )\n{\n    msg.payload = {\n        \"command\": \"switchlight\",\n        \"idx\": idx,\n        \"switchcmd\": \"Off\"\n        \n    };\n}\nreturn msg","outputs":1,"noerr":0,"x":1833.9998779296875,"y":533.3333129882812,"wires":[["9b8f2bfe.74ef28"]]},{"id":"30b71cd4.e94cb4","type":"color-convert","z":"95f6c581.d87378","input":"hsv","output":"rgb","outputType":"object","scaleInput":true,"x":1649.9999237060547,"y":593.3333110809326,"wires":[["5067560f.92d9b8"]]},{"id":"67a1c1c6.a3d13","type":"function","z":"95f6c581.d87378","name":"Create HSV Array","func":"msg.payload = {\n    hue : msg.payload.color.spectrumHsv.hue,\n    saturation : msg.payload.color.spectrumHsv.saturation,\n    value : msg.payload.color.spectrumHsv.value,\n};\nreturn msg;","outputs":1,"noerr":0,"x":1429.9999237060547,"y":593.3333110809326,"wires":[["30b71cd4.e94cb4"]]},{"id":"5067560f.92d9b8","type":"join","z":"95f6c581.d87378","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1649.9999237060547,"y":533.3333110809326,"wires":[["b4132630.ffd818"]]},{"id":"35dec0c1.9c53b","type":"nora-light","z":"95f6c581.d87378","devicename":"Techo","lightcolor":true,"brightnesscontrol":true,"turnonwhenbrightnesschanges":true,"passthru":false,"statepayload":true,"brightnessoverride":"","roomhint":"papas","name":"Techo","nora":"549f1c7c.ed3b64","topic":"172","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":1394,"y":785,"wires":[["e8d7b0c8.a0521","c58ac9d1.95eab8"]]},{"id":"4963b723.454d98","type":"function","z":"95f6c581.d87378","name":"Function Out","func":"var idx = parseInt(msg.topic);\nif ( msg.payload[0].on === true )\n{\n    msg.payload = {\n        \"command\" : \"setcolbrightnessvalue\",\n        \"idx\" : idx,\n        \"color\" : {\"m\":3,\"t\":0,\"r\":msg.payload[1].red,\"g\":msg.payload[1].green,\"b\":msg.payload[1].blue,\"cw\":0,\"ww\":0},\n        \"brightness\": msg.payload[0].brightness\n    };\n}\nelse if ( msg.payload[0].on === false )\n{\n    msg.payload = {\n        \"command\": \"switchlight\",\n        \"idx\": idx,\n        \"switchcmd\": \"Off\"\n        \n    };\n}\nreturn msg","outputs":1,"noerr":0,"x":1858.999755859375,"y":780,"wires":[["9b8f2bfe.74ef28"]]},{"id":"c5f0d572.d548d8","type":"color-convert","z":"95f6c581.d87378","input":"hsv","output":"rgb","outputType":"object","scaleInput":true,"x":1641.9998512268066,"y":845.9999809265137,"wires":[["c58ac9d1.95eab8"]]},{"id":"e8d7b0c8.a0521","type":"function","z":"95f6c581.d87378","name":"Create HSV Array","func":"msg.payload = {\n    hue : msg.payload.color.spectrumHsv.hue,\n    saturation : msg.payload.color.spectrumHsv.saturation,\n    value : msg.payload.color.spectrumHsv.value,\n};\nreturn msg;","outputs":1,"noerr":0,"x":1421.9998512268066,"y":845.9999809265137,"wires":[["c5f0d572.d548d8"]]},{"id":"c58ac9d1.95eab8","type":"join","z":"95f6c581.d87378","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1641.9998512268066,"y":785.9999809265137,"wires":[["4963b723.454d98"]]},{"id":"549f1c7c.ed3b64","type":"nora-config","z":"","name":"Salva Nora","group":"","notify":false},{"id":"d7099359.70a6d","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":""}]
The one named "techo" is not switching on, the other do
User avatar
FireWizard
Posts: 1905
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

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

Post by FireWizard »

Hi.

@salvacalatayud

Unfortunately, I am not able to reproduce your issue.

Can you connect a "Debug" node, as shown in the screenshot below and return the result.
Perhaps you can also connect a "Debug" node at the same place in a working flow and compare results.

Screenshot_Milight.png
Screenshot_Milight.png (23.94 KiB) Viewed 2141 times
Regards
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest