Fairly new to HA but not new to home monitoring, etc. I’ve had HA set up for a couple months and am slowly adding to it.
HA Core; Docker; Home Assistant 2022.9.7; Frontend 20220907.2
A couple weeks ago I purchased a Shelly EM to monitor my home power consumption. I am in the US and have split phase power. Got the Shelly installed, everything works just fine. HA is able to find it when I add the integration and after an hour or so I get both phases added to the energy dashboard.
This works… fine, but I don’t like my power consumption showing up as two entities. I decide that it’s time to learn to make a template sensor to combine the two power and energy readings and use that in the energy dashboard. It just isn’t working though. I can use the developer tools to write/test the template and it gives the right answers.
However, when I put it into my yaml files I get nothing. No errors/configuration tests ok but the sensors do not show up.
I’m sure this is a syntax problem somewhere but I have no idea.
configuration.yaml
# Loads default set of integrations. Do not remove.
default_config:
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensor.yaml
http:
use_x_forwarded_for: true
trusted_proxies:
- <ip removed>
- <ip removed>
# Air Quality Index
sensor:
- platform: waqi
token: <token removed>
locations:
- <location removed>
frontend:
themes: !include_dir_merge_named themes
sensor.yaml
# Combined Shelly Power Sensors
- platform: template
sensor:
consumed_energy_total:
friendly_name: 'Total Energy Consumed'
device_class: energy
state: "{{ states('sensor.marked_leg_energy') | float + states('sensor.plain_leg_energy') | float }}"
unit_of_measurement: "kWh"
sensor:
consumed_power_total:
friendly_name: 'Total Power Consumed'
device_class: power
state: "{{ states('sensor.marked_leg_power') | float + states('sensor.plain_leg_power') | float }}"
unit_of_measurement: "W"