# FortrezZ Water Flow Meter

**URL:** <https://community.smartthings.com/t/fortrezz-water-flow-meter/46744>\
**Category:** Devices & Integrations\
**Tags:** watermeter, flowmeter, fortrezz\
**Created:** [May 1, 2016, 1:02am UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744 "2016-05-01T01:02:38Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [August 21, 2016, 1:02am UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/41 "2016-08-21T01:02:30Z")

</div>

> [@bridaus](#):
>
> I probably didn’t break anything, works for me.
> 
> Issue pull request too if you like it.

I made more changes from the code you originally pulled from. For some reason, high flow alarm would trigger just once, and never again. I couldn’t understand why (still learning DH coding and such), so I changed the code to do that within the DH instead of relying on an alarm condition to be sent from the physical device. I figured the flexibility with ST allowed for that. I just used sendEvent for “water” and “waterState” and it works as expected.

I’m going to incorporate your changes so I don’t have to try and merge a lot of changes. I like what you did and look forward to testing.

EDIT. Thanks for your work on this. I’ve wanted to learn more about lists, and this is very helpful.

---

<div class="post-metadata">

**Author:** ![bridaus](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bridaus/32/94511_2.png) [@bridaus](https://community.smartthings.com/u/bridaus)\
**Post date:** [August 21, 2016, 2:07am UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/42 "2016-08-21T02:07:57Z")

</div>

Go for it. Happy to contribute in any way. Exercise for the brain. 🙂

---

<div class="post-metadata">

**Author:** ![bridaus](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bridaus/32/94511_2.png) [@bridaus](https://community.smartthings.com/u/bridaus)\
**Post date:** [August 21, 2016, 4:54pm UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/43 "2016-08-21T16:54:56Z")

</div>

Small bug in my code, just a trace line clobbered in last minute change, line 293, replace with this:

```
log.trace "Current Measurement Value: ${state.deltaList[state.deltaList.size()-1]}"

```

Forgot the minus 1.

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [August 21, 2016, 9:55pm UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/44 "2016-08-21T21:55:10Z")

</div>

> [@bridaus](#):
>
> Small bug in my code, just a trace line clobbered in last minute change, line 293, replace with this:

No worries at all. I tested quite a bit last night, and your stuff works perfectly. I made several other changes as well to clean things up:

- Merged your changes, but I commented out your logging debug/trace statements so as to keep Live Log as clean as I could when not making code changes and debugging.
- Changed how parameters are handled via the new Updated section now (no need to tap on the config tile) and removed unneeded code due to that change, specifically the area where you asked why setThreshhold was being called in the parse section (part of FortrezZ’s original code).
- Cleaned up code for how high flow is detected compared to FortrezZ’s original design, and made sure it didn’t cause problems with their SmartApp (if you’re using it).

My next change will be to work on the section where you can reset the meter back to zero, not just the high values for GPM and gallons used.

Here’s the latest for your review. I learned a lot from spending time understanding what you did, which gave me many ideas for a few other DH’s I’m tinkering with. Thank you for spending time on helping make this a better DH, I really appreciate it!

[https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/my-fortrezz-flow-meter-interface.src/my-fortrezz-flow-meter-interface.groovy](https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/my-fortrezz-flow-meter-interface.src/my-fortrezz-flow-meter-interface.groovy)

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [August 22, 2016, 12:09am UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/45 "2016-08-22T00:09:47Z")

</div>

Hi @bridaus,

Scratch the “Updated section” part. For some reason ST runs each section twice and the parameters don’t take, but if you tap on the Config tile after changing parameters everything works. I have no idea why.

Actually I almost prefer not to have it automatically run because what if you made a mistake with your choice and wanted to back it out? I think I’ll remove the Updated section and just require the user to tap Config afterwards.

Stay tuned for another github update shortly.

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [August 22, 2016, 12:16am UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/46 "2016-08-22T00:16:32Z")

</div>

Hi @bridaus,

Updated with the change I mentioned above. Also working on the meter reset section. Had to send an email to FortrezZ support.

[https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/my-fortrezz-flow-meter-interface.src/my-fortrezz-flow-meter-interface.groovy](https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/my-fortrezz-flow-meter-interface.src/my-fortrezz-flow-meter-interface.groovy)

---

<div class="post-metadata">

**Author:** ![bridaus](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bridaus/32/94511_2.png) [@bridaus](https://community.smartthings.com/u/bridaus)\
**Post date:** [August 22, 2016, 12:49am UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/47 "2016-08-22T00:49:04Z")

</div>

Is there an engineering doc for it? Found those help a lot. Device isn’t that difficult to figure, but could shorten development and could help them.

I’ll test this week when I get some more time. Thanks!

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [August 22, 2016, 10:22pm UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/48 "2016-08-22T22:22:43Z")

</div>

> [@bridaus](#):
>
> Is there an engineering doc for it? Found those help a lot. Device isn’t that difficult to figure, but could shorten development and could help them.

Yes, and I’ve been working with FortrezZ support the last few hours. There’s a error in their tech spec document that they found, as well as a separate command class to call. I’ve tried both of their suggestions, but it still didn’t work, so I’m just waiting for another suggestion from their engineer. Stay tuned.

---

<div class="post-metadata">

**Author:** ![bridaus](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bridaus/32/94511_2.png) [@bridaus](https://community.smartthings.com/u/bridaus)\
**Post date:** [August 28, 2016, 7:12pm UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/49 "2016-08-28T19:12:54Z")

</div>

Tested briefly. Looks great. Like the style changes. Some things to check into (either of us)…

1. After a reset, the cumulative is set to the actual to-date (I think). So the highest usage shows that first very high value until the next reset.
2. I think this is in my code, I got a super high gpm at some point, and it stayed highest. I’ll have to think through the logic to see if there is any divide by low numbers maths issues. 🙂
3. Sometimes in Android, staying in the app makes an extra linefeed happen in the tiles. Doubt we can do anything about this, probably an app issue.
4. My battery meter has always shown zero. To be fair, I’ve never tried diagnosing it except I did swap the cables once as mentioned somewhere, but that’s all I did.

Love this device.

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [August 28, 2016, 9:35pm UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/50 "2016-08-28T21:35:48Z")

</div>

> [@bridaus](#):
>
> After a reset, the cumulative is set to the actual to-date (I think). So the highest usage shows that first very high value until the next reset.

Yeah…the reset isn’t working yet. FortrezZ said it works on their end, so the only recommendation I was given is to physically reset the meter and try again. I’ll do that next week before the end of the month, so for now all it does is reset the values until the meter can get reset. What I find very interesting is that you too are experiencing the same thing. I wonder if FortrezZ is testing with newer firmware than what we have.

> [@bridaus](#):
>
> I think this is in my code, I got a super high gpm at some point, and it stayed highest. I’ll have to think through the logic to see if there is any divide by low numbers maths issues.

I did mean to tell you that last week. It started after I used your changes. Just tap on the tile to reset just the high gpm value. I may just revert back to my original code for that part. I’m ok with how it was calculated before given how the meter works. For my use case I’ll be good.

> [@bridaus](#):
>
> Sometimes in Android, staying in the app makes an extra linefeed happen in the tiles. Doubt we can do anything about this, probably an app issue.

I’m sure you’re right cause I see that happening on a few other DH’s I have on Android (all my phones and tablets). Unfortunately (or fortunately) I don’t any iOS device to test with.

> [@bridaus](#):
>
> My battery meter has always shown zero. To be fair, I’ve never tried diagnosing it except I did swap the cables once as mentioned somewhere, but that’s all I did.

Battery reporting is funky. I ran my FMI on batteries for 2 days and never saw a level change. The first time I did that is when I got a battery report, but after that I never bothered to do any more testing like you.

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [August 28, 2016, 11:00pm UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/51 "2016-08-28T23:00:34Z")

</div>

> [@bridaus](#):
>
> After a reset, the cumulative is set to the actual to-date (I think). So the highest usage shows that first very high value until the next reset.

I went ahead and did a factory reset on my FMI and reincluded it to ST. The factory reset worked, but doing a meter reset with ST (both methods they told me to try) did not work. I’ve emailed FortrezZ support again. Stay tuned.

---

<div class="post-metadata">

**Author:** ![bridaus](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bridaus/32/94511_2.png) [@bridaus](https://community.smartthings.com/u/bridaus)\
**Post date:** [August 29, 2016, 2:05am UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/52 "2016-08-29T02:05:59Z")

</div>

I think maybe it’s the software that should reset this value, yes? It’s ok if the meter keeps it forever, you just have to calculate that in your rest. The energy meters are the same.

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [August 29, 2016, 11:14am UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/53 "2016-08-29T11:14:32Z")

</div>

> [@bridaus](#):
>
> I think maybe it’s the software that should reset this value, yes?

Yes, that’s what the DH is suppose to do. meterReset() is suppose to do that based on the command classes the FMI supports, as well as parameter 3 configurations, but neither of those to methods work.

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [August 29, 2016, 9:10pm UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/54 "2016-08-29T21:10:58Z")

</div>

> [@bridaus](#):
>
> I think maybe it’s the software that should reset this value, yes?

Support got back to me this afternoon, and it’s fixed. Totally my error in the code. I’m embarrassed… I forgot to include “return” before cmds. 😭

I’m cleaning up a few things, and want to add some type of timestamp in the DH to let the user know when the meter was last reset. Stay tuned, and I’ll post an screenshot and link soon.

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [August 29, 2016, 9:54pm UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/55 "2016-08-29T21:54:44Z")

</div>

Hi @bridaus,

My latest version of the code: (minus your weighted average code)

[https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/my-fortrezz-flow-meter-interface.src/my-fortrezz-flow-meter-interface.groovy](https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/my-fortrezz-flow-meter-interface.src/my-fortrezz-flow-meter-interface.groovy)

 ![](https://global.discourse-cdn.com/smartthings/original/3X/d/2/d2276755325b605cdb97a83dbac84792df820287.png)

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [August 31, 2016, 11:59pm UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/56 "2016-08-31T23:59:48Z")

</div>

Hey @bridaus, @dantheman2865. I updated my DH, and I decided to see how well “carouselTile” would work as the top tile. It does!

Every time you cycle through the different charts or refresh a chart, it adds that to the carousel so you can swipe to the left to see past charts. Is it useful? Probably not, but it was a fun and an easy tweak to the DH.

---

<div class="post-metadata">

**Author:** ![dantheman2865](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/dantheman2865/32/17217_2.png) [@dantheman2865](https://community.smartthings.com/u/dantheman2865)\
**Post date:** [September 1, 2016, 1:39pm UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/57 "2016-09-01T13:39:28Z")

</div>

@johnconstantelo This is a great idea. I’ll have to look at officially integrating this; we’re still considering your other features!

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [September 1, 2016, 11:51pm UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/58 "2016-09-01T23:51:06Z")

</div>

Hey @dantheman2865 and @bridaus,

**_Important_**

I discovered a problem with the data that is sent to the cloud to build the charts when report threshold is changed.

sendDataToCloud is called when there’s flow, and the data being sent is a calculated flow rate but the charts are displaying gallons. I believe that changing the reporting threshold to anything other than 60 seconds causes wrong gallon data on the charts.

I started wondering how in the world I was using so much water, and discovered that the call to the cloud was sending my gpm’s every 10 seconds (I want it that fast). So that meant I was sending 1.2, 1.8, 1.2, etc etc which would add up on the charts to 4.2 gallons using that sample data, when in actuality I used more like 1 gallon. I tested using my sink and a known water level representing 3 gallons. With a 60 second reporting threshold I used 3 gallons, but with 10 seconds I used 18 gallons based on what the charts say!

To resolve this, I moved where data is sent to the cloud, as well as what variable should be used. I moved sendDataToCloud to within the IF statement that checks for delta == 0. This also reduces the need to constantly send data to the cloud. Technically we should only send data once flow stops. Here’s the updated code:

[https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/my-fortrezz-flow-meter-interface.src/my-fortrezz-flow-meter-interface.groovy](https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/my-fortrezz-flow-meter-interface.src/my-fortrezz-flow-meter-interface.groovy)

I also added a few new attributes (ending in LastReset) to capture high values prior to being reset in case the user needs to know or forgot to save.

**EDIT:**

Also added another user preference for a custom device ID (used only for charting) that causes a new set of charts to be created. There’s no easy way of resetting charts if you want to start over after resetting the meter, unless a user waits it out for the data to cycle all the way through 4 weeks of data collection, or the user does a factory reset causing the device ID to change.

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [September 13, 2016, 1:09am UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/59 "2016-09-13T01:09:59Z")

</div>

Hi @bridaus,

If you’re interested, I created a little SmartApp that will reset the meter on a monthly basis at a time you specify. This is handy if you only care about seeing current month data in the phone app, especially if you do any external logging for long term analysis.

[https://raw.githubusercontent.com/constjs/jcdevhandlers/master/smartapps/jscgs350/fortrezz-flow-meter-reset-manager.src/fortrezz-flow-meter-reset-manager.groovy](https://raw.githubusercontent.com/constjs/jcdevhandlers/master/smartapps/jscgs350/fortrezz-flow-meter-reset-manager.src/fortrezz-flow-meter-reset-manager.groovy)

NOTE: This assumes you’re using my latest DH for the device.

---

<div class="post-metadata">

**Author:** ![johnconstantelo](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/johnconstantelo/32/111869_2.png) [@johnconstantelo](https://community.smartthings.com/u/johnconstantelo)\
**Post date:** [October 5, 2016, 11:22pm UTC](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744/60 "2016-10-05T23:22:16Z")

</div>

Hey @bridaus, @dantheman2865, I just can’t stop tweaking the DH:

 ![](https://global.discourse-cdn.com/smartthings/original/3X/a/e/ae8aec5c8cbdc876c9c97701e112cc801e972ff1.png)

[https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/my-fortrezz-flow-meter-interface.src/my-fortrezz-flow-meter-interface.groovy](https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/my-fortrezz-flow-meter-interface.src/my-fortrezz-flow-meter-interface.groovy)

See the code change log for all the changes made since September 1st. Some visual changes are obvious.

[Previous page](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744.md?page=2)

[Next page](https://community.smartthings.com/t/fortrezz-water-flow-meter/46744.md?page=4)
