Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POWR316D TM1621 kwh reporting #4030

Open
rubydesign opened this issue Jan 12, 2023 · 2 comments
Open

POWR316D TM1621 kwh reporting #4030

rubydesign opened this issue Jan 12, 2023 · 2 comments
Labels

Comments

@rubydesign
Copy link

The problem

The display reports wh when it says kWh

Which version of ESPHome has the issue?

2022.12.3

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

latest

What platform are you using?

ESP32

Board

nodemcu-32s

Component causing the issue

TM1621

Example YAML snippet

Yaml configuration from here https://www.esphome-devices.com/devices/Sonoff-POW-Elite-16a

specifically display yaml

display:
  platform: tm1621
  id: tm1621_display
  cs_pin: GPIO25
  data_pin: GPIO14
  read_pin: GPIO26
  write_pin: GPIO27
  lambda: |-
    if (id(page).state) {
      it.display_voltage(true);
      it.display_kwh(false);
      it.printf(0, "%.1f", id(v_sensor).state);
      it.printf(1, "%.1f", id(a_sensor).state);
    } else {  
      it.display_voltage(false);
      it.display_kwh(true);
      it.printf(0, "%.1f", id(wh_sensor).state);
      it.printf(1, "%.1f", id(w_sensor).state);
    }

Anything in the logs that might be useful for us?

It seems to me that the choice of wh is good for accuracy of reporting.
I am just a little worried that in wh the display will stop after only 10 kWh which is not a lot.
That is how i am reading this 

https://github.com/esphome/esphome/blob/dev/esphome/components/tm1621/tm1621.cpp#L112

but maybe i am wrong?
Maybe it is just a documentation issue and the printf should divide by 1000 ?

Additional information

Generally i am very happy to see that support for this is in, thanks!
And that esphome works so well, we are very grateful.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label May 13, 2023
@splitbrain
Copy link

Yeah I found that weird as well, but I think its a display problem only. The internal sensor counts Wh but the display shows KWh in the default firmware. I simply changed the line to this to have it display KWh with esphome as well:

it.printf(0, "%.1f", id(wh_sensor).state / 1000);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants