Hi ladislav.
...Mysensors device sometimes asks to previous value. I think it gets the previous value from "73_WaterCalculator.pm" which is multiplied by 2...
I think the device WaterCalculator doesn't change readings of its source device by default. It just catches the events as defined, performs lots of sophisticated calculations with the event's value and writes the results into the readings of the WaterCalculator-device.
I guess there could be two reasons why your volume gets doubled:
1) you have set up any other device in FHEM what changes "volume35" - e.g. a notify, DOIF etc.
2) there could be a multiplication by 2 inside your sketch or oldvalue gets added to newvalue etc.
You could check that if you disable your WaterCalculator temporarily by
attr <YourWaterCalculator> disable 1
power down your MYSENSOR-device, set your value135 to a specific one (e.g. 111)
setreading MYSENSOR_35 value135 111
and repower/ reboot your MYSENSORS device.
If volume135 doubles again (222), the problem could be 2), if not pls. check if you have any device defined which interferes with volume35 e.g. by
list DEF=.*volume35.*
When the problem comes out of the sketch you could create a new post in the MySensors subforum (
https://forum.fhem.de/index.php/board,96.0.html).
Kind regards
rob
details are more MYSENSOR related and off topic here
My water counting device is even a MYSENSOR thing. I flashed the water counter sketch taken from the MySensor's page. In my case it behaves like that:
- powering/ rebooting - device catches last value from controller (FHEM device)
- device sends value = caught value and sketch information
- device works with that value as a offset and adds new counts to that value as soon as the real counter changes (new pulses)
- volume gets just calculated inside the sketch (value multiplied by factor, because 1 pulse is usually not 1m³ - factor means therefore: how many pulses does it need to get 1m³)
- when I have to correct value, I have to power down my device, set reading by
setreading <MySensorsDevice> value11 1234
and repower my device - value and volume appear a few seconds later in FHEM