if you gonna DIY on software, I strongly recommend you to take a look at mixtile hub.
This hub is Linux based, can run with compatible software, even include open source like homebridge, hassio, iobroker, domoticz, etc...
That means it can do many things on automation.
you can check on...