Skip to content

Instantly share code, notes, and snippets.

@bessarabov
Created August 7, 2020 07:21
Show Gist options
  • Save bessarabov/1558907b86728066cb11c14390b3e2a6 to your computer and use it in GitHub Desktop.
Save bessarabov/1558907b86728066cb11c14390b3e2a6 to your computer and use it in GitHub Desktop.
input_number:
on_minutes:
min: 0
max: 10000000000
step: 1
mode: box
automation:
- alias: Record uf lamp work time
trigger:
platform: time_pattern
minutes: "/1"
condition:
condition: state
entity_id: switch.uf_lamp
state: 'on'
action:
service: input_number.set_value
data_template:
entity_id: input_number.on_minutes
value: "{{ states('input_number.on_minutes') | int + 1 }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment