msvds wrote: ↑Sunday 08 October 2017 12:13
Wob76 wrote: ↑Wednesday 04 October 2017 7:36
I will post an update for action control in my flow, but you can get responses using the previous flow, and as I mention using basic auth with IFTTT.
I am really looking forward on an update on this. I've followed Bradds and then Wob76 instructions, but I haven't got a response yet from Google Home. The value of the user variable is changing, but from there I am lost in how to debug what's going wrong.
Could you please explain in a bit more detail how to define the Regex expressions? And in which step of the process are they used? I clearly miss something here, probably because Node Red is also completely new to me. Perhaps a small flowchart would help to explain it?
Another question, how can I see what exactly happens in Node Red? I'd like to debug what's going on in there when IFTTT sends the webhook to domoticz.
Anothing thing that perhaps influences why it doesn't work for me is that I use the Google assistant on my NVidia Shield. This option has recently become available, so there is not much information about it yet,
I am really looking forward to get this working on my side. Many thanks in all the efforts that both of you have already put into this.
Hi msvds.
First of all, you need an actual google home device and a raspberry pi for any of this to work in relation to google home speaking out status commands etc. It should work for switching stuff in domoticz but you wont get any feedback from your Nvidia shield device. (unless someone creates a node for this) I don't have a Nvidia shield device so cannot comment.
Assuming you have a raspberry pi, If you followed my instructions and are getting google assistant to update the uservariable, but are not getting anything in node red, then the problem is most likely with your domoticz to node-red link via MQTT.
Basically, what happens when you update the "Status" uservariable in domoticz, it activates the virtual "Status" switch. This "switch change" is then sent to the MQTT server (mosquitto) and the previously posted flows in node-red then look at the MQTT server for this switch activation, once detected it then requests the uservariable "Status" text from domoticz and compares that text with whatever you have in the filter. For testing purposes you don't need regex expressions in the filter, just whatever matches your uservariable text. Once the match is made, the flow output then continues to whatever action you want it to perform.
Code: Select all
[{"id":"1245edb.3d83f12","type":"mqtt in","z":"113cf1c6.2fcb7e","name":"dom local output","topic":"domoticz/out","qos":"0","broker":"32aa3862.20a188","x":85,"y":1305.781494140625,"wires":[["3657faff.9ce496","1f947d50.047ab3"]]},{"id":"1f947d50.047ab3","type":"debug","z":"113cf1c6.2fcb7e","name":"","active":true,"console":"false","complete":"false","x":265,"y":1305,"wires":[]},{"id":"32aa3862.20a188","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""}]
If you import the above flow into node-red and deploy it, it should say connected below the "dom local output" mqtt in node (purple one). The green debug node will show you all data being received from domoticz via mqtt (in the debug tab under the Deploy button in node-red).
If it does not say connected with the green dot next to it, then this is your problem.
There is already a very good Wiki explaining the dom to node red link and how to set it up here
http://www.domoticz.com/wiki/MQTT
To summarize.
When you say "OK, Google, check test status" - The text "check test status" is sent to the IFTTT server and checked against any applets you have created, in this case the applet that you created for "Check $ status". It then substitutes the $ for the text you spoke, ie "test". This text is then added to the end of the json command send back to your domoticz server via the webhooks link which updates the uservariable called "Status" with the word "test"
Once domoticz detects the uservariable has changed, it then turns on the virtual switch called "status" and sends this "On command" to the MQTT server you have setup.
If it is all setup correctly, then Node-red is always looking at the information coming from the MQTT server and filters out the idx associated with the "Status" switch. Once this passes the IDX filter, it then requests the uservariable text from the uservariable "Status" in domoticz, which in this example would be "test"
It then passes the text "test" through a filter to output that command to do whatever you want with it.
There is a wealth of information already out there explaining in detail how to setup the dom to node red link, once you have this working it should then be self explanatory once you import the previously posted flows from either myself or wob.
If you just want to test the link between node red and your google home device. Import this flow and change the IP to that of your google home device.
Code: Select all
[{"id":"e45c4431.1b9408","type":"function","z":"fc663e33.3144c","name":"Change IP to the IP of your google home device","func":"msg.payload = {\n ip: '192.168.1.2',\n url: 'http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=this is a test message&tl=En-gb',\n contentType: 'audio/mp3',\n};\nreturn msg;","outputs":1,"noerr":0,"x":509,"y":274,"wires":[["3eaf7cdf.8b0e74"]]},{"id":"3eaf7cdf.8b0e74","type":"chromecast-play","z":"fc663e33.3144c","name":"","url":"","contentType":"","ip":"","x":796,"y":274,"wires":[[]]},{"id":"a148fe81.1ec6c","type":"inject","z":"fc663e33.3144c","name":"Test switch","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":224,"y":276,"wires":[["e45c4431.1b9408"]]}]
This would still work If you have a chromecast audio device for reading out responses, just substitute the ip address in the function for your chromecast audio device. Alternatively, you could substitute the chromecast "play" node for a (node-red-contrib-audio) node and this would play the responses out of your raspberry pi audio connections instead. Example below.
Code: Select all
[{"id":"7dedf4ad.13adbc","type":"function","z":"1f3a73d7.20eacc","name":"Test message to raspberry pi speakers","func":"msg.payload = 'http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=this is a test message&tl=En-gb';\nreturn msg;","outputs":1,"noerr":0,"x":533,"y":187,"wires":[["222efc84.909734"]]},{"id":"60e25d54.b12174","type":"inject","z":"1f3a73d7.20eacc","name":"Test Switch","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":288,"y":189,"wires":[["7dedf4ad.13adbc"]]},{"id":"222efc84.909734","type":"audio","z":"1f3a73d7.20eacc","x":782,"y":186,"wires":[]}]
Regards.