danieljtribe / homebridge-agile-octopus

BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

Low price switch #6

Closed GavinB1973 closed 1 month ago

GavinB1973 commented 10 months ago

Thank you so much for putting this plugin together. I’m using it to turn my UFH and hot water off when the Octopus price rises above a threshold. I tend to set the threshold each day, this has been working great until recently. Over the last month or so, the low price switch will turn off at random times I.e. at 3.6p when the threshold is set at 21p. Any ideas how to overcome this issue? I can change my automation to read the cost per unit and use HomeKit automation to activate / deactivate the scene, but I like the switch operation as there is only one threshold to change each day. I’m running v1.1.3 of your plugin on homebridge 1.7.0 on a windows box with node 21.1.0

danieljtribe commented 1 month ago

Hi GavinB1973, thank you for your report and my apologies for the delay in replying. It's great to hear how you're using the plugin and automating your home!

I have identified the cause of this issue and have a resolution to this incoming soon. This bug was caused by Typescript's handling of its Number type when used with a comparison operator; this caused low price figures below 10.0p to register as high prices. The effect of this was that if someone had set a low price threshold of 15p all prices between 10.0p and 15.0 would register as a low price but anything below 10.0p would not.

I'll notify you here once the release of this bugfix has gone live.

danieljtribe commented 1 month ago

Resolved in version 1.2.4, thank you again for your report!