MQTT, extract data from energy meter - json


I have a EV charger that sends MQTT from 3 energy meters via MQTT.

I have added one of the meter as below


  • platform: mqtt
    state_topic: “CTEK/000011295/mainMeter/em”
    name: “MQTT MainMeter”

The entity recieves:

{‘current’: [17.097000122070312, 1.2999999523162842, 1.0859999656677246], ‘energy’: 20839987, ‘frequency’: 49.900001525878906, ‘power’: 4262.7998046875, ‘timestamp’: ‘2021-09-07T18:21:59Z’, ‘voltage’: [226.10000610351562, 233.5, 233.89999389648438]}

How do I extract the diffent values using JSON?

The current value is L1, L2, L3 (yes a hybrid car is charging for the moment) :slight_smile:
Power is the total KWh used.

I would really like to import it into the energy tab.

By the way i’m a newbiee :slight_smile:

at work off top of head

- platform: mqtt
  name: "MQTT MainMeter"
  state_topic: "CTEK/000011295/mainMeter/em"
  value_template: "{{value_json['power']}}" #< should read 4262.7998046875
  unit_of_measurement: "KWh"

then to read the current stuff

- platform: mqtt
  name: "MainMeter Current 1st"
  state_topic: "CTEK/000011295/mainMeter/em"
  value_template: "{{value_json['current'][0]}}" #< should read the 17.097000
  unit_of_measurement: "KWh"
  value_template: "{{value_json['current'][1]}}" #< should read the 1.2999999523162842

just remeber I wrote this

found this I wrote sum time ago