Question: As many people have Sonoff / Shely hardware flashed with new firmware supporting MQTT, what are the options to get the best from the very promising MQTT Generic Thing Binding which supports auto-discovery via the Homie HQTT naming convention?
I’d like this post to constructively discuss the cost/ benefit of the high-level options, not to go through individual config issues - there’s several other threads for that aspect, thanks!
My research this far suggests there are at least the following options…
Stick with the MQTT v1.x binding for now
Minimum change, but no benefits from auto-discovery
(hint: Enable legacy bindings in Paper UI, and keep your existing broker, config, binding)
Use MQTT v2.x binding with manually defined Bridge, Things and Items, translating existing MQTT config
Looks posible, no hardware flashing, but the work to create manual config files needs research, and gives no benefits from auto-discovery
Switch from Tasmota to a Homie-based firmware, and manually configure it on Sonoff/ Shely hardware?
Highest hardware effort with reflashing and significany reconfig, but might give long-term auto-discovery benefits
I’ve not listed the combinations of using an external broker (e.g. Mosquitto) verses the new OH2.0 one, as getting the hardware and binding talking is the interesting bit (I think!).
After getting over the surprise of the amount of change between OpenHAB 2.3 and OpenHAB 2.4, and reading up on the changes, I’m rather impressed with the architectural vision and what it could offer to home automation.
Upgrading from 2.3 to 2.4 changes existing config, leading to a flurry of posts. After some setup effort, I have seen real benefits from the changes.
After re-including Z-Wave Items, Z-Wave seems faster with better device Channel support (Thanks @chris !). I was surprised to see the new v2.x OneWire binding auto-discover all my Things in about two seconds (Thanks Jan N. Klug !). This is impressive as the OneWire v1.x binding took a lot of work to get Items working with config files.
Next on my list was the new MQTT v2.x binding which looked rather complex and full of changes from v1.x. There’s a lot of new documentation, but don’t do as I initially did and jump over the WHY of the changes to try and recreate a v1.x MQTT setup using v2.x! (Hint again: don’t bother - Enable legacy bindings in Paper UI, and keep your existing config)
Here’s a few references to the the ideas behind the MQTT changes which I suggest looking at before upgrading to x2.4.0 so you better understand what is going on:
- Very interesting blog post by @David_Graeff which explains the WHY as well as the WHAT of the changes.
- Explanation of Homie and how it helps with a lack of structure in MQTT messages
- Video of David explaining his work on MQTT v2.0 binding changes at the recent Smart Home Day 2018
I have to say that the goal of auto-discovery of home-brew MQTT device Things sounds like black magic after years of editing config files, but the recent flurry of posts to this community shows there’s a real need for it! Thanks @David_Graeff!
Personally - I don’t have all the answers as there are still a few things to fix on my own OpenHABian install, but I’d love to hear what sets of choices you have had success using Sonoff/Shely/ generic ESP8266 devices with OpenHAB 2.0.