sshoecraft / jbdtool

JBD BMS Linux utility
BSD 3-Clause "New" or "Revised" License
46 stars 10 forks source link

Feature: Update interval should distinguish if there is flow or not #3

Closed foxriver76 closed 2 years ago

foxriver76 commented 3 years ago

It would be great if it would be possible to have not only the i option which allows to specify the general update interval but also to specific it more in detail, e.g -i 20/300 which would then request the BMS every 20 seconds if there is flow but only every 5 minutes if the battery is idle based on the latest received value. This would improve energy consumption a lot.

sshoecraft commented 3 years ago

I'm not sure I follow. Are you asking to compare the output with a previous collection and then if no change, don't send anything? I don't know if I've ever seen output that didnt change (even by .001) from the previous pull.

I'll give this some thought, however, it might require I compare based on a percentage change vs absolute values.

foxriver76 commented 3 years ago

Thanks for your response.

Basically yes, but not a collection. At least in my case I can say that I only need high frequent polling if the battery is not idle (so it is actively charging or discharging) if none of these is happening right now I don’t need high frequent polling.

So I would do the first poll on program Start, then check charge if 0 use the idle poll interval, else the regular poll interval. On next poll again check if idle and then use the appropriate interval.

Of course it can happen that I just have polled on idle state and one second later it will change to charge or discharge, but that’s the downside I would take.

sshoecraft commented 2 years ago

unfortunately, the only way to check charge level is to read from the device

the very minimum read would be to get the HWINFO from the dev and then other info later (cell voltages, etc), but honestly since I have to wake up the 8266 for that initial read all subsequent reads use very little power