Do you have MQTT binding 2.x installed or 1.x? mqtt.config can only be used in connection with the (legacy) 1.x binding. Check in PaperUI under Bindings which version you have installed.
You shouldn’t need the mqtt.cfg for the 2.x binding. BTW the cfg files are auto created when you install a binding that can be configured you should never have to create this yourself.
Delete the mqtt.cfg file, if you want to use text files then use the example below to create a things file. Change the names to suit your needs. The things below the Bridge are a sonoff basic with temp and humidity reading.
mqtt.things
Bridge mqtt:broker:pibroker "pibroker" [ host="192.168.0.30", port=1883, secure=false, username="your_name", password="your_password" ]
{
// Sonoffs
Thing topic sonoff11 "Sonoff11" @ "Living Room" {
Channels:
Type switch : power "Power" [ stateTopic="stat/sonoff11/POWER", commandTopic="cmnd/sonoff11/POWER" ]
Type number : temperature "Temperature" [ stateTopic="tele/sonoff11/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature" ]
Type number : humidity "Humidity" [ stateTopic="tele/sonoff11/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity" ]
}
}
Thanks. Finally redid the entire installation and did using PaperUI and now it seems working. Thanks for the help.
Now let me start with more stuff than just a switch.
I want to do a water level monitor using ultrasonic sensor. Any useful project links?