Page 1 of 2
Problem with huge value for "usage"
Posted: Friday 25 March 2016 18:42
by hyla
MySensors 1.5, Domoticz 3.5010
Hi,
I've started to implement the gas meter and came across a practical problem I've seen with energy meter and water meter too:
Unfortunately I have not succeeded in retrieving the start value for the pulse count / gase usage from the controller. So what I do is to save
the value in the EEPROM whenever the sensor loses power and to retrieve data from EEPROM when booting up again. Then this value is sent to the controller. That actually works well, problem is: sometimes the value received by the controller is HUGE. Like in the picture:
- hugeUsage.jpg (98.05 KiB) Viewed 3801 times
Now, I
think I may have found the problem but I don't know how to solve it: It seems to have to do with the fact that in my case I had to report a value for usage to the controller that was actually
smaller than the one before (my sensor was registering too many pulses so the usage value was too high).
Now, Domoticz seems to interpret that negative amount as a huge positive number. I'd guess a problem with signed/unsigned numbers?
Anyone got an idea what's to be done here?
Thanks for any input,
Christoph
I should mention that it's not possible to delete this huge value. When selecting the value hitting "SHIFT" and "let mouse button" I am asked "Are You sure to remove this value" but it never works ...
Re: Problem with huge value for "usage"
Posted: Friday 25 March 2016 19:01
by RidingTheFlow
Don't send updates that will decrease the meter count.
You can check current meter value and discard attempt to send value that is smaller.
Re: Problem with huge value for "usage"
Posted: Friday 25 March 2016 19:41
by hyla
Yeah, well. Only, in this case the REAL value IS smaller than before. That's the problem. And this fact is misinterpreted by the controller by introducing an incedibly large number. Which can't be deleted anymore.
Chris
Re: Problem with huge value for "usage"
Posted: Friday 25 March 2016 20:25
by gizmocuz
Your using the wrong sensor type
Re: Problem with huge value for "usage"
Posted: Friday 25 March 2016 20:42
by hyla
Can You elaborate?
Chris
Re: Problem with huge value for "usage"
Posted: Friday 25 March 2016 21:16
by gizmocuz
You use a sensor that expects a continues counter
Re: Problem with huge value for "usage"
Posted: Friday 25 March 2016 22:49
by hyla
Ah, get it. Yes, of course. Because that's what usually happens in the real world:
I'm using gas
up, not actually producing it.
Well, okay. You know what I mean
Seriously.
Imagine the following. I'm having a sensor which for reasons I have no influence on produces a value, i.e. a count, that has to be corrected from time to time. Manually. These corrections would imply that the count actually
decreases instead of increasing.
Is it possible to do such a correction without producing a number with 20 digits in the process as it happens right now?
As I said: I don't
know anything about what exactly happens when sending a value to Domoticz but I
suppose this problem has got to do with the way those values are represented internally. If I send a negative value (previous value was larger than current value) to a program that only knows positive numbers then the negative number would be interpreted as a huge POSITIVE number. That's what I'm guessing here.
You're obviously the one to tell me I'm wrong
Chris
Re: Problem with huge value for "usage"
Posted: Saturday 26 March 2016 10:51
by gizmocuz
your not wrong...
your sensor type is not supported in domoticz
you can use the custom sensor to log this maybe ?
Re: Problem with huge value for "usage"
Posted: Saturday 26 March 2016 22:30
by hyla
Okay, I see. Right now I'm using an "RFXMeter" for water and gas (which I think
should be alright).
When presenting these sensors to Domoticz they are presented as a "watermeter" ...
... and in Domoticz one has to change that to the appropriate type (energy, gas, water and so on). When doing that with gas it says "Waterflow" in the log chart. Where and how can I change that?
And those huge values I talked about in the beginning of this thread: how come one can't delete them?
Thnx,
Chris
Re: Problem with huge value for "usage"
Posted: Sunday 27 March 2016 17:33
by gizmocuz
The mysensors water sketch has a waterflow child as well
You can delete all you want, just shift-click with your mouse on the month/year graph, or delete them from the database.
Please note, that you are not using the sensors in a normal way, and i do not give any support for this, counters are incremental, and should never be set to a smaller amount
Re: Problem with huge value for "usage"
Posted: Sunday 27 March 2016 21:39
by hyla
You can delete all you want, just shift-click with your mouse on the month/year graph
No. That's
exactly what does not work. I can shift-click the whole day long. The value won't be erased, reason somehow being (again. Just supposing) that the value is insanely huge (did You look at the number? 20 digits?). Sort of a bug, if You will
Christoph
Re: Problem with huge value for "usage"
Posted: Sunday 27 March 2016 22:10
by hyla
Please note, that you are not using the sensors in a normal way, and i do not give any support for this
Understood. And understandable. Of course, I'll go on using these sensors, it's the right thing to do. I was just looking into a way to work around some flaws, won't do it again, promised
What about my other question: the inscription on the graphic of my gas sensor says "waterflow". How can I change that one?
- waterflow1.jpg (36.68 KiB) Viewed 3713 times
Thanks,
Christoph
Re: Problem with huge value for "usage"
Posted: Monday 28 March 2016 9:17
by gizmocuz
Please show me the devices tab with this sensor, as it seems this is not a gas sensor, a gas sensor's day values also do not display like this (yellow)
Re: Problem with huge value for "usage"
Posted: Tuesday 29 March 2016 18:15
by hyla
Hi,
these are the devices:
- Gas_Devices.jpg (64.85 KiB) Viewed 3686 times
And this is the relevant part of my Mysensors code:
Code: Select all
MyMessage flowMsg(CHILD_ID, V_FLOW); // message for usage
MyMessage volumeMsg(CHILD_ID, V_VOLUME); // message for volume
MyMessage pcMsg(CHILD_ID, V_VAR1); // message for sending pulse count
[...]
gw.present(CHILD_ID, S_WATER); // Register this device as water meter sensor (change to "gas" in Domoticz)
gw.wait(3);
gw.send(flowMsg.set(0)); // Send dummy flow value to gw
gw.wait(3);
[...]
gw.send(pcMsg.set(pulseCount)); // send pulseCount to gw
gw.wait(3);
gw.send(volumeMsg.set((float)pulseCount / (float)PULSE_FACTOR, 2)); // Send current volume value to gw
gw.wait(3);
Yes, I know I am registering my gas meter as a water meter. Only, I couldn't find 'S_GAS', so I use 'S_WATER' and change that in Domoticz into "Type Gas", at least for the "usage". Seems to work.
- ChangeType.jpg (42.69 KiB) Viewed 3686 times
How is it done correctly?
Chris
Re: Problem with huge value for "usage"
Posted: Tuesday 29 March 2016 18:30
by gizmocuz
How do you mean there is no S_Gas ? There is...
Re: Problem with huge value for "usage"
Posted: Tuesday 29 March 2016 18:31
by gizmocuz
But changing it to gas is also an option
Re: Problem with huge value for "usage"
Posted: Tuesday 29 March 2016 18:31
by gizmocuz
Take a note of the gas divider in the domoticz settings page
Re: Problem with huge value for "usage"
Posted: Tuesday 29 March 2016 19:13
by hyla
gizmocuz wrote:How do you mean there is no S_Gas ? There is...
- NoGas.jpg (103.6 KiB) Viewed 3675 times
Using Arduino 1.6.5 and mySensors 1.5 ...
Christoph
Re: Problem with huge value for "usage"
Posted: Tuesday 29 March 2016 19:16
by hyla
gizmocuz wrote:But changing it to gas is also an option
As I wrote, all I can change when registering my meter as "S_WATER" is the type for the "usage". "Flow" has got no editable features...
Chris
Re: Problem with huge value for "usage"
Posted: Tuesday 29 March 2016 19:18
by hyla
gizmocuz wrote:Take a note of the gas divider in the domoticz settings page
That's set correctly, I think. The resulting numbers are plausible ...
Chris