This does not compile when I try to reload the automations, the “check config” does not give any errors. The trigger and condition parts of the automation is a copy of another automation I have that is working, so I guess the error is in the service and entity templating.
You aren’t providing an else, so the service is empty as well as the entity_id. Also data_template is deprecated and no longer needed. You can just use data.
Lastly, you should be using choose for this, not a service template and data template.
Logger: homeassistant.config
Source: config.py:464
First occurred: 13:18:23 (1 occurrences)
Last logged: 13:18:23
Invalid config for [automation]: Expected a dictionary @ data['action'][0]['choose'][1]['conditions'][0]. Got None. (See /config/configuration.yaml, line 152)
The reference to row 152 in config makles no sence. That line has nothing to do this this automation or anything that the autmation is using.
It’s most likely your multi-line template on your conditions. You’re using the shorthand condition ability with templates and I’m not sure if it allows for the multiline character. Either way, it’s complaining about the first condition. Try it as a single line template or write it out as a full condition.
It is refering to the line 152 in configuration.yaml. On line 153 is the include for automations…
group:
sparsnas:
name: Energy Consumption
# view: no
icon: mdi:lightning-bolt-circle
entities:
- sensor.sparsnas_energy_consumption_momentary
- sensor.sparsnas_energy_consumption_over_time
- sensor.sparsnas_battery_remaining
- sensor.sparsnas_frequency_error
- sensor.kwh_today
- sensor.kwh_current_month <--------------- Line 152
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
#############################################################
# Housekeeing functions #
#############################################################
# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
# Optional, allows Home Assistant developers to focus on popular components.
# include_used_components: true
# Discover some devices automatically
discovery:
# Allows you to issue voice commands from the frontend in enabled browsers
conversation:
# Enables support for tracking state changes over time
history:
logbook: