I have been using an automation to check my apointments and put them in a input_text
with formating to use it in my markdown on my dashboard.
This has been working great for the last few months, but since yesterday, my markdown shows as No appointments
while the calendar show the appointments.
I have been trying to troubleshoot this, but when I manually run the list events in dev tools, all appointments show up, and when I add that in the dev tools with the used variable and use the code from the automation to format the events, the results are as they should be.
I looked into the automation trace and all seems to be running as intended and there has been no change made to either the automation or the calendars, so I am kinda clueless on why the input_text
is staying empty with the results of markdown showing there are no appointments
the automation (or at least, the relevant part, as it checks every hour so it removes the events that have passed):
if:
- condition: time
after: "00:00:00"
before: "01:00:00"
then:
- service: calendar.list_events
data:
duration:
hours: 24
minutes: 0
seconds: 0
response_variable: familiecal
target:
entity_id: calendar.home_assistant_all_day_excluded
- service: input_text.set_value
data_template:
value: >-
{% for event in familiecal.events %}<ha-icon
icon="mdi:calendar-heart-outline"></ha-icon> {{as_timestamp(event.start,
default=0) | timestamp_custom('%d/%m %H:%M') }} {{
event.summary}}{{'<br>'}} {% endfor %}
target:
entity_id: input_text.familielist
- service: calendar.list_events
data:
duration:
hours: 24
minutes: 0
seconds: 0
target:
entity_id: calendar.willemvermeylen_gmail_com
response_variable: WillemCal
- service: input_text.set_value
data_template:
value: >-
{% for event in WillemCal.events %}<ha-icon
icon="mdi:calendar-account-outline"></ha-icon>
{{as_timestamp(event.start, default=0) | timestamp_custom('%d/%m %H:%M')
}} {{ event.summary}}{{'<br>'}} {% endfor %}
target:
entity_id: input_text.willemlist
The dev tools try I did:
{% set familiecal = {
"events": [
{
"start": "2023-10-06T08:00:00+02:00",
"end": "2023-10-06T13:00:00+02:00",
"summary": "Samantha: belafspraak"
},
{
"start": "2023-10-06T14:00:00+02:00",
"end": "2023-10-06T15:00:00+02:00",
"summary": "Jaylah: start gesprek 14:00"
},
{
"start": "2023-10-06T16:15:00+02:00",
"end": "2023-10-06T17:00:00+02:00",
"summary": "Jaylah: zwemles 16:15-17:00",
}
]
}
%}
{% for event in familiecal.events %}<ha-icon
icon="mdi:calendar-heart-outline"></ha-icon> {{as_timestamp(event.start,
default=0) | timestamp_custom('%d/%m %H:%M') }} {{
event.summary}}{{'<br>'}} {% endfor %}
The results I got back from the dev tools:
<ha-icon
icon="mdi:calendar-heart-outline"></ha-icon> 06/10 08:00 Samantha: belafspraak<br> <ha-icon
icon="mdi:calendar-heart-outline"></ha-icon> 06/10 14:00 Jaylah: start gesprek 14:00<br> <ha-icon
icon="mdi:calendar-heart-outline"></ha-icon> 06/10 16:15 Jaylah: zwemles 16:15-17:00<br>
I tried doing this all in the service call to fully test it, but it seems the dev tools service for input_text.set_value
is not accepting the data_template
(or I am doing something wrong which is very likely )
service: input_text.set_value
data_template:
value: >-
{% set familiecal = {
"events": [
{
"start": "2023-10-06T08:00:00+02:00",
"end": "2023-10-06T13:00:00+02:00",
"summary": "Samantha: belafspraak"
},
{
"start": "2023-10-06T14:00:00+02:00",
"end": "2023-10-06T15:00:00+02:00",
"summary": "Jaylah: start gesprek 14:00"
},
{
"start": "2023-10-06T16:15:00+02:00",
"end": "2023-10-06T17:00:00+02:00",
"summary": "Jaylah: zwemles 16:15-17:00",
}
]
}
%}
{% for event in familiecal.events %}<ha-icon
icon="mdi:calendar-heart-outline"></ha-icon> {{as_timestamp(event.start,
default=0) | timestamp_custom('%d/%m %H:%M') }} {{
event.summary}}{{'<br>'}} {% endfor %}
target:
entity_id: input_text.familielist
The results I get there are the following error:
This service requires field value, which must be provided under data:
I am not sure why it stopped working and what I can do to test this in dev tools or troubleshoot this more to see why the automation is not filling the text_input
So any help would be nice!