beside to receive the state from thermostat it might be also cool to send new state from domoticz device to WLAN thermostat. If I can do so, I might use changing state when a window is open/closed.
With your input I tried to create a flow to change the state of my selector 328.
192.xxx.xxx.xx:6219/json.htm?type=command¶m=switchlight&idx=328&switchcmd=Set%20Level&level=10 set my my selector to heat. When put 0 inside to off and with 30 to eco. So it's working from a browser.
Code: Select all
[{"id":"cf6d6748.c998e8","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"19cc2bd0.28650c","type":"debug","z":"cf6d6748.c998e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":810,"y":100,"wires":[]},{"id":"41ceb942.33e438","type":"mqtt in","z":"cf6d6748.c998e8","name":"State_WZ","topic":"thermostat_wz/stat/things/thermostat/properties","qos":"2","datatype":"json","broker":"ae93a774.7f606","x":80,"y":200,"wires":[["d467fedb.ba1f6","ff8d15b1.4dd928"]]},{"id":"d467fedb.ba1f6","type":"switch","z":"cf6d6748.c998e8","name":"stateheating","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"heating","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":200,"wires":[["25a5a97f.1ed63e"]]},{"id":"ff8d15b1.4dd928","type":"switch","z":"cf6d6748.c998e8","name":"stateoff","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":340,"y":240,"wires":[["d455412b.993f18"]]},{"id":"25a5a97f.1ed63e","type":"function","z":"cf6d6748.c998e8","name":"","func":"msg.payload = {\"command\":\"switchlight\",\"idx\":328,\"switchcmd\":\"Set%20Level\",\"level\":10};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":550,"y":200,"wires":[["19cc2bd0.28650c","843eb2af.e64d7"]]},{"id":"d455412b.993f18","type":"function","z":"cf6d6748.c998e8","name":"","func":"msg.payload = {\"command\":\"switchlight\",\"idx\":328,\"switchcmd\":\"Set20%Level\",\"level\":0};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":240,"wires":[["2d5b1341.e181bc","843eb2af.e64d7"]]},{"id":"2d5b1341.e181bc","type":"debug","z":"cf6d6748.c998e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":720,"y":320,"wires":[]},{"id":"843eb2af.e64d7","type":"mqtt out","z":"cf6d6748.c998e8","name":"domoticz/in","topic":"","qos":"","retain":"","broker":"ae93a774.7f606","x":820,"y":200,"wires":[]},{"id":"ae93a774.7f606","type":"mqtt-broker","name":"MQTTRpi","broker":"192.xxx.xxx.xx","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
As you can see my domoticz selector get the value according to the log, but in real no change on my selector. In addition I get this error message. I assume there are mistakes in my function nodes.