Skip to content

Instantly share code, notes, and snippets.

@iantrich
Created December 20, 2019 20:25
Show Gist options
  • Save iantrich/5ef5fb9af102eb6ad3344473994c592d to your computer and use it in GitHub Desktop.
Save iantrich/5ef5fb9af102eb6ad3344473994c592d to your computer and use it in GitHub Desktop.
- id: '1576081655328'
alias: Grandfather Clock
trigger:
- minutes: '0'
platform: time_pattern
seconds: '0'
condition:
- after: 09:00:00
before: '23:00:00'
condition: time
- condition: template
value_template: "{% if is_state('media_player.office_speaker', 'playing') %}false{% else %}true{% endif %}"
- condition: or
conditions:
- condition: state
entity_id: person.chelsea
state: home
- condition: state
entity_id: person.ian
state: home
action:
- entity_id: media_player.office_speaker
service: media_player.turn_on
- data:
volume_level: 0.3
entity_id: media_player.office_speaker
service: media_player.volume_set
- data_template:
entity_id:
- media_player.office_speaker
media_content_id: http://192.168.1.35:8123/local/clock/GrandFatherChime{{now().strftime("%I")}}.wav
media_content_type: audio/mp4
service: media_player.play_media
- delay: 0:02
- service: media_player.media_stop
entity_id: media_player.office_speaker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment