Just to streamline the genius of those above for newbies like myself who puzzled through it.
Steps for ultimate TRV control:
For these instructions you must already have node-red installed and set up with an MQTT broker such as Mosquitto, and have the TRV set up over zwave
I am using Fibaro sensors that report to 1 decimal place, so I have to append an extra 0 to the string for the TRV to accept the external temperature. Check what your sensor accuracy is and remove the “+0” from the function accordingly.
- Add TRV and set the zwave config parameters: [9-112-0-8] Temperature Offset to -128 (listen for external sensor)
- Import the following flow to node-red:
[{"id":"c6f182ddaff5874a","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"af5cdb71a955fae5","type":"function","z":"c6f182ddaff5874a","name":"TRV parse: sensor temp","func":"var nodeid=9; // place actual id here\nvar sensortype=1;\nvar scale=2;\nvar value=msg.payload; // data from you sensor. if precesion not 2, you can reformat it\n\nvalue= value + \"0\";\nmsg.payload={\"args\":[{\"nodeId\":nodeid,\"commandClass\":0x31,\"endpoint\":0},\"sendReport\",[sensortype,scale,value]]};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":140,"wires":[["3245c9c1262e195f","be653fcff22bf8ea"]]},{"id":"3245c9c1262e195f","type":"mqtt out","z":"c6f182ddaff5874a","name":"Send to Zwave","topic":"zwave/_CLIENTS/ZWAVE_GATEWAY-Zwavejs2Mqtt/api/sendCommand/set","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"295ddfb433d52749","x":520,"y":140,"wires":[]},{"id":"7bb61958b0a90a9a","type":"debug","z":"c6f182ddaff5874a","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":290,"y":220,"wires":[]},{"id":"d7afb9c49d74ae2a","type":"server-state-changed","z":"c6f182ddaff5874a","name":"Study temp change","server":"1b37d822.bbb668","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.motion_sensor_air_temperature_4","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":90,"y":140,"wires":[["af5cdb71a955fae5","7bb61958b0a90a9a"]]},{"id":"f3f0911a76e762bd","type":"inject","z":"c6f182ddaff5874a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"25.0","payloadType":"str","x":80,"y":220,"wires":[["af5cdb71a955fae5"]]},{"id":"be653fcff22bf8ea","type":"debug","z":"c6f182ddaff5874a","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":490,"y":200,"wires":[]},{"id":"dbf52222c8ce31b0","type":"inject","z":"c6f182ddaff5874a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"10.0","payloadType":"str","x":90,"y":260,"wires":[["af5cdb71a955fae5"]]},{"id":"295ddfb433d52749","type":"mqtt-broker","name":"","broker":"mqtt://192.168.50.5","port":"1883","clientid":"Home Assist Mosquitto","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"1b37d822.bbb668","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
-
Change your sensor to the correct entity in the first blue node, change the nodeid in the function node to that of your TRV (zwave node id, left column in zwave2mqtt). Ensure your mqtt broker is selected in the MQTT node.
-
If the TRV setpoint is 20 then you should hear full valve travel if you inject the “test temperatures” via node-red to mimic extreme hot/cold levels.
The sensor you nominated should then feed values directly to the TRV.
(First ever post on any community board…)