New MQTT Connection

Hi all, I have a mqtt conundrum. I have setup a Wemos D1 with a water sensor. Tied it to wifi and mqtt. And have not been able to get it connected into openhab. This is what I have…

These are the mqtt results from mqtt explorer, sorry, dont know how to embed these…
https://photos.app.goo.gl/jdJRSA4gahVoC3Vk8

https://photos.app.goo.gl/9CgXyT2HjfshhQDn7

https://photos.app.goo.gl/wygRL2goG2FJxkFp8

https://photos.app.goo.gl/dHhCiZ9eBWjSdKsTA

https://photos.app.goo.gl/KrF5eG3bA3k41N9R7

It shows the topic etc.

/waterflow_sensor/water

In openhab I created a generic mqtt thing, and added this as the topic:
mqtt:topic:mqttbroker:waterflow_sensor

That connects just fine.

I then added a channel and this is where I get sideways. I created the channel with the following code:

UID: mqtt:topic:mqttbroker:waterflow_sensor
label: Water Meter
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:mqttbroker
channels:
  - id: waterflow
    channelTypeUID: mqtt:number
    label: Farm Water Flow
    description: ""
    configuration:
      stateTopic: tele/waterflow_sensor/water

Created an item with the following name:

WaterMeter_FarmWaterFlow

That stays null and does not update in the log. Also, I did not add any json transform.

As I mentioned, I had the value coming in at one point but now cannot duplicate it. But I am sure there is an issue with the channel.

Thanks!

Well, you say that with MQTT Explorer your topic is:

But then in your Thing Channel you’ve got your topic as

Which doesn’t match.

1 Like

Welcome to the fun of home automation

I assume nothing are your running TASMOTA?

Press the windows key + shift + s
to use sniping tool then when curser is in text box on forum press ctrl + v

Now to your topic structure


What value is in the purple space is it one space or 10 spaces.

You probably need a transformation pattern depending on what it says in messages

This is an example of a temperature sensor.I have with tasmota

    configuration:
      stateTopic: tele/Bedroom/SENSOR
      transformationPattern: JSONPATH:$.DHT11.Temperature
1 Like

thanks @hafniumzinc you are correct on the tele. This was not tasmota and it uses tele.

/waterflow_sensor/water

worked great.

now i have problem with the unit not recording water coming through it. oh boy…

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.