haywirecoder / homebridge-flobymoen

Homebridge Module for Flo by Moen Smart Water System
MIT License
14 stars 2 forks source link

Disable Notifications Check when Setting LEAK_DETECTED #14

Closed rhockenbury closed 3 months ago

rhockenbury commented 3 months ago

Is your feature request related to a problem? Please describe:

When setting LEAK_DETECTED for a water sensor, there's a check for a critical notification or water detected.

https://github.com/haywirecoder/homebridge-flobymoen/blob/00b06fe0035c72684af639ced05c208ab33c2b96/accessories/waterSensor.js#L33

I would like the behavior to be to only set LEAK_DETECTED when water is detected. Currently, if water is detected, a critical notification gets created which has to be cleared manually in the Moen app in order for LEAK_NOT_DETECTED to be set.

Describe the solution you'd like:

Introduce a new config parameter that would be used to determine whether to check for water detected, or for critical notifications and water detected.

Describe alternatives you've considered:

Additional context:

haywirecoder commented 3 months ago

Hi,

This was done for redundancy, is the situation that a critical notification was generated by no water detected?

rhockenbury commented 3 months ago

Yeah, I think the way it was implemented makes a lot of sense for the typical use case of detecting a leak. In that situation, it will report a leak if it detects water until the user acknowledges it by clearing the notification in the Moen app.

My situation is that I have one Moen water sensor rigged up as a rain detector, and the behavior that I would want with that is to only show that water is detected when there is water present (when it's raining), and for it to self-clear when there is no water present (it's not raining). The notification check prevents it from self-clearing after it has stopped raining.

I realize this use case is a little outside the box, but wanted to check first to see if it might be something you would be interested in supporting.

haywirecoder commented 3 months ago

Ah...Actually, I see the value of an auto-clear for the homekit sensor. So, it's added in the posted version in the repo. Only did a smoke test, but it should function as you desire. Update the readme -- surpressWaterNotification set to true should do what you want. The config UI was also updated, it is under advance features.

rhockenbury commented 3 months ago

Awesome! Appreciate the quick attention. If it's not too much trouble, are you able to publish an alpha/ beta release to make it easier to pull into homebridge for testing?

rhockenbury commented 3 months ago

I ran a few initial tests and the updates seem to be working as intended. I can continue to test and let you know if I run into any issues. Thanks for implementing this.

haywirecoder commented 3 months ago

Part of release 1.0.10