I have succesfully setup a pulse counter with espeasy. It can send different values via MQTT to my mosquitto broker. Like Total count of pulse or just the one pulse it detects each time. My main problem is that when I have to reboot the espeasy during the day, the total pulse count for that day is gone (I’m measuring my watermeter).
I noticed there is a setting that can operate a Delta value:
I tried setting it to 1. I was hoping that whenever the mqtt client on the espeasy is sending payload 1 to the broker, the OH thing would take the sum of both.
Whenever a pulse is detected this is what is sent:
How could I count these pulses in my OH2 thing? I’m using a rule on the espeasy device to have it reboot every night at 0:00h That way a new day starts and I can start counting again.
@David_Graeff is it possible to change the text in the Thing description to capital letters? It is quite confusing at the moment because when you use it like it says, it is not working.
A number/dimmer channel can receive Increase/Decrease commands and computes the target number by adding or subtracting this delta value.
to
A number/dimmer channel can receive INCREASE/DECREASE commands and computes the target number by adding or subtracting this delta value.
Using it like in the description obviously doesn’t work:
[ab.binding.mqtt.generic.ChannelState] - Incoming payload 'Increase' not supported by type 'NumberValue'
Hi @rossko57@David_Graeff , yes it goes over 100 as it is a NumberValue and not a Dimmer. What I don’t understand is why it gives an extra number after the comma.
[vent.ChannelTriggeredEvent] - mqtt:systemBroker:LocalMosquitto:WM triggered INCREASE
[vent.ItemStateChangedEvent] - WaterMeter_Daily changed from 0 to 1.0
[vent.ChannelTriggeredEvent] - mqtt:systemBroker:LocalMosquitto:WM triggered INCREASE
[vent.ItemStateChangedEvent] - WaterMeter_Daily changed from 1.0 to 2.0
Can you explain some other things too? I created a pull request to document the INCREASE/DECREASE command in capital letters. But even if you don’t fill in the Delta value, sending payload INCREASE always counts 1.0 to the current value. From a Dimmer perspective I can understand it but what if you want to count pulses coming from ESPEasy and for example want to count with 0.01 per step. The description says the Delta value also counts for a Numbervalue.
I also discovered a bug whilst experimenting with this:
That’s the default yes. That’s why you can define the delta value. Every decimal can be used. Just be careful with the decimal point. In a German local than needs to be a comma for example.