Newbie needs help with electric meter

Hello,
tried several ways to get this tasmota smartmeter reader integrated in HA:

  • Hardware successfully configured and integrated in local Wifi
  • Mosqitto MQTT Broker successfully setup and tasmota sensor found
  • No values are displayed
  • Current snippet in configuration.yaml:
[...]
mqtt:
  sensor:
    - name: "Energy value"
      state_topic: "tasmota/discovery/CC50E3F45EBB/sensors"
      value_template: '{{ value_json["Power_curr"]["Today"] }}'
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: measurement
[...]

“Power_curr” is the name of the field exposed by the MQTT Explorer.

  • Checking the entity list this shows up with name “Energy Value”, entity sensor.energy_value, integration type sensor.

  • I’m able to add this entity to the energy dashboard, but no value shows up. Error message is “statistics_not_defined” and “entity not available”

How may I proceed here?
Any help is greatly appreciated.

Peter

The MQTT Explorer shows:

tasmota/discovery/CC50E3F45EBB/sensors

{
“sn”: {
“Time”: “2024-01-04T08:27:12”,
“SML”: {
“Total_in”: 565,
“Total_out”: 0,
“Power_curr”: 1900,
“Curr_summ”: 8.505,
“Volt_avg”: 229.453,
“Power_p1”: 1518,
“Power_p2”: 248,
“Power_p3”: 134,
“Curr_p1”: 6.767,
“Curr_p2”: 1.116,
“Curr_p3”: 0.622,
“Volt_p1”: 227.87,
“Volt_p2”: 231.33,
“Volt_p3”: 229.16,
“phase_angle_L2_L1”: 241,
“phase_angle_L3_L1”: 121,
“phase_angle_L1”: 352.7,
“phase_angle_L2”: 13.2,
“phase_angle_L3”: 340.6,
“Freq”: 50.1
}
},
“ver”: 1
}

How do I set the value of “Power_curr” for the entity?

value_template: '{{ value_json.Power_curr }}'

if you just want to read the value as a sensor

state_topic: 'tasmota/discovery/CC50E3F45EBB/sensors'
state_template: '{{ value_json.phase_angle_L2_L1 }}'

for write must be defined as number

state_topic: 'tasmota/discovery/CC50E3F45EBB/sensors'
state_template: '{{ value_json.phase_angle_L2_L1 }}'
command_topic: 'tasmota/discovery/CC50E3F45EBB/sensors'
command_template: '{"phase_angle_L2_L1": {{ value }} }'