Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
NodeRED - Dynamic sensors for Home Assistant Apple Watch Buienradar + Buienalarm Complication
[{"id":"7a281822.950da8","type":"change","z":"7ce23c23.7ea124","name":"Get location data to 2 decimals","rules":[{"t":"set","p":"latitude","pt":"msg","to":"$round(data.attributes.latitude, 2)","tot":"jsonata"},{"t":"set","p":"longitude","pt":"msg","to":"$round(data.attributes.longitude, 2)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":100,"wires":[["f2faa1b4.b7939"]]},{"id":"a080c47a.c59908","type":"http request","z":"7ce23c23.7ea124","name":"Get Buienradar data","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://gpsgadget.buienradar.nl/data/raintext?lat={{{latitude}}}&lon={{{longitude}}}&c={{{random}}}","tls":"","persist":false,"proxy":"","authType":"","x":920,"y":100,"wires":[["882f36a5.86dfc8"]]},{"id":"882f36a5.86dfc8","type":"ha-entity","z":"7ce23c23.7ea124","name":"Buienradar sensor","server":"","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"NodeRed Rain Buienradar"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"","stateType":"date","attributes":[{"property":"data","value":"payload","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1290,"y":100,"wires":[[]]},{"id":"f2faa1b4.b7939","type":"random","z":"7ce23c23.7ea124","name":"Add random number","low":1,"high":"999999999999999","inte":"true","property":"random","x":700,"y":100,"wires":[["a080c47a.c59908"]]},{"id":"f42baf1e.07df","type":"poll-state","z":"7ce23c23.7ea124","name":"Get Guy's data every 3 minutes","server":"","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"3","updateIntervalUnits":"minutes","outputinitially":false,"outputonchanged":false,"entity_id":"person.guy","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":150,"y":100,"wires":[["7a281822.950da8","1d9cd395.ff023c"]]},{"id":"b035056e.17dc18","type":"http request","z":"7ce23c23.7ea124","name":"Get Buienalarm data","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://cdn-secure.buienalarm.nl/api/3.4/forecast.php?lat={{{latitude}}}&lon={{{longitude}}}&region=nl&unit=mm%2Fu&c={{{random}}}","tls":"","persist":false,"proxy":"","authType":"","x":920,"y":160,"wires":[["9c92573c.2f33f8"]]},{"id":"b142b1eb.0730c","type":"ha-entity","z":"7ce23c23.7ea124","name":"Buienalarm sensor","server":"","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"NodeRed Rain Buienalarm"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"","stateType":"date","attributes":[{"property":"data","value":"payload","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1290,"y":160,"wires":[[]]},{"id":"9c92573c.2f33f8","type":"json","z":"7ce23c23.7ea124","name":"Parse JSON","property":"payload","action":"","pretty":false,"x":1110,"y":160,"wires":[["b142b1eb.0730c"]]},{"id":"1d9cd395.ff023c","type":"change","z":"7ce23c23.7ea124","name":"Get location data to 3 decimals","rules":[{"t":"set","p":"latitude","pt":"msg","to":"$round(data.attributes.latitude, 3)","tot":"jsonata"},{"t":"set","p":"longitude","pt":"msg","to":"$round(data.attributes.longitude, 3)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":160,"wires":[["fa8601c9.4e8dc"]]},{"id":"fa8601c9.4e8dc","type":"random","z":"7ce23c23.7ea124","name":"Add random number","low":1,"high":"999999999999999","inte":"true","property":"random","x":700,"y":160,"wires":[["b035056e.17dc18"]]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment