Creating a custom device integration

So I’m pretty new to HA but I’ve done home automation myself for around the last 10yrs using custom scripts, graphing solutions, rrdtool, a bit of emoncms all run from a linux server at home.
So I’ve got the HA install on my RaspberryPI and getting it setup, I’m trying to work out how now to load in my current array of sensors.

My current setup I use various custom arduino, esp32, esp8266 and serial devices that I wrote the code for, so I’m now looking at a simple way of talking to HA.

Looking over the API, this looks the right approach, so for example my external esp32 sensor I could code in simple API calls to send it’s state doing something like:

-H “Content-Type: application/json”
-d ‘{“state”: “on”}’

Obviously using curl as a test there (and with the auth bearer in header, post var, etc). Is this the right approach? This would ‘create’ the binary sensor outsidelights and send the current state of them?

So would I then continue and do an input from all my sensors around the house using that approach, firstly setting their binary_sensor input states, so I start to at least get my data IN to HA. I can then work on polling the API from those sensors to decide if they should be toggled, receive automation, etc.

OR am I going about this in the wrong way? Is there a simpler way of doing this, say a library or integration?
I’ve looked at esphome and I don’t think it’s right for me, as I don’t want a completely hands-off approach, I want to add the code bits I need to my existing Arduino sketches and integrate myself, not swap to a totally binary codebase.

Sorry for the long question, I didn’t see a good/simple explanation (I understand I’m probably in the minority here!)

this maybe of help

Thanks, yes that’s the document I refer to in my original post that I’m working from.