MQTT isn't picking up messages

I’m playing with the MQTT binding but I can’t get it to work.

  1. setup with raspbian jessie on a raspberry pi 3
  2. mosquitto broker running on localhost
  3. openhab installed with apt-get (mqtt-binding also)
  4. MQTT-messages are being sent by a second raspberry pi (values from my Viessmann boiler --> openv.wikispaces.org)

running in debug, the mqtt-binding seems to be loading and connecting correctly.
However, when I see messages appearing using MQTT.fx on my PC, openhab doesn’t do anything.

example item:

probably a stupid mistake, but I can’t find what I’ve did wrong.

This is a good way to check if you have the correct topic: subscribe to topic # and let MQTT.fx tell you exactly which topic your data are coming in … one source of error less.

latest message on mqtt.fx (I’m subscribed to “#” as you mentioned):

heating/getTempCollector 36.400002

I already removed a leading slash but no luck.

My mqtt number item looks the same like yours,

Number nodeMCU_Temp "nM Temp [%.1f °C]" { mqtt="<[mosquitto:ESP8266/temperature:state:default]" }

so the only idea I have: for testing remove the special characters in [quote=“Bert_Melis, post:1, topic:11920”]
[%.1f °C]
[/quote]

and see what happens …

1 Like

That did the trick!

I couldn’t thank you enough!

I actually don’t know why I have that character in the first place.

Hello Bert,

can you give me some advice on the connection of openv to mqtt?
I can’t find any Information about mqtt on openv.wikispaces.org

Thanks in advance,
Andreas

PS: I can read the values with openv on my Pi, but due to lack of time I still have no connection to openhab yet. As a starting point I found this website (http://www.intranet-der-dinge.de/smarthome/haus/heizung) to connect openv via script and REST API to openhab.

@imhofa It’s fairly simple. I have very limited Linux/Raspbian experience and I managed it within the hour.
I’ll post a short instruction on the forum this evening, in the right section so this topic won’t be hijacked.
a hint: I just use cron/vlient and in the template-file the mosquitto_pub is done.

Back on topic: by removing the special character, I don’t have the “degrees”-symbol anymore on Android. There is this diamond with a question-mark instead.

This
[%.0f °C]
works for me without any problems …

Maybe a problem with the charset encoding?

How do you edit your openhab-files? With openhab designer?

In my sitemap (used on web browser or within Android app) the °C is dsiplayed correctly…
Tonight I can give you my spelling on this topic…

Andreas

I use notepad++ to edit the files on windows. transfer to raspbian using winscp.
don’t know the charset.

I’ve got this funny symbol everywhere I have a temperature number item. Only MQTT seems to have a problem with it.

If It is solved by using a different charset, It would be something less to worry about.

Me too. Using “UTF-8 without BOM” doesn’t give any problems …