Sleep as Android added support for Webhooks and MQTT

should be

state_topic: “SleepAsAndroid/sonno/apnea_alarm”
                           ^ 
1 Like

Hello everyone.

I’ve been trying to use SaA webhooks to trigger automations in HA, but I can’t seem to be able to “filter” when to trigger which automation depending on the event beeing broadcast by SaA in the webhook.

For exemple I’d like to trigger an automation when my alarm starts (so the SaA event is alarm_alert_start), but with the following automation it triggers with every webhook sent to HA:

alias: reveil
description: Réveil
trigger:
  - platform: webhook
    webhook_id: reveil_android
    id: alarm_alert_start
condition:
  - condition: trigger
    id: alarm_alert_start
action:
  - service: script.sunrise
mode: single

So I don’t think my trigger is doing what I want it to do. I’ve seen people using JSON to filter the triggers so I’ll have to read up on it and see how it works.

Has anyone done set up any sort of overnight summaries using this data ? mins in deep sleep etc

hello @brewston have you done anything with the sleep data yet? I have successfully set up the mqtt interface and can see data coming through so I would be interested in ideas. Triggering an automation when the alarm goes off doesn’t exite me much :slight_smile:

No, I never got anywhere with it. It seemed the app was draining the battery a bit quicker than normal and since I wasn’t getting anything really useful from it, I tore it all down.