mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 10:30:14 -04:00
46 lines
968 B
YAML
46 lines
968 B
YAML
alias: New Mail
|
|
id: automation_new_mail
|
|
|
|
# Removed 'No Mail' trigger and action because mail should only be considered "checked" once the boolean has been turned off
|
|
|
|
trigger:
|
|
- id: new_mail
|
|
platform: numeric_state
|
|
entity_id: sensor.mail_usps_mail
|
|
above: 0
|
|
|
|
- id: no_mail
|
|
platform: numeric_state
|
|
entity_id: sensor.mail_usps_mail
|
|
below: 1
|
|
|
|
- platform: homeassistant
|
|
event: start
|
|
|
|
- platform: event
|
|
event_type: automation_reloaded
|
|
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: numeric_state
|
|
entity_id: sensor.mail_usps_mail
|
|
above: 0
|
|
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.incoming_mail
|
|
|
|
- conditions:
|
|
- condition: numeric_state
|
|
entity_id: sensor.mail_usps_mail
|
|
below: 1
|
|
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.incoming_mail
|
|
|
|
|