Leak detector app from ST for water meter

I have a Fortrezz Flow meter I was using with ST and a leak detector app. I ported over and it install fine. Even let me set everything up. However its giving me a error.

app:6422019-06-29 06:52:53.673 pm errorjava.lang.NullPointerException: Cannot get property 'type' on null object on line 242 (gpmHandler)

app:6422019-06-29 06:51:53.702 pm errorjava.lang.NullPointerException: Cannot get property 'type' on null object on line 93 (cumulativeHandler)

--- Loading Past Logs... ---

I don't know anything about code but would love to get this working or having the meter is kind of pointless. Can someone tell me what i need to change? If you need more info please let me know.

Thanks

No idea. But why not just use RM or HSM? They work really well with my water valve and 8 leak sensors.

If htis is the route you want to take, you'll need to provide the code. This type of troubleshooting is incredibly difficult and pretty much impossible with just the error message above. But...

That being said, you have several "native" options in Hubitat. (If you're coming from ST, Hubitat has a lot more built-in apps than ST, or at least more that are significantly more functional in my experience.) Are you sure you need this custom app? As stated above, Hubitat Safety Monitor might be able to do this for you. For two more alternatives, the built-in Notifications app might be able to do the same. If nothing else, you can probably put something together in Rule Machine that would do what you want.

I might suggest stating your goal (e.g., what device events you want to respond to and how you want to respond to them), then maybe someone can help you see if what you want is already possible.

I would love to do it through RM however I can't figure out how. That's not to say it can't be done I just don't understand how to.

The meter does count GPM and it will list that as a attribute in RM but I don't know how to have it see that over time to lets say water running for 1 hour continuous then shut off water valve.
Any ideas?
Thank you for replying. Its people like you that make this a great community.

Thanks for replying. I do have some leak sensors that shut off my water valve but I would like it shut off the valve if lets say water is over 7 GPM or water has been running for 1 hour continuous.

Maybe I will just wait for RM4 it may be simpler to figure it out. Hopefully.

The biggest thing that makes RM4 simpler than RM3 is that the different "types" of child apps (rule, triggered rule, trigger, etc.) have been consolidated into one, which is more or less what "trigger" used to be. So you'll choose what you want to make the rule actions run, then work from there.

To make what you want work in the current version of RM, I'd probably use a regular rule. I don't have any valves, so I'm not sure exactly how they show up, but it sounds like you figured that part out. I'd create a condition that says something like "valve flow is greater than 0 gpm" (which I assume would be true when water is running and false when it is not). RM will pre-populate the "rule" section with the same, which is fine. (If you have multiple conditions, you'd need to combine them, but since that's changing, I wouldn't worry too much about this now.) Then, under "Actions for True," do whatever you want when the flow is greater than 0 GPM: probably a delay for 1 hour with "cancel on truth change" selected (so it stops execution if it goes back down to 0 GPM), then an action that shuts off the valve. Personally I'd probably also add a notification, but you can do whatever you want. The delay with cancellation is how you achieve the "stays at >0 GPM for 1 hour" thing. You can probably ignore "Actions for False" unless you want something to happen when the flow goes above 0 (for any amount of time) and then goes back down.

I can be more specific with how you add these actions, but assuming your devices are exposed as capabilities RM can view and manipulate, something like the above should generally work. Good luck!

1 Like

Yes that's it. Wow thank you so much. Now it seems so simple. The delay was the key I just didn't see.

1 Like

Code is on Fortrezz public Github here: smartthings/flow meter (fmi)/Leak Detector SmartApp at master ยท fortrezz/smartthings ยท GitHub

I was about to start looking at porting this myself, came here to see if anyone had done it already.

I have the Frotrezz Flow meter.. and I had been using it on hubitat, via hubconnect on smartthings..
Moved it to hubitat directly.. and after installing the driver.. created two rules for the Leak detector app...
This is the "High Flow Leak" rule in RM5

and this is the "Continuous Flow Leak Rule" in RM5