Number PrusaMk3_Temperature_Tool0 "Temperature [%.1f °C]" (PrusaMk3) { mqtt="<[mymosquitto:octoprint/prusaMk3/temperature/tool0:state:JSONPATH($.actual)]" }
But all I’m getting in the logs is:
2018-08-19 23:41:31.553 [WARN ] [b.core.events.EventPublisherDelegate] - given new state is NULL, couldn't post update for 'PrusaMk3_Temperature_Tool0'
2018-08-19 23:41:36.559 [WARN ] [b.core.events.EventPublisherDelegate] - given new state is NULL, couldn't post update for 'PrusaMk3_Temperature_Tool0'
Not sure what I’m missing, could just be a typo somewhere but I’ve been over it again and again. Any ideas?
I assume that you have other items configured with the mqtt binding and they work correctly.
Do there error messages occur when a message is received. I mean do they occur at the same time as in your test subscription?
I did a quick and dirty test and it works for me:
I used exactly your item definition
and I was sending the Json via node-red through mqtt but that should not make a difference
2018-08-20 01:47:04.209 [vent.ItemStateChangedEvent] - PrusaMk3_Temperature_Tool0 changed from NULL to 24.9
2018-08-20 01:48:18.327 [vent.ItemStateChangedEvent] - PrusaMk3_Temperature_Tool0 changed from 24.9 to 24.6
Maybe a quick clearing of the cache will make it work… Maybe…
Will try the cache clearing in the morning (can’t at the moment, as if I stop openhab then the house alarm complains about it and don’t want to wake the mrs up! )
I do have other stuff using mqtt and thats all working fine. The error messages do coincide with the test subscription.
What version of openhab are you running? I’m on 2.3.0.
I am running snapshot but it shouldn’t matter the mqtt binding and the jsonpath transform are really mature.
Have your tried another jsonpath on the same message?
Number PrusaMk3_Temperature_Tool0 "Temperature [%.1f °C]" (PrusaMk3) { mqtt="<[mymosquitto:octoprint/prusaMk3/temperature/tool0:state:JSONPATH($.target)]" }
for example?
Also have you tried to get the whole string to check the received message?
I actually ended up just re-installing openhabian (I was on a very old version and it was all a little broken), and with a fresh install and the same config files it all works. So thanks for trying it out Vincent, seems it was just my screwed up installation.
And have some of it graphing in grafana. I may also put in failed and cancelled printing status, and need to trigger an alert so I can see the format that that produces (doesn’t mention it in the API docs).
Done a quick rule to hopefully broadcast a barking dog to all my google homes. Will find out if it works when my 4.5 day print finishes.