New to ESPHOME - first use of ESP32 for QINGPING motion sensors

Following the following blog:

How to connect just about any Xiaomi BLE device to ESPHome using custom components

I realise I don’t fully understand how to use the ESP32 here. I can see examples of the yaml code at but should I be loading some code onto the ESP32 first and how does ESPHome tie it all together?

Usual thing with me, posted this and got my head around it 5 minutes after. The issue was I had used arduino for another esp32 switchbot implementation and thought I would need to use arduino again.