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

[TODO]: Async #150

Open
ArnoutD opened this issue Feb 11, 2024 · 10 comments
Open

[TODO]: Async #150

ArnoutD opened this issue Feb 11, 2024 · 10 comments
Assignees
Labels

Comments

@ArnoutD
Copy link

ArnoutD commented Feb 11, 2024

Todo

The Async branch is working stable at my end but that is a set of 1 Circle+ and 8 Circle -F types

image
image

I must say that I can only tell AFTER the first intial run where the caches have been filled up so you do not get a load of startup messages.
I have seen odd energy baviour at a point in time where I flushed the cache and woke up with this pattern:

image

but after restart it settled fine and keep running

Here are a few of my observations:

  1. The sawtooth in the above image was caused by the counter rollover and then missing the slot 4 download, that is gone

  2. The energy usage resets bases on server timezone (when my Ubuntu VM is in UTC it rolls on 01:00 in the graphs, CET rolls correctly, as the python-plugwise_usb does no home assistant maybe we should tell it on startup about the HA timezone to correct the last reset time to align in the graphs

image

vs

image

  1. When a node has nothing attached to monitor it will not show data:
    Power pulse counter for node 000D6F0000995D02 of value of -1, corrected to 0, when you attach a load everything comes back

  2. Strange thing is that the Circle+ ping times are a lot longer (80ms+) then the circles....(20ms)

my branch is till a bit to chatty on energy as I was monitoring the sawtooth but I cannot test any further as I do not have SED or other plugwise equipment.

I do not know how the relation is with my underlying zigbee network, maybe it behaves different in less stable networks. I can up the plugwuse_beta PARALLEL_UPDATES up to 8 without having issues. Also since i implemented one continious loop for reading and queing/writing I not need any sleeps and I do not have a lot of "network" issues in the normal run. When all nodes are queried for a lot of missing addresses there of course more congestion.

@ArnoutD
Copy link
Author

ArnoutD commented Feb 11, 2024

also we should rename to

power_usage_<mac>
energy_consumption_today_<mac>

for backward compatibiltiy

@brefra
Copy link

brefra commented Feb 13, 2024

I've just tagged as a prerelease version of the integration: https://github.com/plugwise/plugwise_usb-beta/releases/tag/v0.40.7a1
This version of the integration migrates the current unique ID of the entities, so no need to rename. It is also linked to the uploaded https://test.pypi.org/project/plugwise-usb/0.40.0a3/ backend version.

@ArnoutD
Copy link
Author

ArnoutD commented Feb 14, 2024

Installed 0.40.7.a1 in my production box 8+1 nodes took 6 minutes to initialise

all entities migrated correctly indeed, retaing history and settings

during initial energy collection got a few:
`
Logger: plugwise_usb.connection.receiver
Source: runner.py:188
First occurred: 07:51:04 (16 occurrences)
Last logged: 07:52:07

No subscriber to handle CircleEnergyLogsResponse, seq_id=b'A290' from 000D6F00009964FC
No subscriber to handle CircleEnergyLogsResponse, seq_id=b'A2F5' from 000D6F000099637F
No subscriber to handle CircleEnergyLogsResponse, seq_id=b'A306' from 000D6F0000995F4E
No subscriber to handle CirclePowerUsageResponse, seq_id=b'A304' from 000D6F0000995F4E
No subscriber to handle CircleEnergyLogsResponse, seq_id=b'A309' from 000D6F000098AB28
`

no 'warnings' after

@ArnoutD
Copy link
Author

ArnoutD commented Feb 15, 2024

0.40.7.a1
24h later
~250 No subscriber to handle ...
~112 No NodeFeature.POWER sensor

both unrelated.

All rotate nicely at 00:00 CET, some very low power usage have a small hickup after the reset ( but maybe just waits for a pulse to happen)

image

this particular one "lost" updating for some time now... will wait if it restores in the end (putting something in the microwave might help)

I think both warning sets are mitigated by my PR with the await instead of gather and the 5 resend instead of 20

@ArnoutD
Copy link
Author

ArnoutD commented Mar 10, 2024

installed [v0.40.0a6] through [v0.40.7a2]
warnings remain at 26 occurances of 'No subscriber to handle xxx after 10 retries' over various nodes over 24h of runtime

will activate INFO logging to see if there is a "logic" to it

still graph "issue" of the daily reset of low power using nodes, i doubt of it is solvable and due to the PULSES per Wh resolution:

image

@brefra
Copy link

brefra commented Mar 10, 2024

I do see some No subscriber to handle ... too. Haven't found the rootcause of it yet.
The graph issue seems to be some kind of HA behavior. It's only applicable when the (rounded) energy usage is 0., Found issue, it's due to https://github.com/plugwise/python-plugwise-usb/blob/async/plugwise_usb/nodes/helpers/counter.py#L293-L294. Guess we should guard for negative values only. Will check tonight

@ArnoutD
Copy link
Author

ArnoutD commented Mar 11, 2024

Got in a intereseting state today:
2024.03. [v0.40.0a6] through [v0.40.7a2] on 2024.3.0

image

longer time.... something " broke on 13:00 for this node but for other nodes it is different

image

reset to a1 but no change

my cirle+ is still going strong by my circles are bugging.,.,. I will move my cache and compare

removing the cache helped.... values seem better... diff shows that the energy_collection in the cache is sorted inverse... might explain why the things went stray at 13:00 sunday, that was the first restart after installing .a2

but allas, initial is better... but issues came back
image

@ArnoutD
Copy link
Author

ArnoutD commented Mar 12, 2024

Going back and forth to older version with or without removed cache doesn't solve it I will move my stick to my dev vm if I can replicate the issue there.

@brefra
Copy link

brefra commented Mar 12, 2024

Looks like during a "rollover" of the current pulse counter into an energy log record, at least one of the energy log records is not used in the recalculation. Debug logging during a rollover should reveal what's actually going wrong....

@ArnoutD
Copy link
Author

ArnoutD commented Mar 18, 2024

Tried to debug it yesterday.... saw some negative pulses but those dissappeared, moved the stick back to my prod env... issue gone.... got me baffled

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

5 participants