I setup openHAB2 and Mosquitto on my Synology NAS.
Everything is working, I can Subscribe an Publish.
I have a ESP8266 with ESP Easy setup and a relay on gpio 4.
But I have some issue with the command to get openhab2,
to turn on/off a Relay. The switch is visible, but nothing happens
when I turn it on/off. My setup looks like this:
Those commands do not use MQTT, but http, so you should first check if your broker and your MQTT connection is working.
You will find a lot of hints for this in other threads …
I’m not sure if this is the main reason, but you’ve said you are using OpenHAB 2, and you have openhab.cfg as an example of your setup. In OpenHAB 2, you should set your MQTT parameters in MQTT.cfg (located in conf/services folder).
MQTTLED is would be the name you give the item in openhab , “led” is the name you see in sitemap , (groups it belongs to) . Bathroomlightswitch is the name of the esp and relay is on gpio5