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

possible to add power usage? #10

Open
mathias172 opened this issue Aug 22, 2021 · 2 comments
Open

possible to add power usage? #10

mathias172 opened this issue Aug 22, 2021 · 2 comments

Comments

@mathias172
Copy link

Hi, is it possible, to add getting power usage info?

Here is some info. There is a function

float PropertiesFrame::get_power_usage() const {
  uint32_t power = 0;
  const uint8_t *ptr = this->pbuf_ + 28;
  for (uint32_t weight = 1;; weight *= 10, ptr--) {
    power += (*ptr % 16) * weight;
    weight *= 10;
    power += (*ptr / 16) * weight;
    if (weight == 100000)
      return static_cast<float>(power) * 0.1;
  }
}

And the request data:

const uint8_t PowerQueryFrame::INIT[] = {0xAA, 0x22, 0xAC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x41, 0x21,
                                         0x01, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x17, 0x6A};
@Links2004
Copy link
Owner

sure with some work its possible, need to play with my AC if its supports this command.
and then start to understand what the code tries to do, the calculation looks a bit strange a the first look.
if its not supported then I will need sample data. the more then better ;)

next question is how good the data is, but that something i can see easy since I have a smart meter connected to the ACs I use.

@mathias172
Copy link
Author

That would be awesome.

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

No branches or pull requests

2 participants