Skip to content

Instantly share code, notes, and snippets.

@jschlyter
Created December 17, 2018 07:22
Show Gist options
  • Save jschlyter/ac49bda4b8aff9f08180712ecf2cf435 to your computer and use it in GitHub Desktop.
Save jschlyter/ac49bda4b8aff9f08180712ecf2cf435 to your computer and use it in GitHub Desktop.
Twinkly scripts for Home Assistant
# https://xled-docs.readthedocs.io/en/latest/msqtt_api.html
twinkle:
alias: Twinkle
sequence:
- service: script.twinkle_effect
data_template:
id: "{{id}}"
effect: "{{effect1}}"
- delay:
seconds: 5
- service: script.twinkle_effect
data_template:
id: "{{id}}"
effect: "{{effect2}}"
twinkle_switch:
alias: Set twinkle switch
sequence:
- service: mqtt.publish
data_template:
topic: "xled/command/{{id}}"
payload: '{"command": "switch{{"on" if state else "off"}}"}'
twinkle_effect:
alias: Select twinkle effect
sequence:
- service: mqtt.publish
data_template:
topic: "xled/command/{{id}}"
payload: '{"command": "set{{effect}}"}'
twinkly_on:
alias: 'Twinkly on'
sequence:
- service: script.twinkle_switch
data:
id: MAC_OF_TWINKLY
state: true
twinkly_off:
alias: 'Twinkly off'
sequence:
- service: script.twinkle_switch
data:
id: MAC_OF_TWINKLY
state: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment