I’ve been struggling to get my Milight remote working per the solutions topic here, and though better to start a new topic vs clutter up the solutions one.
I have been waiting for Milight (also sold as Limitless LED and Easybulb) to release a bridge with support for >4 groups for a while, so I was very happy when recently I came across the ability to make your own Milight bridge with an ESP8266 and nrf radio. Is anyone here doing this? Please post if you are and share some code.
Its working so well for me I thought I would share how to get it running to save others any issues I came across. You do not need to solder and it costs around $10!
I have followed that guide 100%, yet still having issues and think it could be something in my setup. I am running OH2, latest snapshot on Ubuntu Server 16.04.
Mosquitto is running on my machine and I can Sub to all topics like such and see OwnTracks and the Milight remote publishing
mosquitto_sub -v -u openhab -P MYPASS -p 1883 -t '#'
But in my OH2 logs, I see no information that OH2 is even connecting to the Mosquitto broker? I have the 1.11 mqtt binding installed and the mqtt.cfg file looks as follows:
The openhab user and pass is also included in my /etc/mosquitto/passwd file, and for now I also have ## commented out using the password file in my mosquitto.conf file.
So when OH2 starts, shouldn’t I see something in the logs that it is connected to the mosquitto broker?
In trying to troubleshoot more, I see this the mosquitto logs. Is OH2 not connecting to the broker?
1509988890: New connection from ::1 on port 1883.
1509988890: New client connected from ::1 as mosqsub/18993-OpenHab2 (c1, k60, u'openhab').
1509989156: Socket error on client mosqsub/18993-OpenHab2, disconnecting.
Yes, something like:
2017-11-06 10:37:33.627 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2017-11-06 10:37:33.636 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mosquitto'
Maybe your are effected by:
There are stale entries stored in your /var/lib/openhab2/config/org/openhab/mqtt.config coming from previous trials. Currently, you are initiating 2 parallel connections from your OH2.1 installation to the broker. This will create a conflict. Follow these steps to troubleshoot: stop OH2 service (systemctl stop openhab2) delete file /var/lib/openhab2/config/org/openhab/mqtt.config Fix your /etc/openhab2/services/mqtt.cfg broker.url=tcp://192.168.1.44:1883 broker.clientId=oh2 Update you…
Do you have the
MQTT Action addon installed? If yes, uninstall it to see if this helps Can you post the output of the following openHAB console commands: bundle:list -s |grep -i mqtt config:list “(service.pid=org.openhab.mqtt)” The broker connection messages should come from org.openhab.io.transport.mqtt. Did you enable DEBUG on this also?
Finally, thank you!!!
Deleting that old, stale mqtt.cfg file from the var/lib… fixed the issue. Now on a restart I see OH2 connecting to the broker and now see things updating in the log.
I think just need to get the rules setup now and should hopefully be ok with things.
In theory, this story with the stale configs will disappear soon…
Any cfg-file which contains pid:org.openhab.xxxx as a first line will now be considered exclusively for settings for the given pid. Any old entries should thus be removed by the runtime.
I haven’t tested this yet on my Snapshot but it should work.
but it should work.
Alright, time to update then…