Skip to content

Commit

Permalink
Add smart living room toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarb committed Mar 29, 2024
1 parent d2155d0 commit 52f5c24
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,23 @@ dim_without_turn_off:
entity_id: "{{ entities | join(', ') }}"
service: light.turn_on

smart_living_room_toggle:
alias: Turn on/off lights in a smart way
sequence:
- service: >
{% if is_state('light.living_room', 'on') %}
homeassistant.turn_off
{% else %}
homeassistant.turn_on
{% endif %}
target:
entity_id: >
{% if is_state('light.living_room', 'on') %}
light.living_room
{% else %}
['light.living_room_window_sill', 'light.cabinet']
{% endif %}
test_script:
alias: For testing purposes
sequence:
Expand Down

0 comments on commit 52f5c24

Please sign in to comment.