Hello Forum,
I’m trying to display Values from a BME280 Sensor (attached to Wemos) in OH3 with Mqtt.
Values from DS18B20 and DHT11 work. I have one Channel per Value (temperature and humidity with linked items to the Channels) in OH3.
Mqttfx shows that the BME280 (and the Gosund Plug) communicate and send values, but in the Log I can only see updated Values from the DS18B20 and DHT11. Broker and Thing are shown as online. Latest OH Verion is running on a Raspberry 3.
All attemps show “Null”, not a Value.
The Code of the Thing is:
UID: mqtt:topic:82c4a44cd8:cd178703cc
label: Tasmota 3 BME 280 Thing
thingTypeUID: mqtt:topic
configuration:
payloadNotAvailable: Offline
availabilityTopic: tele/TopicTasmota3BME280/LWT
payloadAvailable: Online
bridgeUID: mqtt:broker:82c4a44cd8
channels:
- id: temperature
channelTypeUID: mqtt:number
label: temperatre
description: “”
configuration:
stateTopic: tele/TopicTasmota3/BME280/SENSOR
transformationPattern: JSONPATH:$.BME280.Temperature
unit: °C
- id: humidity
channelTypeUID: mqtt:number
label: humidity
description: “”
configuration:
stateTopic: tele/TopicTasmota3/BME280/SENSOR
transformationPattern: JSONPATH:$.BME280.Humidity
Can you please help me? I tried it since one Week without success…
Kind reagards, Helmut
Hi hafniumzinc,
- the BME280 Tasmota MQTT Parameters are:
- JSON by Mqtt Explorer (not Mqttfx, sorry) is:
{“Time”:“2021-03-09T13:42:41”,“BME280”:{“Temperature”:17.8,“Humidity”:51.5,“DewPoint”:7.6,“Pressure”:956.5},“PressureUnit”:“hPa”,“TempUnit”:“C”}
Kind regards, Helmut
Yeah, what @rossko57 said: your topic defined in Tasmota is
TopicTasmota3BME280
but your Channels are subscribed to
tele/TopicTasmota3/BME280/SENSOR
Change your Channel stateTopic
s to:
tele/TopicTasmota3BME280/SENSOR
I changed the Values to:
channels:
- id: temperature
channelTypeUID: mqtt:number
label: temperatre
description: “”
configuration:
stateTopic: tele/TopicTasmota3BME280/SENSOR
transformationPattern: JSONPATH:$.BME280.Temperature
unit: °C
- id: humidity
channelTypeUID: mqtt:number
label: humidity
description: “”
configuration:
stateTopic: tele/TopicTasmota3BME280/SENSOR
transformationPattern: JSONPATH:$.BME280.Humidity
Unfortunately still showing
How long did you wait? By default a value is sent only every 5 minutes.
Will log out of openhab and check in 10 min again
Can the default of 5 min be reduced to 1min?
Sure can!
In the Tasmota console, just type
TelePeriod 60
and press Enter
After 10 min (Broker and Thing Online)
Try to type the command in the Tasmota console…
There’s something else wrong then. Can you show a screenshot from MQTT Explorer which shows the JSON string and the full topic that the JSON string is being published to? I suspect it’s not publishing to the tele
topic as you have removed the %prefix%
from the Tasmota FullTopic
Please find attached a Screenshot from Mqtt Explorer
Yep. Either change your Channel stateTopic
s to:
TopicTasmota3BME280/SENSOR
or change your Tasmota Full topic
in the MQTT settings back to its default:
%prefix%/%topic%
My recommendation would be to change the Full topic
back to its default.
How funny…after changing the Tasmota Full topic back to %prefix%/%topic% the Temperature shows for the first time another Value than “Null” …
It shows the JSON PATH…and Humidity is still at “Null”…
Whats going wrong here?
Dear hafniumzinc and rossko57,
I want to say many thanks for your help, I finally made it by keeping a few hours of “head free and thinking”
The Solution was that I replaced the Topics @ the BME280 and Gosund Device by a simple “a” or “b” and then built the Things up new from scratch. Here is the evidence:
The belonging Code is:
UID: mqtt:topic:82c4a44cd8:8db6a4edfa
label: "Tasmota 3 BME 280 Thing "
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:82c4a44cd8
channels:
- id: ChannelBME280Temperature
channelTypeUID: mqtt:number
label: Channel BME280 Temperture
description: ""
configuration:
stateTopic: tele/BME280/SENSOR
transformationPattern: JSONPATH:$.BME280.Temperature
unit: °C
- id: ChannelBME280Humidity
channelTypeUID: mqtt:number
label: Channel BME280 Humidity
description: ""
configuration:
stateTopic: tele/BME280/SENSOR
transformationPattern: JSONPATH:$.BME280.Humidity
unit: "%"
Kind regards and stay healthy,
Helmut