home-assistant-configuration/automation/weather.yaml

88 lines
2.0 KiB
YAML
Executable File

#
#
# Weather
#
############
- alias: Cloudy inside on
trigger:
- platform: time
at: '16:00:00'
condition:
- condition: numeric_state
entity_id: sensor.dark_sky_cloud_coverage
above: 70
- condition: state
entity_id: group.family
state: home
action:
- service: notify.ios_jeffreystonesiphone
data:
message: Cloudy, turning on LR Lamp
- alias: Cloudy porch on early
trigger:
- platform: sun
event: sunset
offset: -01:30:00
condition:
- condition: numeric_state
entity_id: sensor.dark_sky_cloud_coverage
above: 70
action:
- service: switch.turn_on
data:
entity_id: switch.front_porch_left
- service: switch.turn_on
data:
entity_id: switch.front_porch_right
- alias: Kill Audible Tornado Alarm
trigger:
- platform: state
entity_id: input_boolean.tornado_alarm
to: 'off'
action:
- service: script.chromecast_stop_media
- service: homeassistant.turn_off
entity_id: script.tornado_alarm
- alias: Sound Audible Tornado Alarm
trigger:
- platform: state
entity_id: input_boolean.tornado_alarm
to: "on"
action:
- service: homeassistant.turn_on
entity_id: script.tornado_alarm
- alias: Tornado Warning
trigger:
- platform: state
entity_id: sensor.tornado_warning
to: "active"
action:
- service: input_boolean.turn_on
entity_id: input_boolean.tornado_alarm
- alias: Wx Alert Notification
trigger:
- platform: state
entity_id: sensor.pws_alerts
action:
- service: script.wxalert_tile
- alias: "Weather Watch Tornado"
trigger:
- platform: state
entity_id: sensor.pws_alerts
condition:
condition: or
conditions:
- condition: template
value_template: '{{ states.sensor.pws_alerts.attributes.Description == "Tornado Watch" }}'
- condition: template
value_template: '{{ states.sensor.pws_alerts.attributes.Description_TOW == "Tornado Watch" }}'
action:
- service: input_boolean.turn_on
entity_id: input_boolean.tornado_watch