have you heard of HASS? https://www.home-assistant.io/
it seems like the perfect fit for you.
it seems like the perfect fit for you.
For me, I like the OpenHAB scripting, I personally found HomeAssistant to be too complicated to do some things because it was focused on being easy to use. I spent a long time trying to figure out how to get HomeAssistant to do what I wanted with my zwave smart locks, and it was much easier to do it on OpenHAB. So obviously, YMMV based on your preferences and requirements.
I see a lot of people using NodeRed also, which I guess is cool, but I found NodeRed incredibly frustrating compared to writing a script from scratch.