RMAP thermostat

Using the RMAP standard http://www.raspibo.org/wiki/index.php/Gruppo_Meteo/RFC-rmap send command to relay when the temperature is bigger than a fixed value.

[{"id":"a692e12e.ad2d","type":"mqtt-broker","z":"74f9c2a.8229b3c","broker":"rmap.cc","port":"1883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":"15","cleansession":true,"willTopic":"","willQos":"0","willRetain":null,"willPayload":"","birthTopic":"","birthQos":"0","birthRetain":null,"birthPayload":""},{"id":"8c7723de.df2a5","type":"mqtt in","z":"74f9c2a.8229b3c","name":"rmap temperature","topic":"rmap/pat1/1131844,4449446/rmap/254,0,0/0,1,-,-/B12101","broker":"a692e12e.ad2d","x":99,"y":96,"wires":[["23d6c81c.d69788"]]},{"id":"9ee020a4.d2b048","type":"inject","z":"74f9c2a.8229b3c","name":"toggle pin off","topic":"rpc/pat1/860719020206417/com","payload":"{\"jsonrpc\": \"2.0\", \"method\": \"togglepin\", \"params\": [{\"s\": false, \"n\": 4}], \"id\": 0}","payloadType":"json","repeat":"","crontab":"","once":false,"x":107,"y":163,"wires":[["b5d99590.f4668","76b7320f.654e4c"]]},{"id":"76b7320f.654e4c","type":"mqtt out","z":"74f9c2a.8229b3c","name":"jsonrpc","topic":"","qos":"0","retain":"false","broker":"a692e12e.ad2d","x":818,"y":165,"wires":[]},{"id":"86659d5c.72777","type":"inject","z":"74f9c2a.8229b3c","name":"toggle pin on","topic":"rpc/pat1/860719020206417/com","payload":"{\"jsonrpc\": \"2.0\", \"method\": \"togglepin\", \"params\": [{\"s\": true, \"n\": 4}], \"id\": 0}","payloadType":"json","repeat":"","crontab":"","once":false,"x":105,"y":226,"wires":[["b5d99590.f4668","76b7320f.654e4c"]]},{"id":"23d6c81c.d69788","type":"function","z":"74f9c2a.8229b3c","name":"termostato a 310K","func":"var newMsg = JSON.parse(msg.payload);\nvar temp=newMsg.v;\nif (temp < 31000) {\n    var payload= '{\"jsonrpc\":\"2.0\",\"method\":\"togglepin\", \"params\": [{\"s\": true, \"n\": 4}], \"id\": 0}';\n}else{\n    var payload= '{\"jsonrpc\":\"2.0\",\"method\":\"togglepin\", \"params\": [{\"s\": false, \"n\": 4}], \"id\": 0}';\n}\nJSON.parse(payload);\nmsg.payload=payload;\nmsg.topic='rpc/pat1/860719020206417/com';\nreturn msg;\n\n","outputs":1,"noerr":0,"x":318,"y":96,"wires":[["4961be.7e337e44"]]},{"id":"b5d99590.f4668","type":"debug","z":"74f9c2a.8229b3c","name":"","active":true,"console":"true","complete":"payload","x":825,"y":226,"wires":[]},{"id":"4961be.7e337e44","type":"deduplicate","z":"74f9c2a.8229b3c","name":"","expiry":"60","x":533,"y":96,"wires":[["76b7320f.654e4c","b5d99590.f4668"],[]]}]

Flow Info

Created 8 years ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • debug (x1)
  • function (x1)
  • inject (x2)
  • mqtt in (x1)
  • mqtt out (x1)
  • mqtt-broker (x1)
Other
  • deduplicate (x1)

Tags

  • rmap
  • relay
  • temperature
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option