Good afternoon.
I’m trying to create a bunch of separate meters to get separate costs on different circuits. IE: How much is my water heater costing me, vs. my dryer, etc etc. I’m running into some annoyance on how utility meters defined in YAML are getting pulled into Home Assistant.
Here’s the definition for all power coming into the house:
um_hourly_el_grid:
name: "Hourly - Electric - Grid"
source: sensor.mains_123_1min
unique_id: 20230131113201
cycle: hourly
tariffs: sensor.et_pepco_r
And the tarriff is defined in a sensor. This is my electric company’s standard offer service, that separates summer and winter rates, and nothing else. I’m not on time of use billing (yet).
- platform: template
sensors:
et_pepco_r:
unique_id: '2023011901'
value_template: >
{% if now().month <= 3 and now().year <= 2023 %}
{% if now().month >=6 and now().month <= 10 %}
0.07592
{% else %}
0.03751
{% endif %}
{% else %}
{% if now().month >=6 and now().month <= 10 %}
0.07592
{% else %}
0.03948
{% endif %}
{% endif %}
unit_of_measurement: "$/kWh"
When HA loads the meter, though, I get a new utility meter sensor with a mangled name and entity ID.
Why is HA doing this!? I clearly told it what I wanted those items to be, and I can’t find this behavior documented anywhere.