bertmelis/VitoWiFi

Callback with old value after write datapoint

maihacke opened this issue · 8 comments

I create a bridge between vitowifi and openhab via mqtt.
Therefore I implemented a method which publishes all read values via mqtt as global callback.
Therefore I call readAll values in the esp loop. Then the global callback of vitowifi publishes all values via mqtt. That works quite well.
For writing thr sketch listens to mqtt and call writeDataPoint accordingly.
The problem is, that immediately after the write the global callback is called with the old value and this outdated value gets published via mqtt.

Is there a reason why vitowifi calls the callback with the old value after a write? I think the callback should not be invoked at all for writes.

What do you think?

It shoudn't return the old value but the newly written value. If not, it's a bug. (KW or P300 protocol?)

If it returns the newly written value, you get a confirmation that the heater accepted your action.

I could also completely disable but then you'll have to reread it yourself for confirmation.
(I'm working on an update which also includes an onError()-callback)

Im using KW. I will double check what happens and report it here.

It was just an error in my type conversion logic.
Btw: Thanks for this cool project.

@maihacke nice idea, do you like to share your code ?
Have a nice day
f

Code is here: https://github.com/maihacke/vitohab
Please notice it is heavily in progress.
Writing is not ready yet...

Thank you very much. I'd like to have a red-only device at the moment.

I will write a readme for openhab item definitions etc when I find the time...

For the record: there's an example in issue 45.

I'm running a service on my RPI3 (Raspbian latest) with the code in this repo: Mqtt2InfluxDB