Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save PaulHibbertMasterOfTheUniverse/99e4bf0bfece13ac2f660aa14417c979 to your computer and use it in GitHub Desktop.

Select an option

Save PaulHibbertMasterOfTheUniverse/99e4bf0bfece13ac2f660aa14417c979 to your computer and use it in GitHub Desktop.
YAML to automatically switch scenes based on position in a room
alias: eMotion Max - Room Modes by Zone
description: >-
Turns on Studio mode when entering Studio zone and Chillout mode when entering
Desk zone (with 20 second delay to prevent quick switches back to studio).
triggers:
- entity_id:
- binary_sensor.lnlinkha_e04b41016e260000000000009cac0000_4
to: "on"
id: studio_zone_entered
trigger: state
- entity_id:
- binary_sensor.lnlinkha_e04b41016e260000000000009cac0000_2
to: "on"
id: desk_zone_entered
trigger: state
- entity_id:
- binary_sensor.lnlinkha_e04b41016e260000000000009cac0000_2
to: "off"
id: desk_zone_left
trigger: state
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id: studio_zone_entered
sequence:
- target:
entity_id: scene.new_scene
data: {}
action: scene.turn_on
- conditions:
- condition: trigger
id: desk_zone_entered
sequence:
- delay: "00:00:20"
- condition: state
entity_id: binary_sensor.lnlinkha_e04b41016e260000000000009cac0000_2
state: "on"
- target:
entity_id: scene.chill_out_mode
data: {}
action: scene.turn_on
- conditions:
- condition: trigger
id: desk_zone_left
sequence:
- delay: "00:00:01"
mode: restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment