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

Alexa, Google Home and Siri

Moderator: leecollings

edwin1234
Posts: 287
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 »

FireWizard wrote: Monday 08 March 2021 16:51 Hello @edwin1234

Is this really produced by 1 thermostat????

I don't think that the message is correct, as it ends with:
"output":
Is it possible for you to install MQTT Explorer ( http://mqtt-explorer.com/) and publish a screenshot of what you see regarding this thermostat.
And if you copy such code into a post please use </> so that it looks like:

Code: Select all

[{"features":[{"access":3,"description":"Enables/disables physical input on the device","name":"state","property":"child_lock","type":"binary","value_off":"UNLOCK","value_on":"LOCK"}],"type":"lock"},{"features":[{"access":3,"description":"Enables/disables window detection on the device","name":"state","property":"window_detection","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"access":1,"description":"Indicates if the battery of this device is almost empty","name":"battery_low","property":"battery_low","type":"binary","value_off":false,"value_on":true},{"features":[{"access":3,"name":"state","property":"valve_detection","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"access":1,"description":"Position","name":"position","property":"position","type":"numeric","unit":"%"},{"features":[{"access":3,"description":"Temperature setpoint","name":"current_heating_setpoint","property":"current_heating_setpoint","type":"numeric","unit":"°C","value_max":35,"value_min":5,"value_step":0.5},{"access":1,"description":"Current temperature measured on the device","name":"local_temperature","property":"local_temperature","type":"numeric","unit":"°C"},{"access":3,"description":"Mode of this device","name":"system_mode","property":"system_mode","type":"enum","values":["heat","auto","off"]},{"access":1,"description":"The current running state","name":"running_state","property":"running_state","type":"enum","values":["idle","heat"]},{"access":3,"description":"Offset to be used in the local_temperature","name":"local_temperature_calibration","property":"local_temperature_calibration","type":"numeric","unit":"°C"},{"access":3,"description":"Away mode","name":"away_mode","property":"away_mode","type":"binary","value_off":"OFF","value_on":"ON"},{"access":3,"description":"Mode of this device (similar to system_mode)","name":"preset","property":"preset","type":"enum","values":["schedule","manual","boost","complex","comfort","eco"]}],"type":"climate"},{"features":[{"access":3,"description":"Enable/disable auto lock","name":"state","property":"auto_lock","type":"binary","value_off":"MANUAL","value_on":"AUTO"}],"type":"switch"},{"features":[{"access":3,"description":"Enable/disable away mode","name":"state","property":"away_mode","type":"binary","value_off":"OFF","value_on":"ON"}],"type":"switch"},{"access":3,"description":"Away preset days","name":"away_preset_days","property":"away_preset_days","type":"numeric"},{"access":3,"description":"Boost time","name":"boost_time","property":"boost_time","type":"numeric","unit":"s"},{"access":3,"description":"Comfort temperature","name":"comfort_temperature","property":"comfort_temperature","type":"numeric","unit":"°C"},{"access":3,"description":"Eco temperature","name":"eco_temperature","property":"eco_temperature","type":"numeric","unit":"°C"},{"access":3,"description":"Force the valve position","name":"force","property":"force","type":"enum","values":["normal","open","close"]},{"access":3,"description":"Maximum temperature","name":"max_temperature","property":"max_temperature","type":"numeric","unit":"°C"},{"access":3,"description":"Minimum temperature","name":"min_temperature","property":"min_temperature","type":"numeric","unit":"°C"},{"access":3,"description":"Week format user for schedule","name":"week","property":"week","type":"enum","values":["5+2","6+1","7"]},{"access":3,"description":"Away preset temperature","name":"away_preset_temperature","property":"away_preset_temperature","type":"numeric","unit":"°C"},{"access":1,"description":"Link quality (signal strength)","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"TS0601_thermostat","supports_ota":true,"vendor":"TuYa"},"endpoints":{"1":{"bindings":[],"clusters":{"input":["genBasic","genGroups","genScenes","manuSpecificTuya"],"output":
[Added} Is this your thermostat? https://www.zigbee2mqtt.io/devices/TS06 ... ostat.html

Can you tell me what data you want to access? Temperature, Setpoint and Mode are supported.
Setpoint and Temperature are in degreees Celsius.
For Mode you can have heat, cool, heatcool, auto, fan-only, purifier, eco and dry. What is supported?
What is your "Frienly Name"?

Regards
Yes indeed thats my thermostat
The output i send is the mqtt output from mqtt analyzer on my iphone. Friendly name is “RadiatorGang”
I only need the temperature reading and setpoint.
I dont own a pc so cant use mqttexplorer

Code: Select all

 {"auto_lock":"MANUAL","away_mode":"OFF","away_preset_days":1,"away_preset_temperature":15,"battery_low":false,"boost_time":300,"child_lock":"UNLOCKED","comfort_temperature":20,"current_heating_setpoint":22,"eco_temperature":15,"force":"normal","holidays":[{"hour":6,"minute":0,"temperature":20},{"hour":8,"minute":0,"temperature":15},{"hour":11,"minute":30,"temperature":15},{"hour":12,"minute":30,"temperature":15},{"hour":17,"minute":30,"temperature":20},{"hour":22,"minute":0,"temperature":15}],"linkquality":84,"local_temperature":19,"local_temperature_calibration":-1,"max_temperature":35,"min_temperature":5,"position":100,"preset":"manual","system_mode":"auto","week":"5+2","window_detection":"OFF","window_detection_params":{"minutes":196,"temperature":125},"workdays":[{"hour":6,"minute":0,"temperature":20},{"hour":8,"minute":0,"temperature":15},{"hour":11,"minute":30,"temperature":15},{"hour":12,"minute":30,"temperature":15},{"hour":17,"minute":30,"temperature":20},{"hour":22,"minute":0,"temperature":15}]}
User avatar
FireWizard
Posts: 1887
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 »

hello @edwin1234,

I put your code in a Node Red "Inject" node and that gives me the following output in a "Debug" node.

Screenshot_Zigbee2MQTT_thermostat.png
Screenshot_Zigbee2MQTT_thermostat.png (37.92 KiB) Viewed 2595 times
I assumed that the topic in this case is : zigbee2mqtt/RadiatorGang/get.
In the documentation of this unit I find:
Climate #

This climate device supports the following features: current_heating_setpoint, local_temperature, system_mode, running_state, local_temperature_calibration, away_mode, preset.

current_heating_setpoint: Temperature setpoint. To control publish a message to topic zigbee2mqtt/FRIENDLY_NAME/set with payload {"current_heating_setpoint": VALUE} where VALUE is the °C between 5 and 35. To read send a message to zigbee2mqtt/FRIENDLY_NAME/get with payload {"current_heating_setpoint": ""}.
local_temperature: Current temperature measured on the device (in °C). To read send a message to zigbee2mqtt/FRIENDLY_NAME/get with payload {"local_temperature": ""}.
system_mode: Mode of this device. To control publish a message to topic zigbee2mqtt/FRIENDLY_NAME/set with payload {"system_mode": VALUE} where VALUE is one of: heat, auto, off. To read send a message to zigbee2mqtt/FRIENDLY_NAME/get with payload {"system_mode": ""}.
I'm not sure, how you get the above message published, as the documentation suggest that for every value I want to read, I need to send a message to topic zigbee2mqtt/FRIENDLY_NAME/getand a payload of {"current_heating_setpoint": ""}, resp. {"local_temperature": ""}, resp. {"system_mode": ""}

However I see that you have a complete message, what I prefer. What is the topic of that message?

I made a first flow as follows:

Screenshot_Zigbee2MQTT_thermostat2.png
Screenshot_Zigbee2MQTT_thermostat2.png (11.54 KiB) Viewed 2595 times
If your topic is different, you may want to modify the topic in the MQTT Input node.Do not forget to configure your own MQTT server, which is currently set to 'localhost'.

Please find the complete flow below:

Code: Select all

[{"id":"758cd1dd.afc4c","type":"tab","label":"Test Zigbee2MQTT Tuya Thermostat","disabled":false,"info":""},{"id":"e6ce71c0.0d18d8","type":"inject","z":"758cd1dd.afc4c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"zigbee2mqtt/RadiatorGang/get","payload":" {\"auto_lock\":\"MANUAL\",\"away_mode\":\"OFF\",\"away_preset_days\":1,\"away_preset_temperature\":15,\"battery_low\":false,\"boost_time\":300,\"child_lock\":\"UNLOCKED\",\"comfort_temperature\":20,\"current_heating_setpoint\":22,\"eco_temperature\":15,\"force\":\"normal\",\"holidays\":[{\"hour\":6,\"minute\":0,\"temperature\":20},{\"hour\":8,\"minute\":0,\"temperature\":15},{\"hour\":11,\"minute\":30,\"temperature\":15},{\"hour\":12,\"minute\":30,\"temperature\":15},{\"hour\":17,\"minute\":30,\"temperature\":20},{\"hour\":22,\"minute\":0,\"temperature\":15}],\"linkquality\":84,\"local_temperature\":19,\"local_temperature_calibration\":-1,\"max_temperature\":35,\"min_temperature\":5,\"position\":100,\"preset\":\"manual\",\"system_mode\":\"auto\",\"week\":\"5+2\",\"window_detection\":\"OFF\",\"window_detection_params\":{\"minutes\":196,\"temperature\":125},\"workdays\":[{\"hour\":6,\"minute\":0,\"temperature\":20},{\"hour\":8,\"minute\":0,\"temperature\":15},{\"hour\":11,\"minute\":30,\"temperature\":15},{\"hour\":12,\"minute\":30,\"temperature\":15},{\"hour\":17,\"minute\":30,\"temperature\":20},{\"hour\":22,\"minute\":0,\"temperature\":15}]}","payloadType":"json","x":210,"y":80,"wires":[["e0045a59.0ea4c"]]},{"id":"3aa46e6b.6dc2da","type":"function","z":"758cd1dd.afc4c","name":"Function In Thermostaat","func":"msg.payload = {\n    setpoint : msg.payload.current_heating_setpoint,\n    temperature : msg.payload.local_temperature,\n    mode : msg.payload.system_mode\n};\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":410,"y":140,"wires":[["b2fc0b15.d933"]]},{"id":"feb24a85.ce41d8","type":"function","z":"758cd1dd.afc4c","name":"Function Out Thermostaat","func":"var msg1 = {};\nvar msg2 = {};\n\nmsg1.topic = \"zigbee2mqtt/RadiatorGang/set\";\nmsg1.payload = {\n    \"current_heating_setpoint\" : msg.payload.setpoint\n}\n\nmsg2.topic = \"zigbee2mqtt/RadiatorGang/set\";\nmsg2.payload = {\n    \"mode\" : msg.payload.mode\n}\n\nreturn [[msg1,msg2]];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":960,"y":140,"wires":[["15cf31be.856ea6"]]},{"id":"e0045a59.0ea4c","type":"mqtt out","z":"758cd1dd.afc4c","name":"Out","topic":"","qos":"","retain":"","broker":"f9f13036.e28b58","x":370,"y":80,"wires":[]},{"id":"4bb52373.7cc4ac","type":"mqtt in","z":"758cd1dd.afc4c","name":"In","topic":"zigbee2mqtt/RadiatorGang/get","qos":"0","datatype":"json","broker":"f9f13036.e28b58","x":190,"y":140,"wires":[["3aa46e6b.6dc2da"]]},{"id":"b2fc0b15.d933","type":"nora-thermostat","z":"758cd1dd.afc4c","devicename":"Thermostaat","roomhint":"Gang","name":"Radiator Thermostaat","modes":"off,on,auto","unit":"C","topic":"","passthru":false,"commandOnly":false,"queryOnly":false,"bufferRangeCelsius":"2","nora":"6f52ea33.833a2c","x":680,"y":140,"wires":[["feb24a85.ce41d8"]]},{"id":"15cf31be.856ea6","type":"mqtt out","z":"758cd1dd.afc4c","name":"Out","topic":"","qos":"","retain":"","broker":"f9f13036.e28b58","x":1190,"y":140,"wires":[]},{"id":"f9f13036.e28b58","type":"mqtt-broker","name":"localhost","broker":"127.0.0.1","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":""},{"id":"6f52ea33.833a2c","type":"nora-config","d":true,"name":"Nora Config","group":"Mendelssohn92","notify":false}]
Of course you have to configure NORA yourself.

Let me know what the result is.

Regards
edwin1234
Posts: 287
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 »

Thanks for your support,
I will try it out as soon as possible.
edwin1234
Posts: 287
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 »

Hi firewizard,
The flow is connected in node red but the thermostat does not show in google home
I did a search on nora new devices but nothing found.
User avatar
FireWizard
Posts: 1887
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 »

hello @edwin1234,

You wrote:
the thermostat does not show in google home
I did a search on nora new devices but nothing found.
This has no relation with the provided flow, but probably the Nora configuration.

Question: Do you have more devices connected to Nora and, if so, do they work?

Even without any nodes connected to, either input or output, you should see that the Node is connected.

It should show:

Screenshot_Nora Thermostat.png
Screenshot_Nora Thermostat.png (4.89 KiB) Viewed 2579 times
- a green dot with the text "connected"
- between the brackets, you will see the mode (auto), the temperature (22.1) and the set-point (22)

You should first realize this connection, before the other nodes might do something.

Regards
edwin1234
Posts: 287
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 »

@ firewizzard

I have some light devices working with nora in google home,
The thermostat in my flow does not show connected like in your picture.
When i set temperature higher in domoticz the flow is:

Code: Select all

 {"current_heating_setpoint": 21.0}
From topic zigbee2mqtt/RadiatorGang/set

And i get back thermostat topic zigbee2mqtt/RadiatorGang

Code: Select all

 {"auto_lock":"MANUAL","away_mode":"OFF","away_preset_days":1,"away_preset_temperature":15,"battery_low":false,"boost_time":300,"child_lock":"UNLOCKED","comfort_temperature":20,"current_heating_setpoint":21,"eco_temperature":15,"force":"normal","holidays":[{"hour":6,"minute":0,"temperature":20},{"hour":8,"minute":0,"temperature":15},{"hour":11,"minute":30,"temperature":15},{"hour":12,"minute":30,"temperature":15},{"hour":17,"minute":30,"temperature":20},{"hour":22,"minute":0,"temperature":15}],"linkquality":84,"local_temperature":16,"local_temperature_calibration":-1,"max_temperature":35,"min_temperature":5,"position":100,"preset":"manual","system_mode":"auto","week":"5+2","window_detection":"OFF","window_detection_params":{"minutes":196,"temperature":125},"workdays":[{"hour":6,"minute":0,"temperature":20},{"hour":8,"minute":0,"temperature":15},{"hour":11,"minute":30,"temperature":15},{"hour":12,"minute":30,"temperature":15},{"hour":17,"minute":30,"temperature":20},{"hour":22,"minute":0,"temperature":15}]}
I added a debug node and i get no messages, but if i change zigbee2mqtt/RadiaterGang/get to zigbee2mqtt/RadiatorGang and change temperature on the thermostat itself i get the above output
User avatar
FireWizard
Posts: 1887
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 »

Hello Edwin (@edwin1234),

I suggest we continue here instead of the Node Red forum.

Now you should have communication with Google Home and your Nora Thermostat node should show "connected" and a "mode", "temperature" and "setpoint".

You said:
I only need the temperature reading and setpoint.
I suggest you also use the mode, as indicated in the picture in my post, dated 08 Mar 2021, 22:11.

You should realize your topology now, as you have (at least) 3 devices, which will be able to control the temperature setpoint.

1.
Your (intelligent) thermostat, providing a lot of information through Zigbee2MQTT.
We will use "current_heating_setpoint, local_temperature and system_mode.
Al this data is send to Domoticz using the Zigbee2MQTT Domoticz plugin and does control a "Thermostat" device in Domoticz.
This data is published under the topic: zigbee2mqtt/RadiatorGang/get and not: zigbee2mqtt/RadiatorGang. Correct?

2.
The Domoticz Setpoint device, which will sent its Setpoint to the MQTT broker, using Zigbee2MQTT Domoticz plugin.
This data is published under the topic:zigbee2mqtt/RadiatorGang/set

I'm not sure if this data is also published under domoticz/out

This Domoticz device does not report any Temperature (it has no data). You can add an additional temperature, but that is not recommended as the Room Temperature should be controlled by the Boiler Thermostat and so be compared to the Temperature device in your Thermostat.
Also the Mode is not available, but can easily be set in Domoticz by using a "Selector" Switch.

3. The last device to control the Setpoint is Google Home, either by Voice commands or by your Android/IOS app
(or on the display of a Google Home Hub).

The Nora Thermostat node needs the following INPUT:

mode - string. Thermostat mode, one from the selected available modes;
setpoint - number. Setpoint temperature in degrees celsius; (if mode is not 'heatcool')
temperature - number. Ambient temperature in degrees celsius;
Optional if you have a "humidity" sensor: humidity - number. Ambient relative humidity (0 - 100);

The Nora Thermostat node supplies the following OUTPUT:

mode - string. Thermostat mode. 'on' should set the thermostat to one of the previous working modes (heat/cool).
setpoint - number. Setpoint temperature in degrees celsius; (if mode is not 'heatcool')

Be aware that a change in one of the 3 devices should update the other two devices.

Let us look.

1. Change of the Setpoint and the Mode in your intelligent Thermostat will update your Domoticz Thermostat device. Correct?
But it will not update any "Mode" in Domoticz. Correct? Would it be possible? Will it be sent to the Domoticz Zigbee2MQTT plugin and what devices has the Domoticz Zigbee2MQTT plugin created?

2. Change of the Setpoint and the Mode in your intelligent Thermostat will not update Google Home. This shall be created.

3. Change of the Setpoint in your Domoticz Thermostat device will update your intelligent Thermostat. Correct?

4. Change of the Setpoint in your Domoticz Thermostat device will not update Google Home. This shall be created.

5. Change of the Setpoint and the Mode in Google Home will neither update your intelligent Thermostat or your Domoticz Thermostat device.
This shall be created.

Can you confirm this?

I will then create a flow that serves as INPUT to your Nora Thermostat node and another flow that serves as OUTPUT from your Nora Thermostat node.

Awaiting your response.

Regards
User avatar
FireWizard
Posts: 1887
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 »

Hello Edwin (@edwin1234),

I created already something that you can try.

Screenshot_Zigbee2MQTT_thermostat3.png
Screenshot_Zigbee2MQTT_thermostat3.png (21.28 KiB) Viewed 2526 times
The 2 MQTT input nodes are connected to zigbee2mqtt/RadiatorGang/get, resp zigbee2mqtt/RadiatorGang/set.
The first one picks up the data from your intelligent thermostat and the second one gets the data from Domoticz (via Domoticz Zigbee2MQTT plugin)

Connect the output of the Function Node to the input of your (working) Nora thermostat node.

Check the response of the Google Home (in the app of by voice) if you play with the thermostat and also the Domoticz thermostat device.

Let me know.

Complete flow below:

Code: Select all

[{"id":"3aa46e6b.6dc2da","type":"function","z":"758cd1dd.afc4c","name":"Function In Thermostaat","func":"switch (msg.topic) {\n\n    case \"zigbee2mqtt/RadiatorGang/get\":\n    msg.payload = {\n        setpoint : msg.payload[\"zigbee2mqtt/RadiatorGang/get\"].current_heating_setpoint,\n        temperature : msg.payload[\"zigbee2mqtt/RadiatorGang/get\"].local_temperature,\n        mode : msg.payload[\"zigbee2mqtt/RadiatorGang/get\"].system_mode\n}    \nbreak;\n\n    case \"zigbee2mqtt/RadiatorGang/set\":\n    msg.payload = {\n        setpoint : msg.payload[\"zigbee2mqtt/RadiatorGang/set\"].current_heating_setpoint,\n        temperature : msg.payload[\"zigbee2mqtt/RadiatorGang/get\"].current_heating_setpoint,\n        mode : msg.payload[\"zigbee2mqtt/RadiatorGang/get\"].system_mode\n}\nbreak;\n}\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":260,"wires":[["beb33df2.e9c3c"]]},{"id":"4bb52373.7cc4ac","type":"mqtt in","z":"758cd1dd.afc4c","name":"In","topic":"zigbee2mqtt/RadiatorGang/get","qos":"0","datatype":"json","broker":"f9f13036.e28b58","x":110,"y":220,"wires":[["f3270037.f36478"]]},{"id":"beb33df2.e9c3c","type":"debug","z":"758cd1dd.afc4c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":320,"wires":[]},{"id":"63018e6a.6e32f","type":"mqtt in","z":"758cd1dd.afc4c","name":"In","topic":"zigbee2mqtt/RadiatorGang/set","qos":"0","datatype":"json","broker":"f9f13036.e28b58","x":110,"y":300,"wires":[["f3270037.f36478"]]},{"id":"f3270037.f36478","type":"join","z":"758cd1dd.afc4c","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"1","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":270,"y":260,"wires":[["3aa46e6b.6dc2da"]]},{"id":"443a2da5.03d6fc","type":"comment","z":"758cd1dd.afc4c","name":"Connect Function Node to working Nora Thermostat node","info":"","x":870,"y":260,"wires":[]},{"id":"f9f13036.e28b58","type":"mqtt-broker","name":"localhost","broker":"127.0.0.1","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":""}]

Regards
User avatar
FireWizard
Posts: 1887
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 »

Hello Edwin (@edwin1234)

If you have finished your testing with the INPUT side of your Nora Thermostat node, can you try this at the OUTPUT side:

Screenshot_Zigbee2MQTT_thermostat4.png
Screenshot_Zigbee2MQTT_thermostat4.png (13.03 KiB) Viewed 2519 times
The output of the Nora Thermostat node should be connected to the input of the Function node and its output to the MQTT Output node.

Modify the following:

In the Function node:

- Replace in line 15 the IDX from 1234 to the IDX number of your Thermostat device in Domoticz.

- In the MQTT Output node.

- Configure your own MQTT sever (broker) Currently localhost

See below the complete flow:

Code: Select all

[{"id":"15cf31be.856ea6","type":"mqtt out","z":"758cd1dd.afc4c","name":"Out","topic":"","qos":"","retain":"","broker":"","x":1190,"y":140,"wires":[]},{"id":"30cb6afc.2acf56","type":"function","z":"758cd1dd.afc4c","name":"Function Out Thermostaat","func":"var msg1 = {};\nvar msg2 = {};\nvar setpoint = msg.payload.setpoint;\nvar mode = msg.payload.mode;\n\nmsg1.topic = \"zigbee2mqtt/RadiatorGang/set\";\nmsg1.payload = {\n    \"current_heating_setpoint\": setpoint,\n    \"system_mode\": mode\n}\n\nmsg2.topic = \"domoticz/in\";\nmsg2.payload = {\n    \"command\":\"udevice\",\n    \"idx\":1234,\n    \"svalue\":setpoint.toString()\n}\n\nreturn [[msg1,msg2]];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":960,"y":140,"wires":[["c43c7def.a8ef78"]]},{"id":"c43c7def.a8ef78","type":"debug","z":"758cd1dd.afc4c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1210,"y":100,"wires":[]}]
Let me know the result.

Regards
edwin1234
Posts: 287
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 »

Hi firewizzard
I will ,thank you.
edwin1234
Posts: 287
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 »

Hi firewizard,

I get an error on function in thermostat when i change the temperature in domoticz.
The error is : type error can not read property
Curent heating setpoin of undefinded
User avatar
FireWizard
Posts: 1887
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 »

Hello Edwin (@edwin1234 )

Can you connect a "Debug" node to the output of the "Join" node and send a screenshot of what you see, if you operate the Domoticz thermostat?

What does happen if you operate your smart thermostat, which is connected to zigbee2mqtt?

Awaiting your response,

Regards
edwin1234
Posts: 287
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 »

when i change temperature in domoticz i get on the debug from join node:
17-3-2021 19:52:32node: join debug
zigbee2mqtt/RadiatorGang/set : msg.payload : Object
object
zigbee2mqtt/RadiatorGang/set: object
current_heating_setpoint: 18

and on the function in thermostat":
function : (error)
"TypeError: Cannot read property 'current_heating_setpoint' of undefined"



when i change temperature on google home i get on the debug from join node:
zigbee2mqtt/RadiatorGang/set : msg.payload : Object
object
zigbee2mqtt/RadiatorGang/set: object
current_heating_setpoint: 21.455459594726562

and on fuction in thermostat:
function : (error)
"TypeError: Cannot read property 'current_heating_setpoint' of undefined"

and also:

domoticz/in : msg.payload : Object
object
command: "udevice"
idx: 728
svalue: "19.83027839660645"

and also the current temperature from the thermostat node stays on 25 degrees,only when i click on the inject node it get updated
the setpoint does change like it should. after a while the current temperature goes back to 25 degrees

if i change setpoint in googlehome, the setpoint in domoticz thermostat setpoint change also,but when i change the setpoint in domoticz nothing happens in google home.

if you have more questions let me know
thanks for your help
User avatar
FireWizard
Posts: 1887
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 »

Hello Edwin, (@edwin1234),

I found indeed something strange, but would it be possible to provide a screenshot of the Debug node, next time? The provided bunch of text is very difficult to analyze.

Can you change the contents of the Function node, called "Function in Thermostaat" into:

Code: Select all

switch (msg.topic) {

    case "zigbee2mqtt/RadiatorGang/get":
    msg.payload = {
        setpoint : msg.payload["zigbee2mqtt/RadiatorGang/get"].current_heating_setpoint,
        temperature : msg.payload["zigbee2mqtt/RadiatorGang/get"].local_temperature,
        mode : msg.payload["zigbee2mqtt/RadiatorGang/get"].system_mode
}    
break;

    case "zigbee2mqtt/RadiatorGang/set":
    msg.payload = {
        setpoint : msg.payload["zigbee2mqtt/RadiatorGang/set"].current_heating_setpoint,
        temperature : msg.payload["zigbee2mqtt/RadiatorGang/get"].local_temperature,
        mode : msg.payload["zigbee2mqtt/RadiatorGang/get"].system_mode
}
break;
}
return msg
Line 15 has changed from

Code: Select all

temperature : msg.payload["zigbee2mqtt/RadiatorGang/get"].current_heating_setpoint,
to

Code: Select all

temperature : msg.payload["zigbee2mqtt/RadiatorGang/get"].local_temperature,
Let us see, what the result is.

Regards
edwin1234
Posts: 287
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 »

hello fire wizard
i changed the content but
i still get an error when i change setpoint in domoticz and the temperature in google home doesnt change

18-3-2021 19:58:21node: Function In Thermostaat
function : (error)
"TypeError: Cannot read property 'local_temperature' of undefined"

i get the same error when i change setpoint from googlehome but the temperature in domoticz does change

18-3-2021 20:09:04node: Function In Thermostaat
function : (error)
"TypeError: Cannot read property 'local_temperature' of undefined"
User avatar
FireWizard
Posts: 1887
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 »

Hallo @edwin1234.

Can you check and confirm the questions, I asked in my post of 14 March, 18:56h.

Regards
edwin1234
Posts: 287
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 »

HI Firewizard
the question was
Check the response of the Google Home (in the app of by voice) if you play with the thermostat and also the Domoticz thermostat device.

the answer is if i change the setpoint of the thermostat then domoticz thermostat get updated
but google home thermostat doesnt.

regards
edwin1234
Posts: 287
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 »

Hello,firewizard
Here a (little bit late picture) of the error
When i change temperature in domoticz thermostat.
Image

And I figured out if i click on the inject node then the local temperature gets updated ,
And when i change temerature with google there are no errors , the local temperature in google home doesnt get updated automatically and thats why the errors are there , i think

Regards
Attachments
2F5B664C-6A44-4483-8AA6-5C2347926A6C.jpeg
2F5B664C-6A44-4483-8AA6-5C2347926A6C.jpeg (355.7 KiB) Viewed 2425 times
User avatar
FireWizard
Posts: 1887
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 »

Hello @edwin1234

Sorry for the somewhat delayed response. Some other issue to solve with beta 13092 and 13102.

This picture shows a lot more than all the previous posts.

Could you try to put this in the Function node, called "Function in Thermostaat":

Code: Select all

switch (msg.topic) {

    case "zigbee2mqtt/RadiatorGang/get":
    msg.payload = {
        setpoint : msg.payload["zigbee2mqtt/RadiatorGang/get"].current_heating_setpoint,
        temperature : msg.payload["zigbee2mqtt/RadiatorGang/get"].local_temperature,
        mode : msg.payload["zigbee2mqtt/RadiatorGang/get"].system_mode
}    
break;

    case "zigbee2mqtt/RadiatorGang/set":
    msg.payload = {
        setpoint : msg.payload["zigbee2mqtt/RadiatorGang/set"].current_heating_setpoint
}
break;
}
return msg
And report back, what happens if you test both from Domoticz to Google Home and from your thermostat to Google Home.
Also, what do you see in your Google Home app and the text below the Nora node, called "Radiator Thermostaat".

Regards
edwin1234
Posts: 287
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 »

Hi firewizard,

From domoticz to Google Nothing works in Google Home ,cant turn thermostat on in Google Home.and local temperature stays on 25 degrees
Domoticz to thermostat Valve works
From thermostat valve to Google Home doesnt work cant turn Google home thermostat on and the local temperature Stacy’s on 25 degrees
From thermostat valve to domoticz works.

The local temperature in node red stays on 25 degrees, but the set temperature charges like it should.



Where i try to turn on googlehome thermostat i get this:
Bu the thermostat in Google Home stays of.Image
Attachments
9E7EE3AF-EA19-45D1-AA4A-E5FC0B99A170.png
9E7EE3AF-EA19-45D1-AA4A-E5FC0B99A170.png (331.21 KiB) Viewed 2328 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest