Skip to content

Instantly share code, notes, and snippets.

View Cavemanz's full-sized avatar

Cavemanz

  • Norway
View GitHub Profile
# Pollenvarsel for Home Assistant - Oppdatert 29.04.2021 grunnet endret URL/struktur hos Pollenkontroll.no
- platform: rest
name: pollen_json
resource: https://pollenkontroll.no/api/middleware/pollen/b5bb4856-2117-433d-bf18-53504ef2f101
scan_interval: 21600
value_template: 'OK'
json_attributes:
- "forecast"
[{"id":"668152c.2638aac","type":"inject","z":"552174b1.4b349c","name":"","topic":"","payload":"[\"sensor.pollen_bjork\",\"sensor.pollen_burot\",\"sensor.pollen_gress\",\"sensor.pollen_hassel\",\"sensor.pollen_or\",\"sensor.pollen_salix\"]","payloadType":"json","repeat":"","crontab":"00 07 * * *","once":false,"onceDelay":0.1,"x":90,"y":40,"wires":[["125c1b35.ddea15"]]},{"id":"125c1b35.ddea15","type":"function","z":"552174b1.4b349c","name":"","func":"var newMsg = []\n\nfor (i=0;i<msg.payload.length;i++) {\n payload = { \"payload\": { \"entity_id\" : msg.payload[i] } } \n newMsg.push(payload)\n}\n\nnode.log([newMsg]);\nreturn [newMsg];","outputs":1,"noerr":0,"x":230,"y":40,"wires":[["7a3548b5.1fbaa8"]]},{"id":"7a3548b5.1fbaa8","type":"api-current-state","z":"552174b1.4b349c","name":"state","server":"73dec648.42a798","halt_if":"Ingen spredning","override_topic":false,"override_payload":true,"override_data":true,"entity_id":"","x":370,"y":40,"wires":[["401349fb.8ab2d8"]]},{"id":"a7ba8ddf.acefd","type":"api-c