Skip to content

Instantly share code, notes, and snippets.

@theundefined
Created October 27, 2021 21:58
Show Gist options
  • Select an option

  • Save theundefined/6540dc349708f2231dc6faedb4b43062 to your computer and use it in GitHub Desktop.

Select an option

Save theundefined/6540dc349708f2231dc6faedb4b43062 to your computer and use it in GitHub Desktop.
alias: Światła - XXX
description: ''
trigger:
- platform: device
domain: mqtt
device_id: 1e500fe397f9f537bfdbc6e7242c3f28
type: action
subtype: 'on'
discovery_id: 0xb4e3f9fffebddc7e action_on
id: 'on'
- platform: device
domain: mqtt
device_id: 1e500fe397f9f537bfdbc6e7242c3f28
type: action
subtype: 'off'
discovery_id: 0xb4e3f9fffebddc7e action_off
id: 'off'
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: 'on'
sequence:
- choose:
- conditions:
- condition: and
conditions:
- condition: state
entity_id: light.xxx_light1
state: 'off'
- condition: state
entity_id: light.xxx_light2
state: 'off'
sequence:
- service: light.turn_on
target:
entity_id: light.xxx_light1
- conditions:
- condition: and
conditions:
- condition: state
entity_id: light.xxx_light1
state: 'on'
- condition: state
entity_id: light.xxx_light2
state: 'off'
sequence:
- service: light.turn_on
target:
entity_id: light.xxx_light2
- service: light.turn_off
target:
entity_id: light.xxx_light1
- conditions:
- condition: and
conditions:
- condition: state
entity_id: light.xxx_light1
state: 'off'
- condition: state
entity_id: light.xxx_light2
state: 'on'
sequence:
- service: light.turn_on
target:
entity_id: light.xxx_light1
default: []
- conditions:
- condition: trigger
id: 'off'
sequence:
- choose:
- conditions:
- condition: and
conditions:
- condition: state
entity_id: light.xxx_light1
state: 'on'
- condition: state
entity_id: light.xxx_light2
state: 'off'
sequence:
- service: light.turn_off
target:
entity_id: light.xxx_light1
- conditions:
- condition: and
conditions:
- condition: state
entity_id: light.xxx_light1
state: 'off'
- condition: state
entity_id: light.xxx_light2
state: 'on'
sequence:
- service: light.turn_on
target:
entity_id: light.xxx_light1
- service: light.turn_off
target:
entity_id: light.xxx_light2
- conditions:
- condition: and
conditions:
- condition: state
entity_id: light.xxx_light1
state: 'on'
- condition: state
entity_id: light.xxx_light2
state: 'on'
sequence:
- service: light.turn_off
target:
entity_id: light.xxx_light1
default: []
default: []
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment