Page 2 of 2

Re: Problem with huge value for "usage"

Posted: Tuesday 29 March 2016 19:19
by gizmocuz
.... update to the latest mysensors version ?

https://github.com/mysensors/Arduino/bl ... yMessage.h

Re: Problem with huge value for "usage"

Posted: Friday 01 April 2016 23:42
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

Re: Problem with huge value for "usage"

Posted: Saturday 02 April 2016 12:47
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