Trying to do something very simple, set the tariff on a utility_meter within an automation, but is will not accept a data_template key within the automation.
- id: daily_tariff_updater
alias: "Update Tariffs on Daily Utility Meters"
initial_state: true
trigger:
- platform: state
entity_id: sensor.electricity_time
action:
- service: utility_meter.select_tariff
data_template:
entity_id:
- utility_meter.daily_solar
- utility_meter.daily_powerwall
- utility_meter.daily_home
tariff: >
{% if states.sensor.electricity_time.state == "Peak" %}
peak
{% elif states.sensor.electricity_time.state == "Off Peak" %}
offpeak
{% else %}
shoulder
{% endif %}
I’ve seen an example of this on the forum of this apparently working, but it just throws an error every time
Failed to call service utility_meter/select_tariff. extra keys not allowed @ data['data_template']
so, why can’t I use a data_template key in this instance ?