For future reference, you can also use a State Trigger with the device’s event entities.
Main advantage is that if the device is ever replaced, as long as the new one’s name remains the same, you won’t have to modify any automations that reference it.
In contrast, an MQTT Device Trigger uses the device’s device_id and it will automatically change when the physical device is changed (requiring you to update all of its related automations).