[SOLVED] MQTT for SONOFF/TASMOTA this is difficult

I think it is done !!!

Deleted content of these tmp and cache folders

and realized by the way that the system is building an additioanl file mqtt.config with this content:
image

So the Openhab.log is now quite clean and shows me only two lines for MQTT.
I assume this is correct?

Yes this is correct

Now on your tasmota:

Benutzer: openhab
Passwort: openhabian

Restart it

says connected (verbunden)

in some other comments I saw people adding commands like:

broker.retain=true
broker.async=false
is this necessary or handled via tasmota already?

No these are not necessary leave them as they are
You are now ready to get data from tasmota via mosquitto to openHAB!!
Well done

Vincent you are the man!!!

Please one last question,

Now both clients are connected to the broker and I can start with the items 

I just think about adding additional sonoffs, how are they separated?

Is it then the topic name as defined in each sonoff?
If Yes where is that reflected in that command example below?

Switch Switch1 {mqtt=">[broker:myhome/bedroom/switch1:command:ON:1],>[broker:myhome/bedroom/switch1:command:OFF:0],<[broker:myhome/bedroom/switch1:state:ON:1],<[broker:myhome/bedroom/switch1:state:OFF:0"}

This sonoff that we have just configured has the topic of sonoff1

So your item becomes:

Switch Switch1 {mqtt=">[broker:cmnd/sonoff1/POWER:command:*:default],<[broker:stat/sonoff1/POWER:state:default" }

See:

I am having trouble getting proper binding from MQTT broker (eclipse) to Openhab2.3 . Both are installed as docker containers inside Synology 6.2. Both containers IP set as net=host.
I just want to control 2 tasmota flashed Sonoff basic with openhab. Not even out of the gate with the first one.

I followed the posts in this thread but have been unsuccessful.

my mqtt.cfg is:
broker.url=tcp://192.168.1.113:1883
broker.user=“openhab”
broker.pwd=“openhabian”

My first sonoff configuration:
host: 192.168.1.113
port: 1883
user: openhab
password: openhabian
client-id : sonoff1

What am I doing wrong?

Remove the quotes in the mqtt.cfg:

broker.url=tcp://192.168.1.113:1883
broker.user=openhab
broker.pwd=openhabian

Thank you.
This is my log after a restart after taking out the quotes:

2018-09-25 07:18:17.534 [INFO ] [er.internal.HomeBuilderDashboardTile] - Started Home Builder at /homebuilder
2018-09-25 07:18:18.524 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to ‘Asia/Kuala_Lumpur’.
2018-09-25 07:18:18.526 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to ‘en_SG’.
2018-09-25 07:18:19.072 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.1.113:8080
2018-09-25 07:18:19.076 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.1.113:8443
2018-09-25 07:18:22.659 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2018-09-25 07:18:23.478 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2018-09-25 07:18:23.626 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2018-09-25 07:18:23.678 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2018-09-25 07:18:23.873 [WARN ] [penhab.io.transport.mqtt.MqttService] - Unrecognized property: broker.clientid
2018-09-25 07:18:23.873 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2018-09-25 07:18:23.874 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection ‘’
2018-09-25 07:18:24.139 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection ‘broker’

Yeah it’s working

1 Like

What is the error that says unrecognized property:broker.clientid?
Do I need to add a broker.clientId line in my mqtt.cfg?

It’s only a warning.
Show me your mqtt.cfg. All of it.

This is all of my mqtt.cfg

broker.url=tcp://192.168.1.113:1883
broker.clientId=XPE6
broker.user=openhab
broker.pwd=openhabian

I just saw an error in my log:

2018-09-25 08:00:02.563 [ERROR] [org.apache.felix.configadmin ] - Cannot use configuration org.openhab.mqtt for [org.openhab.core.scriptengine.action.ActionService, org.osgi.service.cm.ManagedService, id=318, bundle=200/mvn:org.openhab.action/org.openhab.action.mqtt/1.12.0]: No visibility to configuration bound to mvn:org.openhab.io/org.openhab.io.transport.mqtt/1.12.0

Clear the cache see: