Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.81 KB | None | 0 0
  1. fade_torchere:
  2.   alias: Fade Torchere lights
  3.   sequence:
  4.    # - condtion: state
  5.     #   entity_id: light.living_room_torchere_e27
  6.     #   state: 'on'
  7.     - condition: template
  8.       value_template: "{{ state_attr('light.living_room_torchere_e27','brightness') > 10 }}"
  9.     - service: light.turn_on
  10.       data_template:
  11.         entity_id: light.living_room_torchere_e27
  12.         brightness: >
  13.          {% set target = state_attr('light.living_room_torchere_e27','brightness') - 10 %}
  14.           {% if target < 10 %}
  15.             1    
  16.           {% else %}
  17.             {{ target }}
  18.           {% endif %}
  19.     - delay: 00:00:01
  20.     - service: script.fade_torchere_delay
  21.  
  22. fade_torchere_delay:
  23.   alias: Loop Fade Torchere
  24.   sequence:
  25.       - delay:
  26.           milliseconds: 1
  27.       - service: script.fade_torchere
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement