Next hour rainy -> kiosk shows radar

This was quick and fun: when the forecast turns rainy for the next hour, let everyone know to grab an umbrella by popping up the weather radar on your kiosks.

Prereqs: a kiosk of some sort on which you want to popup a weather radar; browser mod; either a webpage_card of your local radar or what I’m using (the outstanding Weather Radar Card); a forecast that provides a JSON formatted forecast by hour (which I think is all of them).

Look at the attributes for your weather integration- it will have a list of current conditions and then probably “forecast:” with a JSON formatted list; in those bulleted items will probably be “condition:”.

Then:

- id: 'id_30_1_3'
  alias: "kiosk show weather radar"
  trigger:
    - platform: template
      value_template: >
        {% set x = state_attr('weather.knyc_hourly', 'forecast') %}
        {{ x[0].condition == 'rainy'}}
  condition:
    - condition: template
      value_template: '{{ states("input_select.system_mode") == "home" }}'
  action:
    - service: script.wake_kiosk
    - delay: '00:00:04'
    - service: browser_mod.navigate
      data:
        path: /kiosk-yaml/6
        browser_id:
          - bm_ca_kiosk
          - bm_sa_kiosk

You could use x[1] for the next hour and so forth.

Alternate method:

- id: 'id_30_1_3'
  alias: "kiosk show weather radar"
  trigger:
    - platform: state
      entity_id: light.bm_ca_kiosk_screen
      to: "on"
    - platform: state
      entity_id: light.bm_sa_kiosk_screen
      to: "on"
  condition:
    - condtion: template
      value_template: >
        {% set x = state_attr('weather.knyc_hourly', 'forecast') %}
        {{ x[0].precipitation_probability > 20 }}
    - condition: template
      value_template: '{{ states("input_select.system_mode") == "home" }}'
  action:
    - delay: '00:00:05'
    - service: browser_mod.navigate
      data:
        path: /kiosk-yaml/6
        browser_id:
          - bm_ca_kiosk
          - bm_sa_kiosk