Here is an example of how you can do it via Webcore.
… or you can search the forum for “Homebridge” for a full HomeKit integration.