3-phase meter - combine current consumption meters, Shelly 3EM

Hi all,
I’ve been struggling last night (for a way too long time) and this morning trying to get this sensor to work.

In developer tools, “Tempate” I’ve successfully got the template to work and show correct combined data from the three sensors

` value_template: "{{ (states('sensor.shelly_shem_3_e8db84d68c0c_1_current_consumption')|float + states('sensor.shelly_shem_3_e8db84d68c0c_2_current_consumption')|float + states('sensor.shelly_shem_3_e8db84d68c0c_3_current_consumption')|float)|round(3) }}"`

The thing is when I paste my code into configuration.yaml, directly under

sensor:

things go WRONG…



# utility meter
utility_meter:
  hd_lvp_- platform: mqtt
  state_topic: "CumulusMX/Interval"
  name: "VP2 wind gust 10"
  unique_id: "VP2 wind gust 10"
  icon: mdi:weather-windy
  value_template: "{{ value_json.wgust }}"

- platform: krisinformation
  name: "Krisinformation Örebro"
  county: "Örebro län"

- platform: template
  sensors:
    bv_energy_total:
      value_template: "{{ (states('sensor.shelly_shem_1_e8db84d68c0c_1_current_consumption')|float + states('sensor.shelly_shem_3_e8db84d68c0c_2_current_consumption')|float + states('sensor.shelly_shem_3_e8db84d68c0c_3_current_consumption')|float)|round(3) }}"
      entity_id:
       - sensor.shelly_shem_3_e8db84d68c0c_1_current_consumption
       - sensor.shelly_shem_3_e8db84d68c0c_2_current_consumption
       - sensor.shelly_shem_3_e8db84d68c0c_3_current_consumption
     friendly_name: 'Shelly BV Total Power'
     unit_of_measurement: 'W'


# utility meter
utility_meter:
  hd_lvp_daily_energy:
    source: sensor.hd_lvp_consumption
    cycle: daily


I have no clue of what is wrong, or where to paste the code otherwise (newbie, still learning! :wink:)
Can someone please help out?

Solved.

- platform: template
  sensors:
    energy_total:
      friendly_name: 'Total Energy'
      entity_id:
        - sensor.shelly_bv1_power
        - sensor.shelly_bv2_power
        - sensor.shelly_bv3_power
      value_template: "{{ (states('sensor.shelly_bv1_power')|float + states('sensor.shelly_bv2_power')|float + states('sensor.shelly_bv3_power')|float)|round(3) }}"
      unit_of_measurement: "W"
1 Like