Skip to content

Commit

Permalink
Add fields NoUse, BackFlow, Leak, and LeakNow for R900 and R900BCD.
Browse files Browse the repository at this point in the history
  • Loading branch information
bemasher committed Jan 27, 2019
1 parent 3dee745 commit 63080cf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ type R900 struct {
EndpointID uint32 `json:"ID"`
EndpointType uint8 `json:"Unkn1"`
Consumption uint32 `json:"Consumption"`

NoUse uint8 `json:"NoUse"` // Day bins of no use
BackFlow uint8 `json:"BackFlow"` // Backflow past 35d hi/lo
Leak uint8 `json:"Leak"` // Day bins of leak
LeakNow uint8 `json:"LeakNow"` // Leak past 24h hi/lo
}

// AddPoints adds cummulative usage data to a batch of points.
Expand All @@ -197,6 +202,10 @@ func (r900 R900) AddPoints(msg LogMessage, bp client.BatchPoints) {
},
map[string]interface{}{
"consumption": int64(r900.Consumption),
"nouse": int64(r900.NoUse),
"backflow": int64(r900.BackFlow),
"leak": int64(r900.Leak),
"leak_now": int64(r900.LeakNow),
},
msg.Time,
)
Expand Down

0 comments on commit 63080cf

Please sign in to comment.