I’m trying to set up 3 sonoff devices with an openHAB on a raspberry pi.
I have an airport xtreme with a wifi network.
cable-connected an rPi2 to it with a netwerk cable.
wifi-connected 3 sonoff dual R2 devices, there’s tasmota 220.127.116.11 running on them.
and my macbook is connected to that wifi.
I’ve installed the openhabian rpi version on the rpi.
Because I ran into the same problem yesterday, I thought, I will start fresh, I must’ve done something wrong.
Let it install itself successfully overnight and got back at it this morning.
sudo apt-get update
sudo apt-get upgrade
to start with.
then I opened the openHABian Configuration Tool
sudo openhabian-config and installed Mosquitto.
I also selected & executed the update & upgrade functions from the configuration tool.
My sonoff devices are already configured with the ip, username/password for an MQTT so when I opened op the loggin of mosquitto, then had already connected to it and announced their functions.
Then I followed the guide, used the standard UI and continued (https://www.openhab.org/docs/tutorial/uis.html) to use the paperui to setup a thing.
In addons>bindings, I searched for “MQTT” and installed “MQTT Binding 2.4.0”.
I went to the inbox and clicked the + sign, it searched for a couple of seconds and then said “Thing not found. Manually add a thing?”
So I clicked “Manually add thing”.
I saw “MQTT broker” and added this.
I was able to add the broker hostname (localhost)
and under the “show more” section I was able to fill in the username & password.
I saved this and I had under configuration I now had an MQTT Broker which showed “online”.
When I checked the mosquitto logging I saw:
1548760473: New connection from 127.0.0.1 on port 1883.
1548760473: New client connected from 127.0.0.1 as paho49039595405949 (c1, k60, u’openhabian’).
So, from this logging, I expect my MQTT plugin to be linked to Mosquitto and thus my Openhab to be setup for adding new devices.
But, when I scan for new things, it show nothing.
So, I googled arround, I found a lot of people with the same problem but the resolutions were “openhab 1.x requires manual adding of cfg files for MQTT bindings”. But I’m on openhab2, and when I read the manual, it says that this is now done automatically. But I did read through everything I can find and I understood that normally a mqtt.cfg file should be created. But when I check the /etc/openhab2/services/ folder, there is no mqtt.cfg file.
And this is as far as I got. Yesterday I reached the same point. After a lot of searching, trying, (as I already said above) I reinstalled the raspberry pi with a fresh OpenHabian. Again, reaching this point.
- Platform information: Raspberry Pi
- Hardware: Raspberry Pi 2 Model B Rev 1.1
- OS: openhabianpi-raspbian-201804031720-gitdba76f6-crc9e93c3eb.img(1)
- Java Runtime Environment: openjdk version “1.8.0_152”
- openHAB version: openHAB 2.4.0-1 (Release Build)
- Issue of the topic: OpenHAB2 doesn’t show MQTT devices