MKsys1337/MiWiFi-CB0401V2
The Xiaomi 5G CPE CB0401V2 Integration for Home Assistant allows users to monitor and access comprehensive data from their Xiaomi 5G CPE CB0401V2 router directly in Home Assistant. With this integration, you can display key information such as signal strength, network details, Wi-Fi status, and more within your smart home dashboard.
MiWiFi-CB0401V2
Xiaomi 5G CPE CB0401V2 Integration for Home Assistant
Overview
The Xiaomi 5G CPE CB0401V2 Integration for Home Assistant allows users to monitor and access comprehensive data from their Xiaomi 5G CPE CB0401V2 router directly in Home Assistant. With this integration, you can display key information such as signal strength, network details, Wi-Fi status, and more within your smart home dashboard.
Features
- Signal Strength and Quality: Monitor LTE and 5G signal strength (RSRP) and quality (RSRQ).
- Network Information: View the current network type, operator, reception band, and more.
- Data Usage: Track data usage in MB.
- Connected Devices: See how many devices are currently connected to the router (via
misystem/devicelist). - SMS Messages: Monitor the number of SMS messages stored on the router (via
xqmobile/get_msgbox_count).
Installation
Requirements
- Home Assistant: Version 2021.6.0 or higher
- Xiaomi 5G CPE CB0401V2 Router: Firmware version 3.0.59 or higher
- Python: 3.8 or higher
HACS Installation
-
Install HACS (if not already installed):
- Follow the official HACS installation guide.
-
Add the custom repository:
- Go to HACS in the Home Assistant interface.
- Click on Integrations and then the + icon at the bottom right.
- Search for
Xiaomi 5G CPE CB0401V2or directly add the repository URL:https://github.com/MKsys1337/MiWiFi-CB0401V2 - Click Add.
-
Restart Home Assistant:
- Go to Settings > System > Restart and restart Home Assistant.
Manual Installation
-
Clone the repository:
- Navigate to the
custom_componentsdirectory of your Home Assistant installation:/config/custom_components/ - Clone the repository:
git clone https://github.com/MKsys1337/MiWiFi-CB0401V2 miwifi_cb0401v2
- Navigate to the
-
Restart Home Assistant:
- Go to Settings > System > Restart and restart Home Assistant.
Configuration
This integration uses a Config Flow, so no manual configuration.yaml changes are necessary.
-
Add the integration:
- Go to Settings > Devices & Services > Integrations.
- Click the + icon at the bottom right.
- Search for
MiWiFi CB0401V2and select it.
-
Enter credentials:
- Input the router's IP address (default:
192.168.31.1). - Enter the username (usally
adminand password for the router. - Click Submit.
- Input the router's IP address (default:
-
Verify connection:
- If successful, the available sensors will be automatically added.
Available Sensors
General Router Information
- Router Name
- Firmware Version
- Hardware Model
- Model Designation
- MAC Address
- Serial Number
- IMEI
Network Information
- LTE Signal Strength (RSRP)
- LTE Signal Quality (RSRQ)
- 5G Signal Strength (RSRP)
- 5G Signal Quality (RSRQ)
- LTE Signal SNR
- 5G Signal SNR
- Network Type
- Network Operator
- Data Usage
- LTE Reception Band
- 5G Reception Band
- Frequency Bands
- Cell ID
- 5G Cell ID
- WiFi SSID 2.4 GHz
- WiFi SSID 5 GHz
- WiFi Active Clients - Number of devices currently connected and exchanging data with the WiFi network
- Connected Devices - Total number of devices detected by the router (via
misystem/devicelist) - SMS Messages - Count of SMS messages stored on the router (via
xqmobile/get_msgbox_count)
Usage
Adding Sensors to Your Dashboard
-
Navigate to your dashboard:
- Go to Overview in Home Assistant.
-
Edit your dashboard:
- Click the three-dot menu in the top right and select Edit Dashboard.
-
Add a new card:
- Click Add Card.
-
Select the desired card type:
- Choose Entities, Glance, Gauge, History Graph, etc.
-
Select the desired sensors:
- Search for and add the sensors you want to display on the card.
-
Save the card:
- Click Save to confirm the changes.
Contributing
We welcome contributions! Please follow these steps:
- Fork the repository.
- Create a new branch for your changes:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m "Description of your changes" - Push to your fork:
git push origin feature/your-feature-name
- Create a Pull Request in the main repository.
Ensure your code follows PEP 8 guidelines and passes existing tests.
Security
- Confidentiality of credentials: Never share your credentials publicly.
License
This project is licensed under the MIT License.
Acknowledgements
- Home Assistant Community for their excellent documentation and support.
- Xiaomi for providing powerful routers.
- Open-Source Community for the helpful tools and libraries.