Flume integration

Thank you very much for your time and effort in developing the Flume device driver for Hubitat.

In addition to the Flume water monitor, I have a Dome water main shut-off device. I would like to be able to use the Flume, when I am away from the house, to trigger the Dome device to turn off the water main if a high-flow event (e.g., water piper burst or joint failure) occurs. In the settings of my Flume interface, I have a "Custom Alert / High Flow Leak" set up to notify me (via push and email) if my water usage is 3 gal/min or more for 4 or more minutes.

Is there any way, via Rule Machine or Webcore, that I could set up the Dome device to turn off the water main if Flume detects a high flow leak?

Thank you for your help.

Do you have any way to simulate that high flow condition so that you can see what the Flume alerts look like?

I log every usage alert in an attribute called alertStream. There's also a Smart Leak detection that is sent through an alert, and when that comes through I send an event from the driver that sets the water attribute to wet. The latter is easy to handle in Rule Machine. The former is harder but still possible with a little bit of parsing of the JSON response.

What you'd need to figure out is whether your custom alert shows up in either or both of those to see what your options are.

I'm away from home for an extended period right now, but when I get home, I'll be able to trigger the high flow condition, and see how the custom alert shows up.

I'll post back here in this thread after I'm able to check this out.

Thanks much for your help and your speedy reply. Greatly appreciated.

1 Like

If he can't, I can. I get it when I fill my pool or run my sprinklers.

@tomw unless my sprinklers skip their cycle, should happen at a little after 730am tomorrow.

EDIT: Just happened @ 7:45am (sprinklers)

1 Like

Awesome. Did it toggle the water attribute on the device to wet?

Not sure what you mean by that. There really isn't any "wet" indicator that I know of.

All I see in the app is that you get a push notification / is listed in the notification list.

Sorry for the confusion. I thought you saw it happen in a device instance running my Flume Device driver. I was trying to see how it appears in the usage notifications. I implemented a WaterSensor capability that toggles when a Smart Leak alert is observed, so that is the "wet" indicator that I was talking about.

OH! Sorry, no.


I just tried it again topping off my pool, this time with the driver installed.

Got the high flow notification in the Flume app, but got no events whatsoever on the Hubitat driver side.

Notification came in on the app at 6:42pm

1 Like

Good catch, and thanks for your testing help via PM @JasonJoel.

I posted an improved version to catch the usage notifications in addition to Smart Leak alerts. It's posted now and in GitHub as version 1.0.2.

Quick note: the notificationStream message text is logged with the timestamp directly from Flume which is expressed in UTC time (not shifted to your local timezone). The Hubitat device event timestamp should be in local hub time, so you should likely look there for any needed time-based interpretation.


Awesome integration @tomw and thanks for sharing it with the community! I'd like to change the brightness of bulb in response to water flow rate thresholds. Is there a way to do this through your integration, or is this a limitation of RuleMachine?

1 Like

I think you can make that work @zekelion, but it is a little bit tricky because my flow rates are custom attributes. It will be a lot easier when this is added, assuming it gets the full Rule Machine treatment that other built-in attributes and device types have: Capability Request - Water Flow Rate

For now, in the Rule Machine actions, you have to first set the custom attribute to a variable and then compare that variable to the numbers that you are interested in. Here's a quick demonstration:

The trigger event type to select at "Select capability for new Trigger Event" is "Custom Attribute".
The variable type is 'decimal', and setting it looks like this:

I set up a Flume custom alert and it triggered. The notification fired as expected in your device handler. I cleared it on the Flume side and turned it off. It's a few days later and I still have the attribute set in my notificationStream. Is there a way to clear it in the device handler or does it eventually get overwritten when the next one comes? Thanks!


Hi @jpalovick, it would get overwritten when the next one came. I meant that stream to literally be every value that comes across. You could trigger rule machine when its value changes, but it does appear "sticky" between events.

On thing I am unsure of is whether it still shows up in the response from the API even after it has been cleared in the Flume app.

Flume support told me that they would always be available, and the API provides a way to specify an offset into the reading of notifications, so I keep track of how many this driver has seen and always start reading from that offset.

I haven't been able to test this, though. If you get another notification in the app, will you let me know whether it shows up correctly in this driver? There should be a state variable called "notifCount" that indicates the offset that will be used for the read operation, just do you can see what I'm talking about.

Hi @tomw, thanks for explaining. My notifCount is 1 now so does that mean that you would look for 2 on the next alert? Keeping track is important, I wonder what happens when you reload the driver for instance and notifCount changes unintentionally. Maybe you just read the last one to account for that? I have a notification set for 15 minutes at over .2 gallons so it seems like the washing machine triggers it most times. I don't think you can set the time for less than 15 minutes. I'll turn that notification back on and report back when it happens again.

1 Like

The driver always pumps all notifications available when it checks. If there are more than one it will get all of them (up to 50 at a time IIRC). If the virtual device is newly created and doesn't have a stored offset yet it will catch up the first time. So, it's important that the offset is correct and that clearing them in the app doesn't make the driver look 'ahead' to something that doesn't exist, which would mean a missed notification in the driver. Hopefully that makes sense.

I'm trying to activate Away Mode in the Flume based on my goodbye routine. I could only think to add this as a custom command. I found the parameter to add but I'm not sure what parameter to add if this is in fact how you might configure this.

That looks correct. It is indeed a custom command, but there isn't a parameter on the command. Can you just leave it blank or unspecified?

As an aside, I never actually tested this due to lack of a device, so make sure it actually works before you rely on it! You can take RM out of the equation and just run that command from the device page as a sanity check.

Yes, I tried it with a "1" thinking it would be 1=on, 0=off. I did try just hitting the "set away mode" button on the device and it does not seem to change the mode in the app.

Let me take another look at the API docs. I'll PM you to troubleshoot.