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

Issue with using utility sensors to track daily use for different users (tariffs) #12

Open
quack3d opened this issue Oct 24, 2024 · 1 comment

Comments

@quack3d
Copy link

quack3d commented Oct 24, 2024

My previous attempt of getting daily statistics of the sensors didn't work 100 % when swapping between users. So with help on this thread on Discord (https://discord.com/channels/330944238910963714/1288491404896636982) I created utility sensors with one tariff for each user. The problem is that if integration is reloaded (or HA restarted) while treadmill is on it will add the previous step count to the daily sensor before continuing increasing. So if current step count is 1000 and daily step count is 2000, when I restart HA/integration the step count is still 1000 but daily step count is now 3000.

Any thoughts? The help on Discord had a theory that the sensor may have a weird startup behaviour: "e.g. if it returns 0 while waiting for an initial response from the treadmill even for an instant, then the utility meter will add the returned amount when it goes from 0-> restored value".

@quack3d
Copy link
Author

quack3d commented Oct 24, 2024

It seems it only happens when I reload the integration. Not when restarting HA. I suppose this could be an issue if BT connection is dropped and integration is reloaded. It has only happened once for me though. Steps etc stopped updating in HA. When I pushed a button I got a popup error and the integration reloaded.

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

1 participant