Try:
- alias: "Window - Announce upstairs window open when about to rain"
trigger:
- platform: state
entity_id: group.upstairs_windows
to: 'on'
- platform: template
value_template: "{{ 'rain' in states.sensor.dark_sky_summary.state }}"
condition:
- condition: and
conditions:
- condition: state
entity_id: group.upstairs_windows
state: 'on'
- condition: template
value_template: "{{ 'rain' in states.sensor.dark_sky_summary.state }}"
- condition: time
after: '6:00:00'
before: '23:00:00'
action:
- service: notify.alexa_media
data_template:
target: >
{% set hr = now().hour %}
{% if hr < 10 %} group.all_echos_but_the_bedroom
{% elif hr < 21 %} group.all_echos
{% else } group.downstairs_echos
{% endif %}
data:
type: announce
message: "An Upstairs Window is currently open and it is about to rain."