61 lines
1.7 KiB
YAML
61 lines
1.7 KiB
YAML
sensor:
|
|
- platform: darksky
|
|
api_key: !secret darksky_api_key
|
|
monitored_conditions:
|
|
- temperature
|
|
- summary
|
|
- hourly_summary
|
|
- daily_summary
|
|
automation:
|
|
- alias: Morning weather
|
|
action:
|
|
- data: {}
|
|
service: script.weather_report
|
|
condition:
|
|
- after: '6:00'
|
|
before: '12:00'
|
|
condition: time
|
|
id: '1521686674842'
|
|
trigger:
|
|
- entity_id: light.living_room
|
|
from: 'off'
|
|
platform: state
|
|
to: 'on'
|
|
script:
|
|
weather_report:
|
|
alias: Weather report
|
|
sequence:
|
|
- service: script.sonos_tts
|
|
data_template:
|
|
message: >-
|
|
{% if now().hour > 17 %}
|
|
Good evening!
|
|
{% elif now().hour > 12 %}
|
|
Good afternoon!
|
|
{% else %}
|
|
Good morning!
|
|
{% endif %}
|
|
{% if is_state('device_tracker.homeassistant_pixel', 'home') %}
|
|
Hi Correl!
|
|
{% endif %}
|
|
{% if is_state('device_tracker.stephaniesiphone', 'home') %}
|
|
Hi Stephanie!
|
|
{% endif %}
|
|
{% if is_state('device_tracker.PhilsGalaxyS7Edge', 'home') %}
|
|
Hi Phil!
|
|
{% endif %}
|
|
|
|
Today's forecast is
|
|
{{ states.sensor.dark_sky_daily_summary.state }}
|
|
Right now, the weather is
|
|
{{ states.sensor.dark_sky_summary.state}} at
|
|
{{ states.sensor.dark_sky_temperature.state }}
|
|
degrees,
|
|
{{ states.sensor.dark_sky_hourly_summary.state }}
|
|
|
|
{{ [ '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 }}
|
|
|