Last active
July 28, 2019 17:51
-
-
Save oischinger/92b7600f46f372143d2bf58b080f3662 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
automation: | |
- id: 'mailbox_notification' | |
alias: You have mail | |
trigger: | |
- entity_id: sensor.0x00158d000313108a_action | |
platform: state | |
to: 'vibration' | |
condition: # Trying to prevent more than a single trigger every 20 seconds | |
- condition: template | |
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.mailbox_notification.attributes.last_triggered) | int > 20 }}' | |
- condition: template | |
value_template: '{{ states.automation.mailbox_notification.attributes.last_triggered != none }}' | |
action: | |
- service: mqtt.publish | |
data_template: | |
topic: "/postled/warning" | |
payload_template: "You have mail" | |
- service: notify.telegram_notifier | |
data: | |
message: You have mail |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment