Template Sensor Not allowing HA to restart

Hi

Sorry for being a NOOB on this. I have looked through the forum and not managed to find a solution. I have two power meters, one measures the entire circuit and the other measures a specific device. These work perfectly, but I am double accounting the energy usage on the specific device. I would like to define another variable that I can use on the energy dashboard etc as the complete circuit - the specific device. I have created a template and it seems to work. But when I load this into my configuration.yaml it fails to restart home assistant

sensor:
  - platform: template
    sensors:
      Separated_Top_Floor_Sockets_Total_Consumption:
        friendly_name: Separated Top Floor Sockets total Consumption
        unit_of_measurement: kWh
        value_template: >-
          {{ ( states('sensor.shelly_shem_3_c45bbe7998ad_3_total_consumption') | float |round(1)) -  ( states('sensor.shelly_shem_bcff4dfcdc57_1_total_consumption') | float| round(1))}}

Any help would be most appreciated

cheers

Using the SSH add-on run

ha core check

and it’ll tell you the problem.

I’m going to guess that it’s because:

  1. you already have sensor: somewhere in configuration.yaml
  2. Separated_Top_Floor_Sockets_Total_Consumption has capitals in it, and it shouldn’t
1 Like

It looks like it was the capitols. Core check ‘try separated…’

Many thanks for your help

This works for my own ‘live energy’ dashboard, but it wont let me add this to the official energy dashboard. It seems to be looking for devices. Can I somehow configure this as a device? Cheers