MQTT - Sleep as Android

So in that screen it will also show the descriptions for what would be sent they MQTT as well?

I tried sleep_smart_period but my node red did not catch the message for when that started so I suspect that is not the name of it over MQTT. I will try the tasker thing tonight. It was working then just stopped. So maybe just an update required it.

Thanks!

This worked for Tasker. Thanks I reinstalled SAA to try and trouble shoot and missed that.

Question though, what are the MQTT topics you send out? I am trying to get the smart sleep period message and I don’t know what is called. I tried an alarm tonight for 9pm but I don’t seem to have gotten the message thru MQTT. I got sleep started, deep sleep and light sleep.

Thanks!
Joshua

Is it possible for you to add a more descriptive error message than just “error”. I’ve no idea why it’s not working for me. Also, the documentation seems to be wrong. It’s not “mqtt://” or “mqtts://” in the app, but rather “tcp://” and “ssl://”.

1 Like

After months of working well, all of a sudden SAA refuses to connect to my MQTT broker (mosquitto v1.5.7 which supports MQTT v3.1.1).

The test also fails, and on the server side the log talks about a socket error.

Interestingly it connects fine from another phone.

I agree with @DarkFox, we need better logs.

For anyone still struggling with this, I ran into the same password issue. URL encoding did not work. I ended up creating a new account in Home Assistant (Hassio) with a simpler password. That worked just fine for me.

tcp://username:password@url.duckdns.org:8183

Using SSL gave me a protocol error even though I have a certificate set up. I didn’t troubleshoot that and just used straight TCP.

This here saved me soo many headaches!!!

Is there a reason the before_alarm event is not listed here?

Also, would it be possible to add the alarm ID to the before_alarm event? I’d like to trigger an automation to run before the alarm time (lights gradually turn on and reach full brightness when the alarm rings) but I’d like to be able to do it only for certain alarms.

The documentation regarding format of the mqtt request is wrong: https://docs.sleep.urbandroid.org/services/mqtt.html#format-of-the-post-request
which says “Tap the URL option and fill in the URL of the MQTT broker, including mqtt:// or mqtts:// .”
I believe it still has to begin with tcp:// to work. I’m not sure about secure.
I just had to reset my phone and was troubleshooting and tried both mqtt & mqtts and neither were allowed to save let alone test.