Advertisement
KirboWnz

Test scriptt

Jan 13th, 2023 (edited)
959
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.63 KB | None | 0 0
  1. alias: test
  2. mode: single
  3. variables:
  4.   entities:
  5.    - light.keittionvalo
  6.     - light.olohuone_kattolamppu
  7.   brightness_pct: 50
  8. sequence:
  9.   - repeat:
  10.       for_each: "{{ entities }}"
  11.       sequence:
  12.         if:
  13.           - condition: template
  14.             value_template: "{{ is_state(repeat.item, 'off') or state_attr(repeat.item, 'brightness')|int < (brightness_pct/100) * 255 }}"
  15.         then:
  16.           - service: light.turn_on
  17.             data:
  18.               transition: 2
  19.               brightness_pct: "{{ brightness_pct }}"
  20.               color_temp: 300
  21.             target:
  22.               entity_id: "{{ repeat.item }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement