Thank you! Perfect what you said
But when I try to implement in my automation I get error.
- delay: 00:00:07
data_template:
message: >
{% set weekday = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'] %}{% set months = ["January", "February","March","April","May","June","July","Agosto","September","October","November","December"] %}{% set dt = strptime (states.calendar.feriados_no_brasil.attributes.start_time, "%Y-%m-%d %H:%M:%S") %}Próximo feriado {{ states.calendar.feriados_no_brasil.attributes.message }} cai {{ weekday[dt.weekday()] }}, em {{ dt.day }} de {{ months[dt.month-1] }}
entity_id: media_player.living_room_speaker
service: tts.google_say
Invalid config for [automation]: [data_template] is an invalid option for [automation]. Check: automation->data_template. (See /config/configuration.yaml, line 221). Please check the docs at https://home-assistant.io/components/automation/
My complete automation
- id: '1529625339241'
alias: Acordando
trigger:
- at: 08:40:00
platform: time
condition: []
action:
- data_template:
message: Bom dia! Voçê dormiu bem ?
entity_id: media_player.living_room_speaker
service: tts.google_say
- delay: 00:00:05
- data_template:
message: A temperatura em Duque de Caxias é de {{states('sensor.yweather_temperature')}}graus.
entity_id: media_player.living_room_speaker
service: tts.google_say
- delay: 00:00:07
- data_template:
message: Iniciei o preparo do seu café ás 8:11
entity_id: media_player.living_room_speaker
service: tts.google_say
- delay: 00:00:07
- condition: state
entity_id: calendar.contacts
state: 'off'
- data_template:
message: Hoje é {{ states.calendar.contacts.attributes.message}}
entity_id: media_player.living_room_speaker
service: tts.google_say
- delay: 00:00:07
- condition: state
entity_id: calendar.homeassistant
state: 'off'
- data_template:
message: 'Você me pediu para te lembrar hoje de: {{ states.calendar.homeassistant.attributes.message}}'
entity_id: media_player.living_room_speaker
service: tts.google_say
- delay: 00:00:07
data_template:
message: >
{% set weekday = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'] %}{% set months = ["January", "February","March","April","May","June","July","Agosto","September","October","November","December"] %}{% set dt = strptime (states.calendar.feriados_no_brasil.attributes.start_time, "%Y-%m-%d %H:%M:%S") %}Próximo feriado {{ states.calendar.feriados_no_brasil.attributes.message }} cai {{ weekday[dt.weekday()] }}, em {{ dt.day }} de {{ months[dt.month-1] }}
entity_id: media_player.living_room_speaker
service: tts.google_say