Custom Speaker Components?

Hey everyone!

I’m currently trying to automate custom-made aspects of my home. I do have a dedicated RaspberryPi running a python script and controlling on and off state of devices via I2C. The RPi has access to my local network.

I’d now like to integrate those devices into my home and particularly make them controllable through Alexa. So now I’m trying to implement a way of letting those two interact and thought of using the low-level sockets-API on my controller-RPi.

HomeAssistant is running on another computer inside of the network. Are there any suggestions for letting those two interact? I could imagine to have multiple „virtual switches“ on my HomeAssistant, that control the devices by sending web requests and in return the controller notifying HomeAssistant about any changes, also via web request.

Are there any starting pointers on how to develop this? I find the documentation quite overwhelming. Any directions will be greatly appreciated! Maybe there already even is a fitting integration or component that only has to be modified a little bit.

Thanks in advance for your comments!