I’d be interested in an integration with Lego Powered up components. There’s an official API https://lego.github.io/lego-ble-wireless-protocol-docs/ and a Python library for it already: https://virantha.github.io/bricknil/
Two years ago… Any update about integration?!
Please please please can someone, way smarter than me, do this now we have Bluetooth in HA? My partner is obsessed with Christmas and has a Lego train which goes round the Christmas tree and for three years I have been cursing that I cant automate it.
Maybe this isn’t the solution you are looking for, but in my search I’ve stumbled upon Lego City Api Server which in theory could control the trains through a server that is running Docker. From Home Assistant you could then create a number of automations (or via NODE-Red if you prefer) for your trains. At least that’s what I want to try
As I found this subject when looking for a ready made solution, I post mine here. I hope it’s ok, I don’t want to hijack the thread.
I got something working with an esp32, using legoino & home-assistant-integration libraries. It’s not as neat as an integration or an esphome, but it works for me. I can start/stop my tramway from HA dashboard. I also included a speed control.
code and instructions are here : Lego PoweredUp control from HomeAssistantt · GitHub