I am working on some calendar automations with my weather entities to forecast upcoming trips. The template code works perfectly in the “Developer Tools” → Template with data supplied for the calendar entries.
For others struggling, I used “Developer Tools” → Services to get my calendar entries like this:
service: calendar.get_events
target:
entity_id: calendar.andolinos
data:
duration:
hours: 576
Then converted the Response using Transform YAML into JSON - Online YAML Tools
And went back to the “Developer Tools” → Template and copied to json data into the ‘xxx’ below.
{%- set scheduled_events = xxx -%}
My template file (I have been using a split configuration for months now) is as follows
- trigger:
- platform: time_pattern
minutes: /30
# hours: /24
- platform: homeassistant
event: start
- platform: event
event_type: event_template_reloaded
action:
- service: calendar.get_events
target:
entity_id: calendar.andolinos
data:
duration:
hours: 576
response_variable: scheduled_events
sensor:
- unique_id: andolino_events
attributes:
events: >
{{ scheduled_events['calendar.andolinos'].events }}
So, the issue is when I check the template (“Developer Tools” → YAML and “Check Configuration”), I get a Notification:
Invalid config
The following integrations and platforms could not be set up:
template (Show logs)
Please check your config and logs.
I checked my logfile (home-assistant.log) and Settings → System → Logs for the “Home Assistant Core”, “Supervisor”, and “Host”, but I cannot find any error messages. I also searched the forums, but have not found any solutions or potential solutions.
I even tried to add debug for templates in the configuration.log
logger:
default: critical
logs:
# critical, fatal, error, warning, warn, info, debug, notset
# log level for HA core
homeassistant.core: fatal
homeassistant.components.system_log.external: info
custom_components.pyscript: info
homeassistant.components.http.forwarded: debug
template: debug
So, how do I go about troubleshooting the source of the configuration error (and therefore my sensor is NOT created)? I am running Home Assistant in a VM with Addons and HACs, in case that is information someone needs to help me.
Thanks