How can i display my incoming energy monitor together with multiple single

Hi,

a question about the energy dashboard:
I have a Shelly Pro 3EM which measures the total energy consumption of my apartment.
On top, i have a multitude of Shelly Plugs which measure individual energy consumption of my devices.

How can i display in the energy dashboard my total energy (from Shelly Pro 3EM) together with my individual consumptions?

I’ve tried two ways

  1. tried to add the Shelly Pro 3EM as device. Problem: it increases of course the overall daily consumption and falsified the energy consumption of the apartment.

  2. tried to add the Shelly Pro 3Em as Solar Panel. The bar graph looks better (no Shelly Pro 3Em adding up). But still the dashboard shows a wrong total consumption.

Any tips?

Cheers.

Result of Option 1. “Stromkasten total active energy” is my Shelly Pro 3Em:

Create a template sensor that subtracts all your smart plug energies from your 3EM total energy. Do make sure you do this with the new template sensor format so you can add a device and state class. You should not use an availability template. Just add a default of zero for any unavailable source sensors.

Add this sensor to your dashboard along with all the individual smart plug sensors.

1 Like

Makes sense! Thanks a lot. :grinning:

1 Like

I came this far, thanks for all the hints @tom_l . As you told, i’ve had to use the new format. However i’m unsure how to check for availability of the sensor (without a availability tempalte)? Wasn’t there something new added in the last HA versions?

- sensor:
    - name: "Stromkasten Delta Energy"
      unit_of_measurement: "kWh"
      unique_id: stromkasten_delta_energy_43
      state_class: total_increasing
      device_class: energy
      state: >-
        {{
        (states('sensor.stromkasten_total_active_energy')|float 
        - states('sensor.steckdose_kuchendecke_zeile_energy')|float 
        - states('sensor.steckdose_server_energy')|float 
        - states('sensor.steckdose_waschmaschine_energy')|float 
        - states('sensor.steckdose_spulmaschine_energy')|float 
        - states('sensor.steckdose_kuhlschrank_energy')|float 
        - states('sensor.steckdose_schlafzimmer_fernseher_energy')|float 
        - states('sensor.steckdose_luftreiniger_energy')|float 
        - states('sensor.steckdose_spielekonsolen_energy')|float 
        - states('sensor.steckdose_fernseher_hifi_energy')|float 
        - states('sensor.schalter_kuchendecke_herd_energy')|float 
        - states('sensor.schalter_kuchentisch_energy')|float
        - states('sensor.schalter_badezimmerdecke_energy')|float 
        - states('sensor.schalter_wohnzimmerdecke_energy')|float)
        }}

Actually you should use an availability template, but just for the 3em sensor.

      state: >
        {{
        states('sensor.stromkasten_total_active_energy')|float(0)
        - states('sensor.steckdose_kuchendecke_zeile_energy')|float(0)
        - states('sensor.steckdose_server_energy')|float(0)
        - states('sensor.steckdose_waschmaschine_energy')|float(0)
        - states('sensor.steckdose_spulmaschine_energy')|float(0)
        - states('sensor.steckdose_kuhlschrank_energy')|float(0)
        - states('sensor.steckdose_schlafzimmer_fernseher_energy')|float(0)
        - states('sensor.steckdose_luftreiniger_energy')|float(0)
        - states('sensor.steckdose_spielekonsolen_energy')|float(0)
        - states('sensor.steckdose_fernseher_hifi_energy')|float(0)
        - states('sensor.schalter_kuchendecke_herd_energy')|float(0)
        - states('sensor.schalter_kuchentisch_energy')|float(0)
        - states('sensor.schalter_badezimmerdecke_energy')|float(0)
        - states('sensor.schalter_wohnzimmerdecke_energy')|float(0)
        }}
      availability: >
        {{
        states('sensor.stromkasten_total_active_energy')|is_number
        }}

This way you won’t get negative energy if your 3em sensor is unavailable. The default (0) for the other sensors will take care of them if any of them are unavailable.

1 Like