home-assistant/scripts.yaml

68 lines
2.5 KiB
YAML
Raw Normal View History

2018-03-23 01:01:46 +00:00
sonos_tts:
2018-03-25 02:46:03 +00:00
alias: "Sonos TTS"
2018-03-23 01:01:46 +00:00
sequence:
- service: media_player.sonos_snapshot
data_template:
entity_id: "{{ sonos_entity|default('media_player.den') }}"
- service: media_player.sonos_unjoin
data_template:
entity_id: "{{ sonos_entity|default('media_player.den') }}"
- service: media_player.volume_set
data_template:
entity_id: "{{ sonos_entity|default('media_player.den') }}"
volume_level: "{{ volume|default(0.5) }}"
- service: media_player.play_media
data:
entity_id: media_player.den
media_content_id: https://hass.phoenixinquis.is-a-geek.org/local/chime.ogg
media_content_type: music
- delay: '00:00:03'
- service: tts.amazon_polly_say
data_template:
entity_id: "{{ sonos_entity|default('media_player.den') }}"
message: "{{ message }}"
- delay: "{{ delay|default('00:00:00') }}"
- wait_template: "{{ is_state(sonos_entity|default('media_player.den'), 'playing') }}"
timeout: '00:00:05'
- wait_template: "{{ not is_state(sonos_entity|default('media_player.den'), 'playing') }}"
timeout: '00:02:00'
- service: media_player.sonos_restore
data_template:
entity_id: "{{ sonos_entity|default('media_player.den') }}"
2018-03-25 02:46:03 +00:00
weather_report:
alias: Weather report
2018-03-23 01:01:46 +00:00
sequence:
- service: script.sonos_tts
data_template:
message: >-
2018-03-25 02:46:03 +00:00
{% if now().hour > 17 %}
Good evening!
{% elif now().hour > 12 %}
Good afternoon!
{% else %}
Good morning!
{% endif %}
2018-03-23 01:01:46 +00:00
{% if is_state('device_tracker.homeassistant_pixel', 'home') %}
Hi Correl!
{% endif %}
{% if is_state('device_tracker.stephaniesiphone', 'home') %}
Hi Stephanie!
{% endif %}
2018-04-26 00:45:37 +00:00
{% if is_state('device_tracker.PhilsGalaxyS7Edge', 'home') %}
2018-04-25 11:28:51 +00:00
Hi Phil!
{% endif %}
2018-03-23 01:01:46 +00:00
Today's forecast is
{{ states.weather.dark_sky.attributes.daily_forecast_summary }}.
Right now, the weather is
{{ states.weather.dark_sky.state}} at
{{ states.weather.dark_sky.attributes.temperature }}
degrees,
{{ states.weather.dark_sky.attributes.hourly_forecast_summary }}.
{{ [ 'I hope you''re ready for an interesting day!',
'Get ready, today should be a fun one!',
'Get out there and kick some butt!',
] | random }}