Update README.md

This commit is contained in:
sudoxnym 2025-04-15 12:37:36 -06:00 committed by GitHub
parent e94fe3a72b
commit 1f52692d07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

177
README.md
View file

@ -1,55 +1,60 @@
<p align="center"> <p align="center">
<a href="https://hacs.xyz/docs/faq/custom_repositories"> <a href="https://hacs.xyz/docs/faq/custom_repositories">
<img src="https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge&logo=home%20assistant&labelColor=202020&color=41BDF5" alt="Add to HACS"> <img src="https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge&logo=home%20assistant&labelColor=202020&color=41BDF5" alt="add to hacs">
</a> </a>
</p> </p>
<h1>🌙 SAAS - Sleep As Android Status</h1> <h1>🌙 saas - Sleep As Android status</h1>
<h2>📖 Description:</h2> <h2>🚨 breaking changes 🚨</h2>
due to changes in **Home Assistant** 2025.12, you **must** remove your existing **SAAS** integration entries and re-add them after updating to this version.
---
<h2>📖 description:</h2>
<p> <p>
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. 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.
</p> </p>
<h4>💡 This integration works best with a Xioami MiBand (7 or older) mixed with the Notify app and Sleep As Android configured.</h4> <h4>💡 this integration works best with a **Xiaomi Mi Band** (7 or older) mixed with the notify app and Sleep As Android configured.</h4>
<h3>🧱 This integration will create:</h3> <h3>🧱 this integration will create:</h3>
<ul> <ul>
<li> <li>
<details> <details>
<summary><strong>📡 8 Sensors</strong></summary> <summary><strong>📡 8 sensors</strong></summary>
<ul> <ul>
<li>Message Received *State</li> <li>message received *state*</li>
<li>Wake Status</li> <li>wake status</li>
<li>Sound</li> <li>sound</li>
<li>Disturbance</li> <li>disturbance</li>
<li>Alarm</li> <li>alarm</li>
<li>Lullaby</li> <li>lullaby</li>
<li>Sleep Tracking</li> <li>sleep tracking</li>
<li>Sleep Stage</li> <li>sleep stage</li>
</ul> </ul>
<p>This should intelligently and dynamically allow for state changes in the Wake Status Sensor.</p> <p>this should intelligently and dynamically allow for state changes in the wake status sensor.</p>
</details> </details>
</li> </li>
<li> <li>
<details> <details>
<summary><strong>🎛️ 8 Buttons</strong></summary> <summary><strong>🎛️ 8 buttons</strong></summary>
<ul> <ul>
<li>Alarm Dismiss</li> <li>alarm dismiss</li>
<li>Alarm Snooze</li> <li>alarm snooze</li>
<li>Lullaby Stop</li> <li>lullaby stop</li>
<li>Sleep Tracking Pause</li> <li>sleep tracking pause</li>
<li>Sleep Tracking Resume</li> <li>sleep tracking resume</li>
<li>Sleep Tracking Start</li> <li>sleep tracking start</li>
<li>Sleep Tracking Start with Optimal Alarm</li> <li>sleep tracking start with optimal alarm</li>
<li>Sleep Tracking Stop</li> <li>sleep tracking stop</li>
</ul> </ul>
</details> </details>
</li> </li>
<li> <li>
<details> <details>
<summary><strong>🛠️ 1 Service</strong></summary> <summary><strong>🛠️ 1 service</strong></summary>
<pre> <pre>
service: saas.saas_example_alarm_set service: saas.saas_example_alarm_set
data: data:
@ -62,52 +67,52 @@ data:
</li> </li>
<li> <li>
<details> <details>
<summary><strong>🔗 1 Device per user</strong></summary> <summary><strong>🔗 1 device per user</strong></summary>
<p>One HA device is created per configured user instance to link sensors, services, and buttons.</p> <p>one HA device is created per configured user instance to link sensors, services, and buttons.</p>
</details> </details>
</li> </li>
</ul> </ul>
<details> <details>
<summary><strong>Known working</strong></summary> <summary><strong>known working</strong></summary>
<ul> <ul>
<li>📟 Xioami Mi Band 7</li> <li>📟 **Xiaomi Mi Band 7**</li>
<li>📟 Xioami Mi Band 8 and 9 may work, but they have a different OS that jumps through hoops to work.</li> <li>📟 **Xiaomi Mi Band 8** and **Mi Band 9** may work, but they have a different os that jumps through hoops to work.</li>
<li>⌚ Garmin Fenix 7X with Garmin Alternative, <b>NOT</b> the free one.</li> <li>⌚ **Garmin Fenix 7X** with garmin alternative, **not** the free one.</li>
<li>⌚ 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.</li> <li>⌚ **Xiaomi 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.</li>
</ul> </ul>
</details> </details>
<h2>🧪 Installation:</h2> <h2>🧪 installation:</h2>
<ul> <ul>
<li>Add https://www.github.com/sudoxnym/saas to your Custom Repositories in HACS</li> <li>add <code>https://www.github.com/sudoxnym/saas</code> to your custom repositories in HACS</li>
<li>Search and Download SAAS - Sleep As Android Status</li> <li>search and download **SAAS - Sleep As Android status**</li>
<li>Restart Home Assistant</li> <li>restart Home Assistant</li>
<li> <li>
<a href="https://my.home-assistant.io/redirect/config_flow_start/?domain=saas"> <a href="https://my.home-assistant.io/redirect/config_flow_start/?domain=saas">
<img src="https://my.home-assistant.io/badges/config_flow_start.svg" alt="Add to HA"> <img src="https://my.home-assistant.io/badges/config_flow_start.svg" alt="add to ha">
</a> </a>
</li> </li>
<li>Add Integration: SAAS - Sleep As Android Status</li> <li>add integration: **SAAS - Sleep As Android status**</li>
</ul> </ul>
<h2>⚙️ Configuration:</h2> <h2>⚙️ configuration:</h2>
<ul> <ul>
<li>Name: Name of user</li> <li>name: name of user</li>
<li>Topic: MQTT Topic from Sleep As Android</li> <li>topic: MQTT topic from Sleep As Android</li>
<li>QoS: Quality of Service</li> <li>qos: quality of service</li>
<li>Awake Duration: Time in seconds in which awake states = true to indicate awake. <s>Sensor usually updates within 30 seconds or so after the duration, not entirely sure why the delay.</s> <b>FIXED</b></li> <li>awake duration: time in seconds in which awake states = true to indicate awake. <b>fixed</b></li>
<li>Asleep Duration: Time in seconds in which sleep states = true to indicate asleep. <s>Sensor usually updates within 30 seconds or so after the duration, not entirely sure why the delay.</s> <b>FIXED</b></li> <li>asleep duration: time in seconds in which sleep states = true to indicate asleep. <b>fixed</b></li>
<li>Awake States: States to indicate being awake</li> <li>awake states: states to indicate being awake</li>
<li>Asleep States: States to indicate being asleep</li> <li>asleep states: states to indicate being asleep</li>
<li>Mobile App: Target for buttons <b>REQUIRES COMPANION APP</b></li> <li>mobile app: target for buttons <b>requires companion app</b></li>
</ul> </ul>
<details> <details>
<summary><strong>📲 Set Up Notify for Mi Band 7</strong></summary> <summary><strong>📲 set up Notify for Mi Band 7</strong></summary>
<ol> <ol>
<li>Pair MiBand 7 as you normally would with <a href="https://play.google.com/store/apps/details?id=com.xiaomi.wearable&hl=en_US">Mi Fitness</a></li> <li>pair **Mi Band 7** as you normally would with <a href="https://play.google.com/store/apps/details?id=com.xiaomi.wearable&hl=en_US">Mi Fitness</a></li>
<li>Obtain auth key for Notify app using ADB</li> <li>obtain auth key for Notify app using ADB</li>
</ol> </ol>
<pre> <pre>
@ -116,18 +121,18 @@ grep -E "authKey=[a-z0-9]*," /sdcard/Android/data/com.xiaomi.wearable/files/log/
awk -F ", " '{print $17}' | grep authKey | tail -1 | awk -F "=" '{print $2}' awk -F ", " '{print $17}' | grep authKey | tail -1 | awk -F "=" '{print $2}'
</pre> </pre>
<p>Credit: <a href="https://www.reddit.com/r/miband/comments/15j0rfq/comment/kxlyzc6/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button">iamfosscad</a></p> <p>credit: <a href="https://www.reddit.com/r/miband/comments/15j0rfq/comment/kxlyzc6/">iamfosscad</a></p>
<ol start="3"> <ol start="3">
<li>Uninstall Mi Fitness</li> <li>uninstall **Mi Fitness**</li>
<li>Download/Install <a href="https://play.google.com/store/apps/details?id=com.mc.miband1&hl=en_US">Notify for Mi Band</a></li> <li>download/install <a href="https://play.google.com/store/apps/details?id=com.mc.miband1&hl=en_US">Notify for Mi Band</a></li>
<li>Follow prompts, input auth key, select Mi Fitness is not installed</li> <li>follow prompts, input auth key, select Mi Fitness is not installed</li>
<li>Enable Sleep as Android in Notify settings</li> <li>enable Sleep As Android in Notify settings</li>
</ol> </ol>
</details> </details>
<details> <details>
<summary><strong>🔐 Extracting the Zepp <code>authKey</code> on a Rooted Android Device</strong></summary> <summary><strong>🔐 extracting the Zepp <code>authKey</code> on a rooted android device</strong></summary>
<pre> <pre>
su su
cd /data/data/com.huami.watch.hmwatchmanager/databases/ cd /data/data/com.huami.watch.hmwatchmanager/databases/
@ -136,16 +141,16 @@ sqlite3 origin_db_1234567890 "SELECT AUTHKEY FROM DEVICE;"
</pre> </pre>
<ul> <ul>
<li>⚠️ Do Not Unpair before extracting</li> <li>⚠️ do not unpair before extracting</li>
<li>Use with caution root required</li> <li>use with caution root required</li>
<li>Modified apps are available on <a href="https://geekdoing.com">GeekDoing</a> and <a href="https://freemyband.com">freemyband.com</a></li> <li>modified apps are available on <a href="https://geekdoing.com">GeekDoing</a> and <a href="https://freemyband.com">FreeMyBand</a></li>
</ul> </ul>
</details> </details>
<h3>🛌 <a href="https://play.google.com/store/apps/details?id=com.urbandroid.sleep&hl=en_US">Sleep as Android Setup</a></h3> <h3>🛌 <a href="https://play.google.com/store/apps/details?id=com.urbandroid.sleep&hl=en_US">sleep as android setup</a></h3>
<ol> <ol>
<li>Open the app and follow setup</li> <li>open the app and follow setup</li>
<li>Settings wheel > Services > Automation > MQTT</li> <li>settings wheel > services > automation > MQTT</li>
</ol> </ol>
<pre> <pre>
@ -153,42 +158,42 @@ sqlite3 origin_db_1234567890 "SELECT AUTHKEY FROM DEVICE;"
</pre> </pre>
<ul> <ul>
<li>Topic: must match config</li> <li>topic: must match config</li>
<li>Client ID: any unique ID</li> <li>client id: any unique id</li>
</ul> </ul>
<ol start="4"> <ol start="4">
<li>Enable automatic tracking</li> <li>enable automatic tracking</li>
<li>Sensor: Sonar or Accelerometer</li> <li>sensor: sonar or accelerometer</li>
<li>Wearables > Xiaomi Mi Band > Test sensor</li> <li>wearables > **Xiaomi Mi Band** > test sensor</li>
</ol> </ol>
<details> <details>
<summary><strong>📦 Changes</strong></summary> <summary><strong>📦 changes</strong></summary>
<b>0.0.6a</b> <b>0.2.0</b>
<ul> <ul>
<li>Initial Beta Release</li> <li>added services.yaml to resolve known NoneType error</li>
<li>Added persistent states</li> <li>fixed deprecation warnings for future Home Assistant releases</li>
<li>Alarm Event sensor attributes</li> <li>breaking changes: remove and re-add existing integration entries after update</li>
</ul> </ul>
<b>0.1.0</b> <b>0.1.0</b>
<ul> <ul>
<li>Fixed Wake Status Timing</li> <li>fixed wake status timing</li>
<li>Bug fixes on Sound sensor</li> <li>bug fixes on sound sensor</li>
<li>Accurate updates to AlarmEvent, Disturbance, Sound</li> <li>accurate updates to alarmevent, disturbance, sound</li>
<li>Organized README</li> <li>organized readme</li>
</ul>
<b>0.0.6a</b>
<ul>
<li>initial beta release</li>
<li>added persistent states</li>
<li>alarm event sensor attributes</li>
</ul> </ul>
</details> </details>
<details> <details>
<summary><strong>🚨 Known Issues</strong></summary> <summary><strong>🚨 known issues</strong></summary>
<pre> <p>💬 no known issues at this time.</p>
Logger: homeassistant.helpers.service
Source: /usr/src/homeassistant/homeassistant/helpers/service.py:708
Failed to load integration: saas
NoneType: None
</pre>
<p>💬 No known effects. Just an error message, everything works as expected.</p>
<p>This is my first integration.</p>
</details> </details>