Advertisement
dykandDK

HA - Input_boolean activate timer sensor

Aug 17th, 2020
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.83 KB | None | 0 0
  1. #----------------------------------------------------------
  2. # Local Date and time
  3. #----------------------------------------------------------
  4. sensor:
  5.   - platform: time_date
  6.     display_options:
  7.      - 'time'
  8.     scan_interval: 55   #Update once every 55 second
  9.  
  10.   #----------------------------------------------------------
  11.   # Washer 'on' timer sensor
  12.   #----------------------------------------------------------
  13.   - platform: template
  14.     sensors:
  15.       vaskemaskine_entity_on_time:
  16.         value_template: >-
  17.           {% if is_state("input_boolean.vaskemaskine_rengoering", "on") -%}
  18.           {{ (as_timestamp(now())- as_timestamp(states.input_boolean.vaskemaskine_rengoering.last_changed)) | timestamp_custom('%H:%M:%S', false) }}
  19.           {%- else -%}
  20.           0
  21.           {%- endif %}
  22.         entity_id: sensor.time
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement