Problem with huge value for "usage"

Moderator: leecollings

User avatar
gizmocuz
Posts: 2484
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"

Post by gizmocuz »

.... update to the latest mysensors version ?

https://github.com/mysensors/Arduino/bl ... yMessage.h
Quality outlives Quantity!
hyla
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"

Post by hyla »

Hi,

I was somehow a bit reluctant to use a library, whose makers warn You:
"should only be used if you like living on the edge and are prepared to update sensor/gateway code frequently"

;)

Anyhow. So now I swapped V1.5 with V2.0 beta of MySensors. I am using the "MockMySensor" sketch which
unfortunately doesn't contain an 'S_GAS' child. So I re-wrote the 'S_WATER' child, replacing each "water" by "gas":

Code: Select all

#define ID_S_GAS                 34

[...]

#ifdef ID_S_GAS
MyMessage msg_S_GAS_F(ID_S_GAS, V_FLOW);
MyMessage msg_S_GAS_V(ID_S_GAS, V_VOLUME);
#endif

[...]

#ifdef ID_S_GAS
  Serial.println("  S_GAS");
  present(ID_S_GAS, S_GAS, "Gas Level");
  wait(SHORT_WAIT);
#endif

[...]

#ifdef ID_S_GAS
  gas();
#endif

[...]

#ifdef ID_S_GAS
void gas() {

  Serial.print("Gas flow is: " );
  Serial.println(map(randNumber, 1, 100, 0, 150));

  send(msg_S_GAS_F.set(map(randNumber, 1, 100, 0, 150)));

  Serial.print("Gas volume is: " );
  Serial.println(map(randNumber, 1, 100, 0, 150));

  send(msg_S_GAS_V.set(map(randNumber, 1, 100, 0, 150)));

}
#endif

I guess You are familiar with the MockMySensor project ...

Anyway, it does not seem to change anything. The display I get is exactly as it is with registering the gas-sensor as 'S_GAS' and then change that in Domoticz.

The graph's legend is the same too.
An idea what I may have done wrong? :)

Ah ... do I have to reflash the gateway as well? I did not do that ...

How compatible are V1.5 and V2.0 beta compiled firmwares anyhow?

Christoph
User avatar
gizmocuz
Posts: 2484
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"

Post by gizmocuz »

It does not help sending random values

Look at the watermeter sketch, and change this to a dummy gas sketch
send 123.456 as the gas meter value
make sure in domoticz it reads also 123.456
The default gas meter devider value is 100, keep it on 100

Once you got this working, then i would continue modifying the sketch to a real working sketch
Quality outlives Quantity!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest