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

Cached values while offline #16

Open
poggenpower opened this issue Apr 4, 2022 · 1 comment
Open

Cached values while offline #16

poggenpower opened this issue Apr 4, 2022 · 1 comment

Comments

@poggenpower
Copy link
Contributor

When the power switch went off at night, because of solar power outage, rtcmon is responding with the last read values. See screenshot. Is this by intention? Is there a way to reset the values when offline?

Screenshot 2022-04-04 at 23 53 44

@svalouch
Copy link
Owner

svalouch commented May 5, 2022

That's mostly an oversight / TODO, as my inverter is online all the time unless the BMS fails I had not really a driver to implement it yet, sorry.

The plan is to either add a reset()-function to the dataclasses or re-instantiate them at the appropriate time, this would automatically make the metrics output empty as all values would be at the default None.

I guess the best way to do this is by making the DeviceManager go through its own startup sequence (again), which triggers (re)building its inventory so it knows what to query for. I thought about two triggers:

  1. When the connection has been lost for longer than a few seconds/minutes (configurable) to avoid the slow inventory rebuild when there's just a small a fluke on the network.
  2. When a signal such as SIGHUP is received, so if a firmware update is too fast one can trigger this without having to restart the whole thing. Though that's very low prio.

Rebuilding the inventory is important anyway, because changes to the setup such as (physically) changing the battery or solar generator configuration need to be detected, and they happen when the device is offline. So this is the perfect time to cause this.

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