Hello! I have a large ESPHome config, comprising of a bunch of parts: a ble_client w/ connect & disconnect with multi-step automations, 10 sensors & binary sensors, and a sensor.ble_client with a lambda which parses and populates the template sensors.
I’d like to wrap this up into a custom component, but I’m finding it non-trivial to write it in CPP, as I’m using a bunch of delay & throttle statements in the automations & template sensors.
Is there a way to write a component that creates components from existing yaml & defines lambdas?
Why do you want a custom component? Which problem will that solve? If you want to hold a better overview of your yaml’s you can use local packages Configuration Types — ESPHome
Wow, I didn’t know I could do that! I think I can make it work using that approach.
I do have one thing I’d like to do: define several sensors, binary_sensors, and a ble_client. Can I have a single include that merges into all those sections? Or do I need to have 3 separate includes?