diff --git a/README.md b/README.md
index f7b88fa..ea25265 100644
--- a/README.md
+++ b/README.md
@@ -1,34 +1,61 @@
-[](https://hacs.xyz/docs/faq/custom_repositories)
-
SAAS - Sleep As Android Status
-Description:
-Sleep As Android Status is my solution for wake/sleep state within HA. It listens for the Sleep As Android MQTT Messages, so it does require being on the same network. As of 0.0.4 Buttons that link with the Companion app have been added.
-This integration works best with a Xioami MiBand (7 or older) mixed with the Notify app and Sleep As Android configured.
-Known working:
-Xioami Mi Band 7, 8 and 9 may work, but they have a different os that jumps through hoops to work.
-Garmin Fenix 7X with Garmin Alternative, NOT the free one.
-This integration will create 8 Sensors, 8 Buttons, 1 service, and 1 device per user:
-Sensors
-Message Received *State
-Wake Status
-Sound
-Disturbance
-Alarm
-Lullaby
-Sleep Tracking
-Sleep Stage
-This should intelligently and dynamically allow for state changes in the Wake Status Sensor.
-Buttons
-Alarm Dismiss
-Alarm Snooze
-Lullaby Stop
-Sleep Tracking Pause
-Sleep Tracking Resume
-Sleep Tracking Start
-Sleep Tracking Start with Optimal Alarm
-Sleep Tracking Stop
+
+
+
+
+
-Service
-Set alarm service
+๐ SAAS - Sleep As Android Status
+
+๐ Description:
+
+Sleep As Android Status is my solution for wake/sleep state within HA. It listens for the Sleep As Android MQTT Messages, so it does require being on the same network. As of 0.0.4 Buttons that link with the Companion app have been added.
+
+
+๐ก This integration works best with a Xioami MiBand (7 or older) mixed with the Notify app and Sleep As Android configured.
+
+โ
Known working:
+
+ - ๐ Xioami Mi Band 7
+ - ๐ Xioami Mi Band 8 and 9 may work, but they have a different os that jumps through hoops to work.
+ - โ Garmin Fenix 7X with Garmin Alternative, NOT the free one.
+ - โ Xioami Amazfit GTR Mini, may require root, I am rooted so I just did what's in this guide but there may be alternative ways to get the key
+
+
+๐งฑ This integration will create:
+
+ - 8 Sensors
+ - 8 Buttons
+ - 1 Service
+ - 1 Device per user
+
+
+๐ก Sensors
+
+ - Message Received *State
+ - Wake Status
+ - Sound
+ - Disturbance
+ - Alarm
+ - Lullaby
+ - Sleep Tracking
+ - Sleep Stage
+
+
+This should intelligently and dynamically allow for state changes in the Wake Status Sensor.
+
+๐๏ธ Buttons
+
+ - Alarm Dismiss
+ - Alarm Snooze
+ - Lullaby Stop
+ - Sleep Tracking Pause
+ - Sleep Tracking Resume
+ - Sleep Tracking Start
+ - Sleep Tracking Start with Optimal Alarm
+ - Sleep Tracking Stop
+
+
+๐ ๏ธ Service
service: saas.saas_example_alarm_set
data:
@@ -38,87 +65,114 @@ data:
minute: 30
-Installation:
+๐งช Installation:
+
+ - Add https://www.github.com/sudoxnym/saas to your Custom Repositories in HACS
+ - Search and Download SAAS - Sleep As Android Status
+ - Restart Home Assistant
+ -
+
+
+
+
+ - Add Integration: SAAS - Sleep As Android Status
+
-Add https://www.github.com/sudoxnym/saas to your Custom Repositories in HACS
-
-Search and Download SAAS - Sleep As Android Status
-Restart Home Assistant
-[](https://my.home-assistant.io/redirect/config_flow_start/?domain=saas)
-Add Integration: SAAS - Sleep As Android Status
+โ๏ธ Configuration:
+
+ - Name: Name of user
+ - Topic: MQTT Topic from Sleep As Android
+ - QoS: Quality of Service
+ - Awake Duration: Time in seconds in which awake states = true to indicate awake.
Sensor usually updates within 30 seconds or so after the duration, not entirely sure why the delay. FIXED
+ - Asleep Duration: Time in seconds in which sleep states = true to indicate asleep.
Sensor usually updates within 30 seconds or so after the duration, not entirely sure why the delay. FIXED
+ - Awake States: States to indicate being awake
+ - Asleep States: States to indicate being asleep
+ - Mobile App: Target for buttons REQUIRES COMPANION APP
+
-Configuration:
+
+๐ฒ Set Up Notify for Mi Band 7
+
+ - Pair MiBand 7 as you normally would with Mi Fitness
+ - Obtain auth key for Notify app using ADB
+
-Name: Name of user
-Topic: MQTT Topic from Sleep As Android
-QoS: Quality of Service
+
+adb shell
+grep -E "authKey=[a-z0-9]*," /sdcard/Android/data/com.xiaomi.wearable/files/log/XiaomiFit.device.log |
+awk -F ", " '{print $17}' | grep authKey | tail -1 | awk -F "=" '{print $2}'
+
-Awake Duration: This is for tuning. Time in seconds in which awake states = true to indicate awake. Sensor usually updates within 30 seconds or so after the duration, not entirely sure why the delay. FIXED
-Asleep Duration: This is for tuning. Time in seconds in which sleep states = true to indicate asleep. Sensor usually updates within 30 seconds or so after the duration, not entirely sure why the delay. FIXED
-Awake States: States to indicate being awake
-Asleep States: States to indicate being asleep
-Mobile App: Target for buttons REQUIRES COMPANION APP
+Credit: iamfosscad
-Set Up Notify for MiBand 7 (as of August 10, 2024)
-1. Pair MiBand 7 as you normally would with Mi Fitness app
-2. Obtain auth key for Notify app. Connect to pc with usb and open your adb SDK Platform-Pools, or if you're more advanced, connect wirelessly
-Windows:
- 2a. Open folder with adb in it
- 2b. Right click a blank spot within the folder
- 2c. Open in terminal
- 2d. Ensure usb debugging is on on your android and plug it into the pc.
- 2e. ./adb shell
- 2f. grep -E "authKey=[a-z0-9]*," /sdcard/Android/data/com.xiaomi.wearable/files/log/XiaomiFit.device.log |
-awk -F ", " '{print $17}' | grep authKey | tail -1 | awk -F "=" '{print $2}'
- 2g. Copy/clipboard the output. Disconnect phone, close ADB.
- Credit: iamfosscad
-3. Uninstall Mi Fitness
-4. Download/Install Notify for Mi Band (up to 7)
-5. Follow the prompts, enable any permission it asks for, create the profile, input Auth Key, and select Mi Fitness is not installed
-6. Open the hamburger menu on the top left
-7. Search > Search for "Sleep"
-8. Turn on Sleep as Android
-9. Enjoy
+
+ - Uninstall Mi Fitness
+ - Download/Install Notify for Mi Band
+ - Follow prompts, input auth key, select Mi Fitness is not installed
+ - Enable Sleep as Android in Notify settings
+
+
-
-1. Open the app and follow setup
-2. Settings wheel in top right > Services > Automation
-3. MQTT
- 3a. URL
-(tcp/ssl)://(MQTT User):(MQTT Pass)@(HA URL):(port)
- 3b. Topic > something recognizable. You need this exact topic in HA Integration Config.
- 3c. Client ID > I set the same, not sure if it should be, but it works.
- 3d. Test > Wait for "Success" toast message
-4. Back to app settings > Sleep tracking >
- 4a. Automatic Sleep Tracking > After fall asleep
- 4b. Sensor > Sonar (if placing phone on a bedside table) Accelerometer (if placing on bed next to you)
- 4c. Wearables >
- 4c1. Wearables > Xiaomi Mi Band > Test sensor
- 4c2. Heart rate monitoring (optional)
- 4d. Pair tracking (optional)
-5. Enjoy (optional)
+
+๐ Extracting the Zepp authKey on a Rooted Android Device
+
+su
+cd /data/data/com.huami.watch.hmwatchmanager/databases/
+ls origin_db_*
+sqlite3 origin_db_1234567890 "SELECT AUTHKEY FROM DEVICE;"
+
-Changes:
-0.0.6a
-Initial Beta Release
-Added persistant states through HA restart
-Added attributes for the Alarm Event sensor
-0.1.0
-Fixed Wake Status Timing (HUGE)
-Fixed bug with Sound sensor
-Modified AlarmEvent, Disturbance, and Sound sensors to update to None accurately
-Organized Readme.md
+
+ - โ ๏ธ Do Not Unpair before extracting
+ - Use with caution โ root required
+ - Modified apps are available on GeekDoing and freemyband.com
+
+
-Known issues:
-Error in logs:
+
+
+ - Open the app and follow setup
+ - Settings wheel > Services > Automation > MQTT
+
+
+
+(tcp/ssl)://(MQTT User):(MQTT Pass)@(HA URL):(port)
+
+
+
+ - Topic: must match config
+ - Client ID: any unique ID
+
+
+
+ - Enable automatic tracking
+ - Sensor: Sonar or Accelerometer
+ - Wearables > Xiaomi Mi Band > Test sensor
+
+
+๐ฆ Changes:
+0.0.6a
+
+ - Initial Beta Release
+ - Added persistent states
+ - Alarm Event sensor attributes
+
+
+0.1.0
+
+ - Fixed Wake Status Timing
+ - Bug fixes on Sound sensor
+ - Accurate updates to AlarmEvent, Disturbance, Sound
+ - Organized README
+
+
+๐จ Known issues:
Logger: homeassistant.helpers.service
Source: /usr/src/homeassistant/homeassistant/helpers/service.py:708
-First occurred: 3:55:19 PM (1 occurrences)
-Last logged: 3:55:19 PM
-
Failed to load integration: saas
-NoneType: None
-No known effects. Just an error message, everything works as expected.
-Please report any issues.
-This is my first integration.
+NoneType: None
+
+
+๐ฌ No known effects. Just an error message, everything works as expected.
+This is my first integration.