支持中国小牛电动车连接。修改了代码中的连接服务器,app-api-fk.niu.com改为app-api.niu.com,account-fk.niu.com改为account.niu.com
This is a custom component for Home Assistant to integrate your Niu Scooter.
Now this integration is asynchronous and it is easy installable via config flow.
- Now it will generate automatically a Niu device so all the sensors and the camera will grouped

- If you select the Last track sensor automatically it will create a camera integration, with the rendered image of your last track.

With the thanks to pikka97 !!!
This release aligns the custom component with Home Assistant naming conventions and removes temporary debugging output:
- Async Architecture: Replaced synchronous
requestswith asynchronousaiohttpfor non-blocking I/O - DataUpdateCoordinator: Implemented centralized, throttled data updates to prevent UI freezes
- Defensive Programming: Added robust error handling with
.get()methods to avoid crashes on missing data - SSL Compatibility: Temporary workaround for SSL certificate verification issues (
verify_ssl=False) - Modern Codebase: Full migration to async/await patterns compatible with Home Assistant's event loop
- Deterministic Entity IDs: Sensor IDs now incorporate the scooter name and sensor key (
sensor.<scooter>_<sensor>) to match server-provided data - Clean Configuration: Removed temporary debug payload dumps and aligned translation keys/strings for sensors and camera
- API Client: Complete rewrite of
api.pyusing async methods - Configuration Flow: Updated
config_flow.pyto use async authentication - Sensor Updates: All sensors now use
CoordinatorEntityfor consistent data access - Performance: 60-second update interval with efficient batch API calls
Note: This refactor was performed with AI assistance to modernize the codebase and eliminate performance bottlenecks.
- In Home Assistant's settings under "device and services" click on the "Add integration" button.
- Search for "Niu Scooters" and click on it.
- Insert your Niu app companion's credentials and select which sensors do you want.

- Enjoy your new Niu integration :-)
some people had problems with this version please take the latest 1.o versions See https://github.com/marcelwestrahome/home-assistant-niu-component repository