Skip to content

Instantly share code, notes, and snippets.

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 jcallaghan/4bfd538f809e6818c9d27072aed9bc4e to your computer and use it in GitHub Desktop.
Save jcallaghan/4bfd538f809e6818c9d27072aed9bc4e to your computer and use it in GitHub Desktop.
See https://jcallaghan.com/2021/06/smart-dog-training-buttons via my blog for more information.
alias: 'Paw Button 1'
id: '5c631613-1253-4b21-a342-ddea791e0000'
initial_state: true
mode: single
trigger:
- platform: state
entity_id: binary_sensor.paw_button_1
to: 'on'
condition: []
action:
- variables:
notification: "🐶 {{ states('input_text.paw_button_1_notification') }} at {{ now().strftime('%H:%M:%S') }}."
tag: "poppy-back-garden"
tts_announcement: "{{ states('input_text.paw_button_1_tts') }}"
wait: "{{ states('input_number.paw_button_1_wait') | int }}"
- service: notify.html5_notification
data:
message: "{{ notification }}"
data:
tag: "{{ tag }}"
data:
tag: "{{ tag }}"
- service: notify.adults
data:
message: "{{ notification }}"
data:
tag: "{{ tag }}"
- service: script.sonos_say
data:
sonos_entity: media_player.sonos_kitchen, media_player.sonos_study, media_player.sonos_dining_room, media_player.sonos_living_room, media_player.sonos_move
master_sonos_entity: media_player.sonos_study
volume: "{{ states('input_number.paw_button_volume') | int / 100 }}"
message: "{{ tts_announcement }}"
language: 'fr-FR'
- delay:
minutes: "{{ wait }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment