Trying to follow this guide: https://community.home-assistant.io/t/quick-tldr-on-how-to-create-multi-tariff-energy-meters/585379/4
I have set up a couple Utility Meters each with two tariffs being "Peak" and "Off-Peak" based off daily energy from my Emporia Vue. That works fine, however it seems the automation I created in YAML from the above guide is like this:
alias: Electricity Tariff Automation
description: ""
mode: single
triggers:
- trigger: state
entity_id:
- sensor.electricity_tariff
not_to:
- unavailable
- unknown
conditions: []
actions:
- service: select.select_option
target:
entity_id:
# Add each of the sensors created from the energy Utility Meter helpers
- select.total_energy_meter
- select.hot_tub_energy_meter
data:
option: {{ trigger.to_state.state.strip('state: \"').strip('\"') if 'to_state' in trigger else 'Off-Peak' }}
but when I go to view it after saving, it is changed to this:
alias: Electricity Tariff Automation
description: ""
triggers:
- trigger: state
entity_id:
- sensor.electricity_tariff
not_to:
- unavailable
- unknown
conditions: []
actions:
- target:
entity_id:
- select.total_energy_meter
- select.hot_tub_energy_meter
data:
option:
"[object Object]": null
action: select.select_option
mode: single
and when it was supposed to run this morning, it did not switch the tariffs and this is what the trace timeline says:
Triggered by the state of sensor.electricity_tariff at January 30, 2025 at 6:00:00 AM
Perform action 'Select: Select' on Total Energy Meter and Hot Tub Energy Meter
Stopped because an error was encountered at January 30, 2025 at 6:00:00 AM (runtime: 0.00 seconds)
value should be a string for dictionary value @ data['option']
