Problem with huge value for "usage"
Moderator: leecollings
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Problem with huge value for "usage"
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:
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 ...
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:
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 ...
-
- Posts: 72
- Joined: Friday 11 March 2016 18:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Essex, UK
- Contact:
Re: Problem with huge value for "usage"
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.
You can check current meter value and discard attempt to send value that is smaller.
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Re: Problem with huge value for "usage"
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
Chris
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Re: Problem with huge value for "usage"
Can You elaborate?
Chris
Chris
- gizmocuz
- Posts: 2352
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Problem with huge value for "usage"
You use a sensor that expects a continues counter
Quality outlives Quantity!
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Re: Problem with huge value for "usage"
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
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
- gizmocuz
- Posts: 2352
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Problem with huge value for "usage"
your not wrong...
your sensor type is not supported in domoticz
you can use the custom sensor to log this maybe ?
your sensor type is not supported in domoticz
you can use the custom sensor to log this maybe ?
Quality outlives Quantity!
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Re: Problem with huge value for "usage"
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
When presenting these sensors to Domoticz they are presented as a "watermeter" ...
Code: Select all
gw.present(CHILD_ID, S_WATER);
... 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
- gizmocuz
- Posts: 2352
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Problem with huge value for "usage"
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
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
Quality outlives Quantity!
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Re: Problem with huge value for "usage"
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 willYou can delete all you want, just shift-click with your mouse on the month/year graph
Christoph
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Re: Problem with huge value for "usage"
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, promisedPlease note, that you are not using the sensors in a normal way, and i do not give any support for this
What about my other question: the inscription on the graphic of my gas sensor says "waterflow". How can I change that one?
Thanks,
Christoph
- gizmocuz
- Posts: 2352
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Problem with huge value for "usage"
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)
Quality outlives Quantity!
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Re: Problem with huge value for "usage"
Hi,
these are the devices: And this is the relevant part of my Mysensors code:
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.
How is it done correctly?
Chris
these are the devices: 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);
How is it done correctly?
Chris
- gizmocuz
- Posts: 2352
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Problem with huge value for "usage"
How do you mean there is no S_Gas ? There is...
Quality outlives Quantity!
- gizmocuz
- Posts: 2352
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Problem with huge value for "usage"
But changing it to gas is also an option
Quality outlives Quantity!
- gizmocuz
- Posts: 2352
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Problem with huge value for "usage"
Take a note of the gas divider in the domoticz settings page
Quality outlives Quantity!
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Re: Problem with huge value for "usage"
Using Arduino 1.6.5 and mySensors 1.5 ...gizmocuz wrote:How do you mean there is no S_Gas ? There is...
Christoph
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Re: Problem with huge value for "usage"
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...gizmocuz wrote:But changing it to gas is also an option
Chris
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Re: Problem with huge value for "usage"
That's set correctly, I think. The resulting numbers are plausible ...gizmocuz wrote:Take a note of the gas divider in the domoticz settings page
Chris
Who is online
Users browsing this forum: No registered users and 0 guests