Mijia Nightlight is a Home Assistant (HA) integration to control the Xiaomi Motion Activated Night Light 2 over Bluetooth Low Energy (BLE). This integration offers functionalities such as turning the light on or off, adjusting brightness, setting the duration, and modifying ambient light levels.
- Turn the night light on or off.
- Adjust the brightness of the light.
- Set the operation duration before the light turns off automatically.
- Change the ambient light sensitivity levels to dynamically control light activation.
You can install this integration either manually or by using Home Assistant Community Store (HACS).
-
Clone or download the repository:
git clone https://github.com/ov1d1u/mijia_nightlight.git
-
Copy the
mijia_nightlight
directory from the repository to your Home Assistantcustom_components
directory:cp -r mijia_nightlight/custom_components/mijia_nightlight /config/custom_components/
-
Restart Home Assistant.
-
Ensure you have HACS installed. If not, follow the HACS installation instructions.
-
Go to "HACS" in the Home Assistant sidebar.
-
Click the "Integration" tab.
-
Click the "+" button in the bottom right and search for "Mijia Nightlight".
-
Select the integration and click "Install".
-
Restart Home Assistant.
Once configured, the Xiaomi Night Light devices will show up in your Home Assistant interface. You can use Home Assistant's automation and scripting features to control your night lights based on various conditions and triggers available in Home Assistant.
Since this is an initial release, there might be bugs or missing features. Please report any issues or bugs via the GitHub issues page. Contributions and feature requests are welcome via Pull Requests.
This project is licensed under the MIT License. See the LICENSE file for more details.
- Yeelight xiaomi mesh light bulb auth sequence dump (@kabbi): https://gist.github.com/kabbi/32658d7d3a086cd47d877882933a9908
- TelinkMiFlasher (@pvvx): https://github.com/pvvx/pvvx.github.io/
- This blog post from Wankko Ree's Blog: https://wkr.moe/study/845.html
- Home Assistant community for their ongoing support and contributions!