Automation
1. What it does
Sleep as Android can be used to automate your smart devices or other applications through various services:
2. Where to find it
Settings → Services → Automation
3. Options
Set events that will be sent from Sleep as Android to each automation service.
Enable or disable Tasker integration.
Enable or disable IFTTT integration.
Enable or disable custom webhooks integration.
Set URL of your custom webhooks endpoint.
Enable or disable MQTT integration.
Set URL of your MQTT broker.
Set client ID under which Sleep as Android will connect to the MQTT broker. Warning: You cannot have multiple devices connecting under the same Client ID to the same broker. Default: "SleepAsAndroid"
Enable or disable intent API.
4. Guide
4.1. Events
The events that will be sent to each automation service can be toggled in Settings → Services → Automation → Events.
The events are:
…
…
…
…
You have snoozed a ringing alarm.
We are sending the following values:
-
value1: UNIX timestamp of the alarm start time, example: "1582719660934"
-
value2: alarm label, example: "label" (Any tabs and newline characters in the label will be removed before sending)
You have a canceled an alarm that is currently snoozed.
We are sending the following values:
-
value1: UNIX timestamp of the alarm start time, example: "1582719660934"
-
value2: alarm label, example: "label" (Any tabs and newline characters in the label will be removed before sending)
Fires when you get a bedtime notification.
We are sending the following values:
-
value1: UNIX timestamp of the alarm start time (the alarm which triggered the bedtime notification, based on your ideal daily sleep target), example: "1582719660934"
Fires when alarm starts.
We are sending the following values:
-
value1: UNIX timestamp of the alarm start time, example: "1582719660934"
-
value2: alarm label, example: "label" (Any tabs and newline characters in the label will be removed before sending)
Fires when you dismiss alarm (after you solve CAPTCHA, if it’s set).
We are sending the following values:
-
value1: UNIX timestamp of the alarm start time, example: "1582719660934"
-
value2: alarm label, example: "label" (Any tabs and newline characters in the label will be removed before sending)
Fires when you tap dismiss an alarm from notification before it actually rings.
We are sending the following values:
-
value1: UNIX timestamp of the alarm start time, example: "1582719660934"
-
value2: alarm label, example: "label" (Any tabs and newline characters in the label will be removed before sending)
Fires exactly 1 hour before the next alarm is triggered.
-
value1: UNIX timestamp of the alarm start time, example: "1582719660934"
Fires when we estimate the start of REM phase.
Fires at the start of the smart period.
Fires 45 minutes before the start of smart period.
We are sending the following value:
-
value: alarm label, example: "label" (Any tabs and newline characters in the label will be removed before sending)
Fires when lullaby starts playing.
Fires when lullaby is stopped (either manually or automatically).
Fires when we detect you fell asleep and starting lowering the volume of lullabies.
Fires when we detect you going into deep sleep phase. Warning: This may result in lots of events during the night and may not exactly fit the resulting sleep graph as we can only detect phases reliably from whole-night data.
Fires when we detect you going into light sleep phase. Warning: This may result in lots of events during the night and may not exactly fit the resulting sleep graph as we can only detect phases reliably from whole-night data.
Fires when we detect you woke up.
Fires when we detect you fell asleep.
Fires when we detect a significant dip in your oxygen levels.
Fires when antisnoring is triggered.
Fires when we detect snoring.
Fires when we detect talking.
Fires when we detect coughing.
Fires when we detect baby cry.
Fires when we detect laughter.