Tl;dr at the bottom.
Hi, I have the following setup:
I have two sorts of lights, one is from Busch Jaeger and controlled by this binding through OpenHAB on a Raspberry Pi, and the other ones are from OSRAM.
My goal is, that I can switch on one of the lights and the other ones get switched on as well.
Since the OSRAM lights are not supported by OpenHAB, I installed Home-Assistant on another Raspberry Pi and control them from there.
I connected the two systems via MQTT, using Mosquitto as a broker which is set up using openhabian-config on the OpenHAB-Raspberry Pi.
I then created corresponding switches in OpenHAB and Home-Assistant using this guide which works.
I then created some rules on the OpenHAB and Home-Assistant setup that links the created and actual switches in each instance, so that when I turn on the Busch Jaeger lights it goes the following: Wall switch > Busch Jaeger > Representation of the lights on OpenHAB > created switches in OpenHAB > MQTT > created switches in Home-Assistant > actual switches in Home-Assistant > OSRAM lights are switched on.
This all, despite being complicated, works without a problem and as intended.
My only problem is that MQTT only works half of the time. The other time it just doesn’t trigger the switch in the other setup and I don’t know why.
Is there any way to make MQTT more reliable, so that it “fires” every time, or do you have a completely different solution for this setup? It actually works really well so I don’t really want to change it, but if it is impossible to make MQTT more reliable, I don’t mind setting this up differently.
Just FYI, this is set up on two completely new Raspberry Pis so I can scrape the whole things if necessary and nothing is lost.
Tl;dr MQTT only works half of the time, why?