LEGO DUPLO train control with esphome

@JWL98, @anthonyangel, @vrutkovs, @arehsan, @Lumpusz

Very cool that you guys figured this out, amazing.
I am trying to wrap my head around this, but still a bit puzzled:
How do you guys know what values to enter for:

  • ble_clients mac_address and id
  • service_uuid
  • characteristic_uuid
  • the value of the bytes to write

thanks up front for the help,

Br,

Raymond

service_uuid and characteristic_uuid are hardcoded values LEGO uses in the train to identify data. These will not change. Same for bytes to write - this is the protocol we should follow.
MAC address and ID can be detected using ESP32 Bluetooth Low Energy Scanner — ESPHome

Thank you very much for your response.
Makes things a lot clearer.
Do you know any esphome yaml files to use to get that data?
Do I need to push any buttons on the Lego hub to activate communication?
Can the values to send be found in the official Lego api docks?
Sorry for all the questions :grin:
Trying to fully understand.
I have never used BLE with HA or esphome.
Best regards,
Thanks upfront,
Raymond