I thought after 4 years of OH usage I am familiar with everything, but today I ran into an issue which drives me crazy…
I run OH 3.4 with Mosquitto MQTT broker, I already use a lot of MQTT states and commands as I have a lot of Tasmotas runnig.
Lately I installed EVCC on another Pi and connected it with my mosquitto, which actually works flawless. For example, I am interested in a special topic called evcc/site/tariffEffectivePrice:
Now what happens is, this item is not updated according to the values I can show with mosquitto-sub. Instead, it is slowly “growing” some digits behind the comma:
2023-05-12 13:48:28.512 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'EVCC_EffectivePrice' changed from NULL to 0.080002
2023-05-12 14:45:26.059 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'EVCC_EffectivePrice' changed from 0.080002 to 0.080003
2023-05-12 15:01:53.145 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'EVCC_EffectivePrice' changed from 0.080003 to 0.080004
2023-05-12 15:20:56.094 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'EVCC_EffectivePrice' changed from 0.080004 to 0.080005
2023-05-12 15:29:25.979 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'EVCC_EffectivePrice' changed from 0.080005 to 0.080006
2023-05-12 15:40:15.906 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'EVCC_EffectivePrice' changed from 0.080006 to 0.080007
I repeated the same procedure declaring another item as a string and mapping it to another channel with the same topic, but it behaves exactly the same.
Any ideas why the item is not updated to the values I see when subscribing to it via the command line? It seems to me that OH is adding or integrating the values internally.
Screen shots are a problem on the forum. They can’t be searched, copied/edited/pasted, and on small screens they can’t even be read. Where it’s available always click the “Code” tab and paste the contents using code fences so we get the full config and context.
```
code goes here
```
For an example of what’s missing here that we’d see in the code is what type of Channel this is.
Seeing the full code might also help us answer that. With the given information . It might help to see what values are being posted as well. And knowing what they are posted as (number, String, binary, etc.).