MQTT
1. What it does
Allows you to publish events from Sleep as Android to any MQTT broker.
2. Where to find it
Settings → Services → Automation → MQTT
3. Guide
3.1. Setup
-
Enable the MQTT option
-
Tap the URL option and fill in the URL of the MQTT broker, including mqtt:// or mqtts:// .
-
Tap ok.
-
(Optional) If you want to customize the client ID under which the app will connect to the MQTT Broker, you can do so by tapping Client ID option. By default, this is "SleepAsAndroid" and should be fine in case you’re the only one publishing to the broker through Sleep as Android.
3.2. Format of the POST request
On every event, Sleep as Android will publish a message to SleepAsAndroid topic in the following format:
{ "event" : "event_name", "value1" : "", "value2" : "", "value3" : "" }
The event
field will have a value of one of the event names. The valueX
fields will be only present if not empty.
3.3. Recipes
-
A very detailed guide from Russ on openHAB