Skip to content

Instantly share code, notes, and snippets.

@blacklight
Created October 17, 2019 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blacklight/b75b50bd5812d5d178315cf9a99fdc02 to your computer and use it in GitHub Desktop.
Save blacklight/b75b50bd5812d5d178315cf9a99fdc02 to your computer and use it in GitHub Desktop.
event.hook.OnHomePushData:
if:
type: platypush.message.event.pushbullet.PushbulletEvent
push_type: note
then:
- if ${body.startswith('HOME#') and body.split('HOME#')[1] == '1'}:
# Turn on the lights
- action: light.hue.on
# Say a welcome message
-
action: tts.say
args:
text: Welcome home, your_name
- if ${body.startswith('HOME#') and body.split('HOME#')[1] == '0'}:
# Turn off the lights
- action: light.hue.off
# Say a welcome message
-
action: tts.say
args:
text: your_name has left
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment