MQTT broker installed in things on OpenHab and Online
In Configuration / Services I can also see " MQTT Embedded Broker (org.eclipse.smarthome.mqttembeddedbroker) available.
I want to add the Sonoff switch and have it visible in the Paper UI but via the config files (Items, things or maybe both needed?) but I am not sure what code to add in these files.
Once this is available, I would like to add this to a rules file where I can read the state of the added Sonoff and also send commands to it if needed but also I am not sure what to add.
I have the Topic of the sonoff that I use Sonoff_BBB and I am able to add this as item and thing via the
MQTT things bindings and Generic MQTT Thing (manually) but I would like to have those only created via the config files in order to have better control and expand the items / things in the future.
PS: yes I’ve installed Mosquitte when installing openHab on the PI but I dont think it’s in use (unless it’s the embedded one) and yes my broker is online and tried MQTT.fx to connect to it etc.
Please stay simple and give me a brief example.
I appreciate your help in advance
Did you try the search function? Searching for " sonoff tasmota mqtt files" I get this thread.
Your description is unclear, what mqtt broker did you install. You need EITHER the embedded mqtt broker OR mosquitto!
Additionally you need a broker thing (which acts as bridge between the mqtt broker and openHAB). It sounds as if you migth have that already.
Once you have setup mqtt things and linked items ( either via file or via via PaperUI) they will show on PaperUI!
EMbedded brocket
and yes as decribed above I have the MQTT broker installed in things.
Do I need to search in it after inputting the code ? I estimate that it should be automatically generated from the config files
If you have the broker thing setup (this one does not need any channel), you can create generic mqtt things for your devices. They need the mqtt broker thing as the bridge and do need the creation of channels. No things will be created automatically!
When I add a chennel to the SOnof_Code with the following in the configuration:
stat /sonoff_test/power and cmnd/sonoff_test/power the MQTT thing will become offline saying No MQTT client
Why don’t you have a look onto this documentation page. It is for the 2.4 Version and shows how to Setup the MQTT Broker Thing and MQTT Generc Thing in a file (scroll down to the end).
Note: Your used version of the MQTT binding has a bug, whenever you change the setting of the MQTT Things you need to restart (either only the MQTT Bundle or openHAB). That migth explain why your things go offline when creating a channel.
I am using this Version as well!