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

Value of produced Power is not exported #82

Closed blacklopo closed 2 years ago

blacklopo commented 2 years ago

Hi!

I checked your code of soyosource_display.cpp and I have a tip for you.

// 11 2 0x00 0xCA

Line 209: ESP_LOGD(TAG, "Unknown (raw): %02X %02X", data[11], data[12]);

According Soyo web application this atribute is the generated Power:

  $("#dcdy").html(parseInt(sje.substr(8,4),16)/10 +" V");
  $("#dcdl").html(parseInt(sje.substr(12,4),16)/10 +" A");
    $("#acdy").html(parseInt(sje.substr(16,4),16) +" V");
    $("#pl").html(parseInt(sje.substr(20,2),16)+" HZ");
    **$("#gl").html(parseInt(sje.substr(22,4),16) +" W");**
     $("#jlfdl").html(parseInt(sje.substr(26,4),16)/10 +" KWH");
    $("#wd").html(parseInt(sje.substr(30,2),16)+" ℃");
    $("#fdzt").html(zt1);
    $("#gzms").html(gzms);
    $("#cwts").html(cwtsa);

I'm attaching source code for inspiration. Paul

PS: This is my first try in Github. I didn't know where to put it.

soyo-mqtt-redacted.txt

syssi commented 2 years ago

Good catch! I will extend the component to expose the identified value as sensor measurement.

blacklopo commented 2 years ago

I updated repository (twice), removed old soyosource-wifi-dongle device and added it again, but I still cannot see Output power entity. Any recommendation? Tnx.

syssi commented 2 years ago

Did you add the new sensor to your configuration YAML and reflashed the device (via OTA)?

blacklopo commented 2 years ago

Yes, I did. But I will try it once more, just to be sure. Maybe some cache problem.

syssi commented 2 years ago

I've rebased the restart-on-crossing-zero-method feature branch, so the output_power sensor is available there now too.

blacklopo commented 2 years ago

Maybe I'm cursed, but output_powersensor is still not available. New clone of repo, updated config, one other sensor renamed, ota update. Still 1 device, 21 entities, 1 important is missing. I tried change the branch in config , but same result. Any recommendation how to debug it? I can try another computer :-D. Or I can send you my config, and you can generate firmware for me. :-D

syssi commented 2 years ago

It's my fault. I did miss an important part. :-P

syssi commented 2 years ago

I've merged a fix. Please give it another try.

blacklopo commented 2 years ago

Super! It is OK. I can see output power. We can continue with overshooting. ;-)