First delete the integration. In your config folder you will see a folder called .storage. In that folder you will find text files in the format esphome.**random numbers/letters** Open the files and you should find a copy of the yaml for the problematic node, delete it. Then restart HA and add the integration back.
It turned out to be something in the configuration.yaml I hade some binary switches connected directly to the RasPi, removed them since I wasn’t using them anymore. Thanks to everyone who helped with this.
Another reason why a binary sensor doesn’t show up in Home Assistant is if you don’t give it a name, because then it gets treated as internal.
internal (Optional, boolean): Mark this component as internal. Internal components will not be exposed to the frontend (like Home Assistant). Only specifying an id without a name will implicitly set this to true.
That wasn’t the issue for OP, but this thread ranks at the top for “home assistant binary sensor missing”.
I searched everywhere thanks to you i realised i haven’t named them, I sat 6 hours infront of my PC and did not understand why it would not show up.
Many Thanks,
You saved me from going insane.