You can make automations in HomeKit or triggers in Alexa. For HomeKit you need to configure a HomeKit hub.