Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r900: decode leak, fraud, and backflow status flags #27

Merged
merged 1 commit into from
Mar 15, 2015

Conversation

sandeen
Copy link

@sandeen sandeen commented Mar 15, 2015

TL;DR - this patch decodes the unknown2 and unknown4 fields into leak,
fraud, and backflow status information.

Pretty output now shows:

NoUse:$BIN BackFlow:$FLAG ... Leak:$BIN LeakNow:$FLAG

Where BackFlow is 0, 1, or 2 for no, low, or high backflow in past 35d;
LeakNow is 0, 1, or 2 for no, low, or high leak in the past 24h;
NoUse and Leak is a number from 0 through 6 representing the number of
days in the past 35 days for which either no use or a leak has occurred,
according to this table:

bucket days


0 0
1 1-2
2 3-7
3 8-14
4 15-21
5 22-34
6 35+

I sorted this out using public documentation such as
https://www.neptunetg.com/About/Case-Studies/Water/Westbank-Irrigation-District,-BC
which indicates that the utility can gather stats on days of no use and
days of leak in the past 35 days, and that it is divided into buckets as
shown in the table above.

Using this public information, intentionally triggering the leak flag in
my home, and listening to many meters over time led me to this decoding
of the unknown2 and unknown4 fields.

The 8 unknown2 bits seem to show days of no use and backflow information,
like this (? is still unknown, but this patch lumps it in with the bucket
number):

???BBBHL

BBB: bucket # for days of no use in past 35 days
H: high backflow in past 35 days
L: low backflow in past 35 days

Backflow seems to require some minimum frequency of occurrence before it
will set the flag.

Similarly, the 6 unknown4 bits look like this:

?BBBHL

BBB: bucket # for days of leak in past 35 days
H: continuous leak in past 24 hours
L: intermittent leak in past 24 hours

Intermittent leaks are described by Neptune in other public docs as:

"Intermittent leak indicates that water has been used for at
least 50 of the 96 15-minute intervals during a 24-hour period"

and a continuous leak indicates use in every 15-minute period over
the past 24h.

TL;DR - this patch decodes the unknown2 and unknown4 fields into leak,
fraud, and backflow status information.

Pretty output now shows:

NoUse:$BIN BackFlow:$FLAG ... Leak:$BIN LeakNow:$FLAG

Where BackFlow is 0, 1, or 2 for no, low, or high backflow in past 35d;
LeakNow is 0, 1, or 2 for no, low, or high leak in the past 24h;
NoUse and Leak is a number from 0 through 6 representing the number of
days in the past 35 days for which either no use or a leak has occurred,
according to this table:

bucket  days
------  ----
0       0
1       1-2
2       3-7
3       8-14
4       15-21
5       22-34
6       35+

I sorted this out using public documentation such as
https://www.neptunetg.com/About/Case-Studies/Water/Westbank-Irrigation-District,-BC
which indicates that the utility can gather stats on days of no use and
days of leak in the past 35 days, and that it is divided into buckets as
shown in the table above.

Using this public information, intentionally triggering the leak flag in
my home, and listening to many meters over time led me to this decoding
of the unknown2 and unknown4 fields.
 
The 8 unknown2 bits seem to show days of no use and backflow information,
like this (? is still unknown, but this patch lumps it in with the bucket
number):
 
???BBBHL

BBB: bucket # for days of no use in past 35 days
H: high backflow in past 35 days
L: low backflow in past 35 days

Backflow seems to require some minimum frequency of occurrence before it
will set the flag.

Similarly, the 6 unknown4 bits look like this:

?BBBHL

BBB: bucket # for days of leak in past 35 days
H: continuous leak in past 24 hours
L: intermittent leak in past 24 hours

Intermittent leaks are described by Neptune in other public docs as:

"Intermittent leak indicates that water has been used for at
least 50 of the 96 15-minute intervals during a 24-hour period"

and a continuous leak indicates use in every 15-minute period over
the past 24h.
@bemasher
Copy link
Owner

Everything looks good.

bemasher added a commit that referenced this pull request Mar 15, 2015
r900: decode leak, fraud, and backflow status flags
@bemasher bemasher merged commit e1d9b04 into bemasher:master Mar 15, 2015
@bemasher bemasher mentioned this pull request Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants