I am trying to ON/OFF relay using mqtt with openhab.Relay is connected with nodemcu esp8266.Mqtt client is able to turn off/on the led but openhab item is not.
Can you exactly tell me full syntax that I need to add in items.one more question I have configured mqtt from paper UI and status is online.Still I need to add mqtt.cfg under services.
I am stuck here just to turn on/off the relay and can not move forward until this does not resolve.
What you have probably setup via PaperUI is the MQTT Broker Thing.
Next you need to create a Generic MQTT Thing via PaperUI, which connects to the above Broker.
On this Thing create a new Channel of type Swich which subscribes to a MQTT command topic ( most probable something like: esp8266/led_control)
I can’t say which state topic to use your case.