What is the best approach to that? I suspect I need to write one or more custom components for ESPHome, but I'm hazy about the right architecture, a.k.a.: which generic component types do I need to implement and on which API stratum do I connect them together to achieve maximum configurability and flexibility?