Use this Ariela MQTT sensor to trigger scenes / automations in Home Assistant based on the next scheduled alarm from your phone.

In order to enable this functionality, go to Ariela -> Settings -> MQTT -> Sensors and enable Alarm sensor. Note that this functionality will need to have the MQTT enabled.

Once enabled, this sensor should be automatically detected by your Home Assistant server, but if its not you can manually add it to your configuration.yaml. In order to retrieve the configuration to use click on the Alarm sensor more info button and a dialog with instructions should appear.

Automation Example

You can then use this for your automations. This is an example where the scene wakeup will be called 3 minutes before the scheduled alarm.

minutes: /1
platform: time
seconds: 0
condition: template
value_template: '{{ (((as_timestamp(now()) | int) + 3*60) | timestamp_custom("%Y-%m-%d %H:%M:00")) == states.sensor.android_device_next_alarm.state }}'
entity_id: scene.wakeup
service: scene.turn_on