this points to the direction that this is an auto-generated clientId (using the processId and the hostname)
I am not sure if it’s coming from the openHAB2 mqtt binding connection… maybe it is (looks like it)
Something seems to be sending an empty clientId on a second connection…
I found the following info:
Yes…
It should be ( | ) due to CVE-2017-7650. Since Mosquitto 1.4.12, clients are not allowed to have a ‘#’, ‘+’, or ‘/’ in their username or client id.
...
1500717721: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1500719450: Client openHAB2 disconnected.
1500719522: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1500719565: New connection from 127.0.0.1 on port 1883.
1500718948: mosquitto version 1.4.14 (build date Mon, 10 Jul 2017 23:48:43 +010$
1500718948: Config loaded from /etc/mosquitto/mosquitto.conf.
1500718948: Opening ipv4 listen socket on port 1883.
1500718956: New connection from 10.0.0.104 on port 1883.
1500718956: New client connected from 10.0.0.104 as DVES_A7F83D (c1, k15, u’ope$
1500719029: New connection from 127.0.0.1 on port 1883.
1500719029: New client connected from 127.0.0.1 as openHAB2 (c1, k60, u’openhab$
1500719556: New connection from 10.0.0.100 on port 1883.
(the last connection is from MQTT fx)
After that I tried to publish the command at MQTT.fx but no response:
2017-07-22 07:33:33,040 INFO — MqttFX ClientModel : attempt to add PublishTopic
2017-07-22 07:33:33,041 INFO — MqttFX ClientModel : sucessfully published message to topic cmnd/sonoff-abajur/POWER off (QoS 1, Retained false)
1500719565: New connection from 127.0.0.1 on port 1883.
1500719565: New client connected from 127.0.0.1 as openHAB2 (c1, k60).
1500720088: New connection from 127.0.0.1 on port 1883.
1500720088: New client connected from 127.0.0.1 as mosqsub|7105-openHABian (c1, k60).
1500720244: New connection from 192.168.178.160 on port 1883.
[quote=“Dim, post:28, topic:31993”]
no response from what? (OH2 or the Sonoff?)
[/quote] no response from Sonoff. I don’t know how to see if could be any chance on OH2. But the log is below:
Hello, jumping in here because of the mentioning before.
Pay attention to the first topic level: cmnd vs. stat - that’s something I personally don’t like about the Tasmota default settings. This order can btw be changed in settings.
The config is in sync with what I’ve given as a template here.
Sooo from what I’ve read we are looking at two problems here. Why is there an additional connection with the clientID mosqsub|1234-openHABian and why is your openHAB not able to receive states and send commands.
The additional connection is not present on my system
I feel like both of you should take a step back. For example in your posting the Client Id = OH2MQTT - Do you know what this means? Your setting doesn’t make much sense, you should just leave it with the default setting. Next your Topic setting. Why sonoff1? Give it a meaningful name, something you can work with (e.g. “sonoff-coridorlight”, not too long, no underscore).
Your config looks okay. You can again leave the client Id setting commented to have a random one generated. I take it your broker doesn’t provide authentication? If you’ve installed via openHABian setting up a password was offered.
After you’ve set up everything do a test. You could for example restart openHAB, then wait a few minutes and check the log for mqtt related messages. It should look similar to this one: