bemasher / rtlamr-collect

Data aggregation for rtlamr.
GNU Affero General Public License v3.0
171 stars 29 forks source link

saving cumulative readings for idm/netidm #24

Closed fcovatti closed 4 years ago

fcovatti commented 4 years ago

I did some changes in rtlamr-collect in order to save also the cumulative energy readings for IDM and NetIDM meters. In this way it is possible to have both differential and cumulative on the influx database.

I am not sure if you want to merge this, but I am creating the pull request so you can check if it is interesting to merge. I did test on Itron meters and the total consumption values worked.

bemasher commented 4 years ago

Does eb04c475c2cef03a8745de256e876b4e9b881e0a meet your needs?

I don't have easy access to NetIDM meters in my area, would you be willing to test that this commit does what you want?

fcovatti commented 4 years ago

Great. Much better coding :)

The only thing that does not capture is that rtlamr reports for IDM meters in the JSON "LastConsumptionCount" instead of "LastConsumption" (which is on NetIDM Json).

One possibility would be to change the rtlamr code to have both IDM and NetIDM using the same name for the Last Consumption. Or on rtlamr-collect create a if that save consumption depending on IDM or NetIDM.

https://github.com/bemasher/rtlamr/blob/master/idm/idm.go#L192

bemasher commented 4 years ago

This should do it: 5d1bcddce63777d439c001f443db7aeae728eaaf

fcovatti commented 4 years ago

Awesome. Thanks so much