Pollental from DMI

This flow extracts the pollen count from dmi.dk and forward the data to HASSIO (Home Assistant).

[{"id":"d231f0c1.aaf4d","type":"inject","z":"f14045b3.952958","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":380,"y":1860,"wires":[["bb6d876a.c831a8"]]},{"id":"bb6d876a.c831a8","type":"http request","z":"f14045b3.952958","name":"dmi.dk","method":"GET","ret":"txt","paytoqs":false,"url":"https://www.dmi.dk/dmidk_byvejrWS/rest/texts/forecast/pollen/Danmark","tls":"","persist":false,"proxy":"","authType":"","x":390,"y":1900,"wires":[["c40d8bf1.c39c88"]]},{"id":"957ae5f8.b7d2b8","type":"debug","z":"f14045b3.952958","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":930,"y":1860,"wires":[]},{"id":"c40d8bf1.c39c88","type":"json","z":"f14045b3.952958","name":"","property":"payload","action":"","pretty":true,"x":570,"y":1860,"wires":[["b4699455.7f6db8"]]},{"id":"b4699455.7f6db8","type":"xml","z":"f14045b3.952958","name":"","property":"payload[0].products.text","attr":"","chr":"","x":570,"y":1900,"wires":[["67a56de0.781a94"]]},{"id":"67a56de0.781a94","type":"change","z":"f14045b3.952958","name":"pollental","rules":[{"t":"set","p":"reading_time","pt":"msg","to":"payload.products.text.pollen_info.file_info.date_DK.date_string[0] & \" kl. \" & payload.products.text.pollen_info.file_info.date_DK.time[0]\t","tot":"jsonata"},{"t":"set","p":"npl.kbh_birk","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='København'].readings.reading[name[0]='Birk'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.kbh_bynke","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='København'].readings.reading[name[0]='Bynke'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.kbh_el","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='København'].readings.reading[name[0]='El'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.kbh_elm","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='København'].readings.reading[name[0]='Elm'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.kbh_graes","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='København'].readings.reading[name[0]='Græs'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.kbh_hassel","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='København'].readings.reading[name[0]='Hassel'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.kbh_alternaria","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='København'].readings.reading[name[0]='Alternaria'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.kbh_cladosporium","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='København'].readings.reading[name[0]='Cladosporium'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.kbh_forecast","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='København'].forecast[0]","tot":"jsonata"},{"t":"set","p":"npl.viborg_birk","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='Viborg'].readings.reading[name[0]='Birk'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.viborg_bynke","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='Viborg'].readings.reading[name[0]='Bynke'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.viborg_el","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='Viborg'].readings.reading[name[0]='El'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.viborg_elm","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='Viborg'].readings.reading[name[0]='Elm'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.viborg_graes","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='Viborg'].readings.reading[name[0]='Græs'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.viborg_hassel","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='Viborg'].readings.reading[name[0]='Hassel'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.viborg_alternaria","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='Viborg'].readings.reading[name[0]='Alternaria'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.viborg_cladosporium","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='Viborg'].readings.reading[name[0]='Cladosporium'].value[0]","tot":"jsonata"},{"t":"set","p":"npl.viborg_forecast","pt":"msg","to":"payload.products.text.pollen_info.region[name[0]='Viborg'].forecast[0]","tot":"jsonata"},{"t":"delete","p":"payload","pt":"msg"},{"t":"move","p":"npl","pt":"msg","to":"payload.attributes","tot":"msg"},{"t":"set","p":"payload.state","pt":"msg","to":"reading_time","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":1860,"wires":[["957ae5f8.b7d2b8","a9fc3a2.e7f98c8"]]},{"id":"a9fc3a2.e7f98c8","type":"ha-entity","z":"f14045b3.952958","name":"pollental","server":"ccd4716a.0f514","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"pollental"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":760,"y":1900,"wires":[[]]},{"id":"ccd4716a.0f514","type":"server","z":"","name":"Home Assistant (Add-on)","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Flow Info

Created 5 years, 7 months ago
Updated 5 years, 5 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • debug (x1)
  • http request (x1)
  • inject (x1)
  • json (x1)
  • xml (x1)
Other
  • ha-entity (x1)
  • server (x1)

Tags

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