Created
March 9, 2022 21:10
-
-
Save Ultrawipf/39399ed7aea20e060e448d3649c12766 to your computer and use it in GitHub Desktop.
Homeassistant blueprint for storing an alarm time in a date helper
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
blueprint: | |
name: Alarmhelper | |
description: Stores alarm time in helper | |
domain: automation | |
source_url: https://gist.github.com/Ultrawipf/39399ed7aea20e060e448d3649c12766 | |
input: | |
alarm: | |
name: Alarm timestamp sensor | |
description: 'Sensor with timestamp of next alarm with device_class: timestamp' | |
selector: | |
entity: | |
device_class: timestamp | |
helper: | |
name: Helper date | |
selector: | |
entity: | |
domain: input_datetime | |
offset: | |
name: Alarm offset | |
description: Offset from alarm | |
default: 0 | |
selector: | |
number: | |
min: -600 | |
max: 600 | |
unit_of_measurement: seconds | |
variables: | |
offset: !input 'offset' | |
sensor: !input 'alarm' | |
trigger: | |
platform: state | |
entity_id: !input alarm | |
action: | |
service: input_datetime.set_datetime | |
data: | |
timestamp: '{{as_timestamp(states(sensor)) + offset}}' | |
target: | |
entity_id: !input helper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment