Migrating MQTT1 items to MQTT2.4 items

For now it works like a charm

Cool then could you change your post above to:
“This is now my working settings”

Thanks

I am working on migrating my MQTT1 items to MQTT2.4 and it is going pretty well .

Nevertheless, I am stuck migrating some items that required a JS transform call like this

String Location_Den_Samsung "Owntracks Location Den Samsung [%s]" <mqtticon> {mqtt="&lt;[mymosquitto2:owntracks/denis/samsung:state:JS(mqttitude-coordinates.js)]"}

So when I enter

JS(mqttitude-coordinates.js)

in the Incoming value transformation field of the Configure Channel form in Paper UI I always get an error on my Generic MQTT Thing that says

Status: OFFLINE - CONFIGURATION_ERROR Remove and recreate: mqtt:topic:ff8e91b4:Test

What should I write there ?

You should write:
JS:mqttitude-coordinates.js

2 Likes

Yes ! Thank so much for the hint! All my MQTT migration is now done and working very well.

I am SUPER new to this and with very little tech background.
Was struggling with codes and such; searching for conig files (:grin: I am on OpenHAB 2.4 LOL)
Your post sorted it out for me;Sonoff Tasmota running like it should…a Charm!

getting this error with my setup not sure whats wrong it reading but not getting temp in

2019-01-20 15:39:53.111 [WARN ] [eneric.internal.generic.ChannelState] - Incoming payload ‘{“Time”:“2019-01-20T16:39:53”,“DS18B20”:{“Temperature”:17.9},“TempUnit”:“C”}’ not supported by type ‘NumberValue’

state:JSONPATH:$.DS18B20.Temperature

JSONPATH:$.DS18B20.Temperature

1 Like

thanks for that another typo from me been trying for 2 days to get that working

@Sascha_Billian Not like it matters but there should be an opening square bracket [ after the > and before mosquitto I think. I tried to compare your before and after items entry with mine and spotted that little difference.

1 Like

Thanks. Must have been only a typo since my MQTT on OH 2.3 was running without any issues.
Anyway i’ve corrected it

Hi there, i am trying to Setup my new Installation with mqtt2.4, till now i just used the old one with textual config and worked fine. I used map Transformation to transform 1 to on and 0 to off on the Incoming value and now i dont know how to do this in paper ui. is it even possible?

Always get the following error:
Command '0' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.0

Thanks in andvantage

Hi!

Do I need to install the “MQTT Embedded Broker” via Misc in Paper UI or is it enough to install only the mqtt binding posted in first thread?

The MQTT binding is NOT a MQTT Broker!
For the use of MQTT Messages you need a MQTT Broker, the “MQTT Embedded Broker” is one (but not the only one).

1 Like

I could setup by copying data from my old MQTT items for my sonoff TH03 sensor SI7021 for temperature but unfortunatelly not for humidity - Any Idea what i do miss, I tried the channel setting for text, number and percentage - all seems not working for humidity.
For the temperature is use “number”.

This is the non-working channel setting for the humidity
image

and this is the working setting for the temperature

This are my items:
Number TH03TEMP {channel=“mqtt:topic:TH03TEMP:TH03TEMP”}
Number TH03HUM {channel=“mqtt:topic:TH03HUM:TH03HUM”}

and this is my sitemap for the both entries:
Text item=TH03Temp label=“TH03Temp [%.1f °C]” icon=“temperature”
Text item=TH03Hum label=“TH03Hum [%.1f %% ]” icon=“humidity”

I would use a Number channel for humidity as the values sent from Tasmota are 0-100
Did you verify by using an MQTT monitor that the humidity data is being sent?

Sorry, I don’t know how to use a mqtt monitor.
I just did copy the values from my old mqtt items and there humidity was working.
Same I did for the temperature and here it is working. Therefore I am a bit lost.
Yes, number I also tried first because number is working for temperature as well.

If both sensors are at the same sonoff device, the thing-name should be the same.
Sou are using the channel “mqtt:topic:TH03TEMP:TH03TEMP” for the temperature, that would suggest a thing-name of TH03TEMP, according the used stateTopic I would think the name is “TH03”. But since you do get temperature readings lets assume your channel is correct. The humidity sensor should be using the same thing-name.

I was creating 3 things for the TH03 and the sensor S7021 attached, one for the switch, one for the temperature and one for humidity. For each I was adding one channel.
Currently the switch and temperature are working.
You suggest to use the thing for temperature, and add a second channel for the humidity to that temperature thing, right?

I suggest one thing for the THING. The sonoff is one thing. One physical thing. One piece of hardware.
Then add 3 channels. The switch, the temperature and the humidity to that one thing.

This will help you manage your things. One piece of kit = One thing.

1 Like