Skip to content

Instantly share code, notes, and snippets.

@owen2
Last active September 12, 2021 04:05
Show Gist options
  • Save owen2/a9fae8b80cede42fcd2fd001f5968056 to your computer and use it in GitHub Desktop.
Save owen2/a9fae8b80cede42fcd2fd001f5968056 to your computer and use it in GitHub Desktop.
SyncLightswitch
blueprint:
name: Sync Detached Switch and LIFX
description: Keeps LIFX bulbs in sync with a detacted switch.
domain: automation
input:
switch_state:
name: Switch Sensor
description: A sensor representing the detached switch
selector:
entity:
domain: binary_sensor
target_light:
name: Lights
description: The LIFX lights to keep in sync.
selector:
target:
entity:
domain: light
trigger:
- platform: state
entity_id: !input switch_state
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: !input switch_state
state: '''On'''
sequence:
- service: light.turn_on
data:
transition: 3
brightness_pct: 80
kelvin: 4700
target: !input target_light
default:
- service: light.turn_off
data:
transition: 7
target: !input target_light
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment