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

SensorWaterMeter reports 0 just after reporting the value #458

Open
user2684 opened this issue Jan 16, 2019 · 0 comments
Open

SensorWaterMeter reports 0 just after reporting the value #458

user2684 opened this issue Jan 16, 2019 · 0 comments
Labels

Comments

@user2684
Copy link
Contributor

From https://forum.mysensors.org/topic/10043/water-pulse-meter-value-not-reported-automatically/7

the counter seem to be reset and there is always a zero value reported after the true value. E.g. after creating a few pulses, I get the log:

27027 NM:LOOP:WATER(1):SET t=35 v=0.0190
35086 NM:MSG:SEND(1) t=35 p=0.01
35090 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0190
35098 NM:MSG:SEND(1) t=35 p=0.00
35104 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
65099 NM:MSG:SEND(1) t=35 p=0.00
65103 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000
65112 NM:MSG:SEND(1) t=35 p=0.00
65118 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.0000

I've digged a bit in the NodeManager code on my own and is far from certain, but isn't it a problem that reset() is called when the value has been reported by the child (line 199)

If I get it correctly:
When waterSensor calls setValue, it in turn calls setValueNumber which adds the pulse to _total. That's fine.
But when sendValue is called at a later time, both _value and _total are reset to 0 as _value_processingis SUM.

So the pulse count will restart from zero.
Wouldn't we want to keep at least _total at its current value, to keep the accumulated number of pulses over time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant