Skip to content

Instantly share code, notes, and snippets.

@bessarabov
Created November 11, 2020 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bessarabov/a725e5b02900e1fe2d8d7e67e79fd7e9 to your computer and use it in GitHub Desktop.
Save bessarabov/a725e5b02900e1fe2d8d7e67e79fd7e9 to your computer and use it in GitHub Desktop.
input_boolean:
alarm:
input_datetime:
alarm:
has_date: false
has_time: true
automation:
- alias: set alarm
trigger:
platform: state
entity_id: input_datetime.alarm
action:
- service: input_boolean.turn_on
entity_id: input_boolean.alarm
- alias: run alarm
trigger:
platform: template
value_template: "{{ states('sensor.time') == states('input_datetime.alarm')[:5] }}"
condition:
- condition: state
entity_id: input_boolean.alarm
state: 'on'
action:
- service: light.turn_on
data:
entity_id: light.0x086bd7fffe03d84e_light
brightness: 255
transition: 600
- service: input_boolean.turn_off
entity_id: input_boolean.alarm
- title: alarm
path: alarm
icon: 'mdi:clock-time-seven-outline'
badges: []
cards:
- type: entities
show_header_toggle: false
entities:
- entity: sensor.time
- entity: input_boolean.alarm
- entity: input_datetime.alarm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment