<imgsrc="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>
</p>
<h1>🌙 SAAS - Sleep As Android Status</h1>
<h2>📖 Description:</h2>
<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.
</p>
<h4>💡 This integration works best with a Xioami MiBand (7 or older) mixed with the Notify app and Sleep As Android configured.</h4>
<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>
</details>
</li>
</ul>
<details>
<summary><strong>✅ Known working</strong></summary>
<ul>
<li>📟 Xioami 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>⌚ Garmin Fenix 7X with Garmin Alternative, <b>NOT</b> 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>
<imgsrc="https://my.home-assistant.io/badges/config_flow_start.svg"alt="Add to HA">
</a>
</li>
<li>Add Integration: SAAS - Sleep As Android Status</li>
</ul>
<h2>⚙️ Configuration:</h2>
<ul>
<li>Name: Name of user</li>
<li>Topic: MQTT Topic from Sleep As Android</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>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>Awake States: States to indicate being awake</li>
<li>Asleep States: States to indicate being asleep</li>
<li>Mobile App: Target for buttons <b>REQUIRES COMPANION APP</b></li>
</ul>
<details>
<summary><strong>📲 Set Up Notify for Mi Band 7</strong></summary>
<ol>
<li>Pair MiBand 7 as you normally would with <ahref="https://play.google.com/store/apps/details?id=com.xiaomi.wearable&hl=en_US">Mi Fitness</a></li>