I got rid of all the old MQTT ver 1 stuff. Reloaded everything and installed the upgrades bringing me up to MQTT 2.5. I am trying to set up the BME280 sensor in Paper UI. I have made the main MQTT broker connection in Things and pointed it to my IP of the Rpi. I have set up a generic MQTT connection to the ESP8266 reading the BME280 using the Bridge connection to the main MQTT broker. I click on the Add channel button to add a number value so I can get the temperature reading. I add BME280-1T for the channel ID. MQTT topic is tele/BME280-1/Sensor and the MQTT command topic is cmnd/BME280-1/POWER from the tasmota information shown below.
When I get to the Incoming value transformation line I was entering JSONPATH:$.BME280.Temperature
and it accepted it until I tried to link the channel to the reading on the screen. It pops up with a message box
I thought I had the correct json entry but I guess I don’t and not sure what should go in there.
Here is the screen from MQTT.fx so now I’m really confused on what I should be entering.
Hi, JSONPATH:$.BME280.Temperature is correct.
Do You have all transformation services installed?.
Command topic is unnecessary becouse you only reading value from sensor.
Readings are in strings so if you want to store them in database, this rule will convert it to a number.
rule "MQTT Temperature String to Number"
when
Item MQTTThing_Temperature changed
then
MQTTThing_Temperature_num.postUpdate(Float::parseFloat(String::format("%s",MQTTThing_Temperature.state).replace(' ','')))
MQTTThing_Preasure_num.postUpdate(Float::parseFloat(String::format("%s",MQTTThing_Preasure.state).replace(' ','')))
MQTTThing_Seepreasure_num.postUpdate(Float::parseFloat(String::format("%s",MQTTThing_Seepreasure.state).replace(' ','')))
MQTTThing_Humidity_num.postUpdate(Float::parseFloat(String::format("%s",MQTTThing_Humidity.state).replace(' ','')))
end
Edit:
I was read again your post Chanel must be string typ not number. And You need to add Generic MQTT Thing in Paper UI and all channels should be in it, not in the MQTT Broker
Best Regards
Rafal
H102 I have not tried those other combinations yet. If it’s easier to do the files maybe I should look into that. At this point I’m where I can get things to work but the log files have errors with MQTT. Now that I have moved up to 2.5, the things that worked before now don’t. I have been reading over the help files a lot but things just don’t click. If I can get one sensor to work without errors then the rest should be easier.
Rafal Thanks for the information. I assumed it should be a number since it is a number value being read from the sensor. I will try text and see if that works. I did have the json binding loaded and I was using the Generic MQTT Thing
rule "MQTT Temperature String to Number"
when
Item MQTTThing_Temperature changed
then
MQTTThing_Temperature_num.postUpdate(Float::parseFloat(String::format("%s",MQTTThing_Temperature.state).replace(' ','')))
MQTTThing_Preasure_num.postUpdate(Float::parseFloat(String::format("%s",MQTTThing_Preasure.state).replace(' ','')))
MQTTThing_Seepreasure_num.postUpdate(Float::parseFloat(String::format("%s",MQTTThing_Seepreasure.state).replace(' ','')))
MQTTThing_Humidity_num.postUpdate(Float::parseFloat(String::format("%s",MQTTThing_Humidity.state).replace(' ','')))
end