Skip to content

Instantly share code, notes, and snippets.

@Cavemanz
Last active May 27, 2023 09:59
Show Gist options
  • Save Cavemanz/b38e31969d15ed0a9ce1d560f8755997 to your computer and use it in GitHub Desktop.
Save Cavemanz/b38e31969d15ed0a9ce1d560f8755997 to your computer and use it in GitHub Desktop.
Pollen
# 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"
- platform: template
sensors:
pollen_salix_today:
friendly_name: Pollen - Salix i dag
value_template: '{{ state_attr("sensor.pollen_json", "forecast")[0].allergens[0].level_description }}'
pollen_salix_tomorrow:
friendly_name: Pollen - Salix i morgen
value_template: '{{ state_attr("sensor.pollen_json", "forecast")[1].allergens[0].level_description }}'
pollen_bjork_today:
friendly_name: Pollen - Bjørk i dag
value_template: '{{ state_attr("sensor.pollen_json", "forecast")[0].allergens[1].level_description }}'
pollen_bjork_tomorrow:
friendly_name: Pollen - Bjørk i morgen
value_template: '{{ state_attr("sensor.pollen_json", "forecast")[1].allergens[1].level_description }}'
pollen_or_today:
friendly_name: Pollen - Or i dag
value_template: '{{ state_attr("sensor.pollen_json", "forecast")[0].allergens[2].level_description }}'
pollen_or_tomorrow:
friendly_name: Pollen - Or i morgen
value_template: '{{ state_attr("sensor.pollen_json", "forecast")[1].allergens[2].level_description }}'
pollen_hassel_today:
friendly_name: Pollen - Hassel i dag
value_template: '{{ state_attr("sensor.pollen_json", "forecast")[0].allergens[3].level_description }}'
pollen_hassel_tomorrow:
friendly_name: Pollen - Hassel i morgen
value_template: '{{ state_attr("sensor.pollen_json", "forecast")[1].allergens[3].level_description }}'
pollen_gress_today:
friendly_name: Pollen - Gress i dag
value_template: '{{ state_attr("sensor.pollen_json", "forecast")[0].allergens[4].level_description }}'
pollen_gress_tomorrow:
friendly_name: Pollen - Gress i morgen
value_template: '{{ state_attr("sensor.pollen_json", "forecast")[1].allergens[4].level_description }}'
pollen_burot_today:
friendly_name: Pollen - Burot i dag
value_template: '{{ state_attr("sensor.pollen_json", "forecast")[0].allergens[5].level_description }}'
pollen_burot_tomorrow:
friendly_name: Pollen - Burot i morgen
value_template: '{{ state_attr("sensor.pollen_json", "forecast")[1].allergens[5].level_description }}'
# Lovelace Entity card for å presentere data
# Pollenvarsel i dag:
type: entity-filter
entities:
- entity: sensor.pollen_bjork_today
name: Bjørk
icon: 'mdi:tree'
- entity: sensor.pollen_burot_today
name: Burot
icon: 'mdi:tree'
- entity: sensor.pollen_gress_today
name: Gress
icon: 'mdi:tree'
- entity: sensor.pollen_hassel_today
name: Hassel
icon: 'mdi:tree'
- entity: sensor.pollen_or_today
name: Or
icon: 'mdi:tree'
- entity: sensor.pollen_salix_today
name: Salix
icon: 'mdi:tree'
state_filter:
- Low
- Medium
- High
card:
type: glance
title: Pollenvarsel i dag
# Pollenvarsel i morgen
type: entity-filter
entities:
- entity: sensor.pollen_bjork_tomorrow
name: Bjørk
icon: 'mdi:tree'
- entity: sensor.pollen_burot_tomorrow
name: Burot
icon: 'mdi:tree'
- entity: sensor.pollen_gress_tomorrow
name: Gress
icon: 'mdi:tree'
- entity: sensor.pollen_hassel_tomorrow
name: Hassel
icon: 'mdi:tree'
- entity: sensor.pollen_or_tomorrow
name: Or
icon: 'mdi:tree'
- entity: sensor.pollen_salix_tomorrow
name: Salix
icon: 'mdi:tree'
state_filter:
- Low
- Medium
- High
card:
type: glance
title: Pollenvarsel i morgen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment