Now I am not sure how to organize this big project. I do not want to add all files into the /config/esphome/ folder.
Workaround: copy the main.yaml to the config dir /config/esphome/. Change all relative path to one subfolder like esp32-p4. In the main.yaml its easy to replace but also I need to replace all path in all files inside the new esp32-p4 folder.
Is there a better way? Can I get esphome to scan subfolders - so I can have a subfolder for every board?
What do you mean?
I installed esphome in homeassistant via addon.
I installed the project by copying it into the /config/esphome/esp32-p4/ folder (the files from src folder) and the main.yaml directly to /config/esphome/esp32-p4/main.yaml
Packages are a good way, better than include. And they do not have to reside on github, all my packages are files in subfolders. You can even pass parameters to packages if needed for packages that are used in multiple places.