jeroenterheerdt / HAsmartirrigation

Smart Irrigation custom component for Home Assistant
https://jeroenterheerdt.github.io/HAsmartirrigation/
MIT License
367 stars 49 forks source link

Daily adjusted run time service - accumulates to infinity #13

Closed sztof closed 4 years ago

sztof commented 4 years ago

Calling service "smart_irrigation.calculate_daily_adjusted_run_time" several times causes to accumulate seconds several times. Because of it, there should be a possibility to disable automatic calculation at 23:00, so user could calculate once time once - just before starting sprinklers. Otherwise - user will calculate time on its own, and additionally it will be done at 23:00. This may cause exceeding optimal sprinkling time by value accumulation.

obraz

jeroenterheerdt commented 4 years ago

problem is that the value it is based on (hourly run time) will be updated at 24:00 and will show values for the next day. I am not sure how to make this work properly if I need to allow a user to manually update daily adjusted run time. Also, calling it more than once will break things. I will probably remove this service.

jeroenterheerdt commented 4 years ago

the reason for the problem is that you are calling it several times, you should only be calling it once really.

sztof commented 4 years ago

As far as I understand the plan is to run it manually once, lets say at 21:00 before sprinkling, and then "reset_bucket" service, after sprinklig is done. But again, at 23:00 "update daily counter" will be automatically called. Because of it - calculating sprinkling time on second day will be called twice (23:00 - automatically, and 21:00 next day - by user)

jeroenterheerdt commented 4 years ago

The plan is to make auto refresh configurable. So if you wanted you could go all manual. see #18

jeroenterheerdt commented 4 years ago

please use v0.0.22 (or later) - it allows you to disable auto refresh so you can safely call the daily update service once.