Topic consolidation

There are decisions you can make now that might make that whole effort easier in the long run. For example:

  1. If you choose MQTT as the transport for messages from your DIY devices (and there really is no reason not to unless you are looking at using LORA or some exotic RF medium instead of TCP or UDP) if you spend a little bit of time to make your devices follow either the Homie or the Home Assistant standards for topics and messages openHAB will be able to automatically discover them and create the Things for you. Then you can use “Create Equipment from Thing” to create all the Items for a given device in one go.

  2. Using the MQTT Event Bus (see Marketplace MQTT Event Bus) all you’d need to do is create the Items in OH and configure your devices to pub/sub to the right topics. You won’t even need Things.

  3. See OH 3 Tips and Tricks 's Buying in Bulk sections for other ways to quickly create a bunch of similar Things in cases where automatic discovery isn’t possible (though auto-discover is always going to be a lot less work).

If you choose to use ESP8266s (I think these work for ESP32s too) be sure to look into some of the FOSS firmware like Tasmota, ESPEasy and others as many of these have support for Home Assistant’s (maybe Homie too now, it’s been awhile since I’ve looked) MQTT standard out of the box so all you need to do is configure the sensors and actuators and all the communication stuff is basically done for you. Tasmota even has an admin server to make updates and bulk configuration easier which might be attractive if you have a lot of these devices you want to manage all at once.

If you are running off of SBCs like Raspberry Pis, I believe that Homie has some standard Python and C libraries that could be used.

Since you’re building these yourself, you have the opportunity here to save yourself a lot of time and effort on the openHAB side of things and possibly on the device side too.