syssi / esphome-soyosource-gtn-virtual-meter

ESPHome component to simulate the current clamp to control the Soyosource GTN1200 limiter
Apache License 2.0
78 stars 21 forks source link

use power demand value from mqtt with json format #164

Open card917 opened 8 months ago

card917 commented 8 months ago

Hi,

First I would like to thank you for your works, it work pretty well. my setup has 2 inverter and going to add another one but i found out that getting the power demand from ha via api is not reliable for me. Maybe my ha server is not powerful enough to push the value freguently therefor i would like to try the mqtt subscribe instead.

my mqtt topic is home/gridsensor/2/state which update every 10 second and response in json

{
    "voltage": 232.4,
    "current": 1.74,
    "consumption": 0.08
}

but i could not extract the value of consumption to use with powermeter. i tried with filter and lambda. but I'm not so good at coding so it doesn't success. could you help guide me?

syssi commented 3 months ago

Do you still looking for some lines of code to parse your json payload?