Skip to content

Instantly share code, notes, and snippets.

@jschlyter
Created December 17, 2018 07:35
Show Gist options
  • Save jschlyter/2af596135d5c15e2eb6a9c52454608eb to your computer and use it in GitHub Desktop.
Save jschlyter/2af596135d5c15e2eb6a9c52454608eb to your computer and use it in GitHub Desktop.
Twinkly Home Assistent Switch
- platform: mqtt
name: twinkly
state_topic: "xled/appstatus/MAC_OF_TWINKLY"
command_topic: "xled/command/MAC_OF_TWINKLY"
available_topic: "xled/status/MAC_OF_TWINKLY"
payload_on: '{"command": "switchon"}'
payload_off: '{"command": "switchoff"}'
retain: true
value_template: |
{% if value_json.appstatus is defined %}
{{ "OFF" if value_json.appstatus=="off" else "ON" }}
{% elif value_json.status is defined %}
{{ value_json.status }}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment