Giter Site home page Giter Site logo

dmamontov / hass-miwifi Goto Github PK

View Code? Open in Web Editor NEW
140.0 6.0 11.0 3.93 MB

MiWiFi for Home Assistant

Home Page: https://community.home-assistant.io/t/xiaomi-miwifi-component-for-tracking-devices-and-managing-routers/288734

License: Apache License 2.0

Python 100.00%
xiaomi homeassistant hacs miwifi redmi mi homeassistant-integration python

hass-miwifi's Introduction

MiWiFi for Home Assistant

hacs_badge CodeQL Telegram

The component allows you to monitor devices and manage routers based on MiWiFi from Home Assistant.

❗ Supports routers with original or original patched MiWifi firmware

❗ On the modified firmware, not all functionality may work

More info

Supported routers

Many more Xiaomi and Redmi routers supported by MiWiFi

Check list

Required
  • xqsystem/login - Authorization;
  • xqsystem/init_info - Basic information about the router;
  • misystem/status - Basic information about the router. Diagnostic data, memory, temperature, etc;
  • xqnetwork/mode - Operating mode. Repeater, Access Point, Mesh, etc.
Additional
  • misystem/topo_graph - Topography, auto discovery does not work without it;
  • xqsystem/check_rom_update - Getting information about a firmware update;
  • xqnetwork/wan_info - WAN port information;
  • xqsystem/vpn_status - Information about vpn connection;
  • misystem/led - Interaction with LEDs;
  • xqnetwork/wifi_detail_all - Getting information about WiFi adapters;
  • xqnetwork/wifi_diag_detail_all - Getting information about guest WiFi;
  • xqnetwork/avaliable_channels - Gets available channels for WiFi adapter;
  • xqnetwork/wifi_connect_devices - Get information about connected devices;
  • misystem/devicelist - More information about connected devices;
  • xqnetwork/wifiap_signal - AP signal in repeater mode;
  • misystem/newstatus - Additional information about connected devices for force load mode.
Action
  • xqsystem/reboot - Reboot;
  • xqsystem/upgrade_rom - Firmware update;
  • xqsystem/flash_permission - Clear permission. Required only for firmware updates;
  • xqnetwork/set_wifi - Update WiFi settings. Causes the adapter to reboot;
  • xqnetwork/set_wifi_without_restart - Update Guest WiFi settings.

❗ If your router is not listed or not tested, try adding an integration, it will check everything and give a link to create an issue. You just have to click Submit new issue

❗ If at the time of adding the integration only Router {ip} not supported message is displayed, please create an issue with the message that the router is not supported, indicating the model of the router.

Summary

  • 🟢 - Supported
  • 🔴 - Not supported
  • ⚪ - Not tested
Image Router Code Required Additional Action
Xiaomi 5G CPE Pro CB0401 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Mi Router 4A Gigabit V2 R4AV2 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Xiaomi Home WiFi RB08 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Redmi Router AX6000 RB06 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Redmi Router AX5400 RA74 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Redmi Gaming Router AX5400 RB04 🟢🟢🟢🟢 🟢🟢⚪🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢⚪🟢🟢🟢
Xiaomi Router AC1200 RB02 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Xiaomi Router CR8808 CR8808 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Xiaomi Mesh System AX3000 RA82 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Xiaomi Router AX3200 RB01 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Redmi Router AX1800 RA71 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Redmi Router AX6S RB03 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Xiaomi Router AX3000 RA80 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Redmi Router AX3000 RA81 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Xiaomi China Unicom WiFi 6 Router CR6606 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Xiaomi Router AX9000 RA70 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Redmi Router AX5 RA50 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Xiaomi Router AX6000 RA72 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Redmi Router AX6 RA69 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Mi Router 4 Pro R1350 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Mi AIoT Router AC2350 R2350 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Redmi Router AX5 RA67 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Mi Router AX1800 RM1800 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Xiaomi AIoT Router AX3600 R3600 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Redmi Router AC2100 RM2100 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Mi Router AC2100 R2100 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢
Mi Router Mesh D01 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router 4A R4AC 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router 4A Gigabit R4A 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router 4C R4CM 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router 4Q R4C 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router 4 R4 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router 3A R3A 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router 3C R3L 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router HD R3D 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router Pro R3P 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router 3G R3G 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router 3 R3 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router R2D R2D 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router Lite R1CL 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router Mini R1CM 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢
Mi Router R1D R1D 🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🔴 🟢🟢🟢🟢🟢

hass-miwifi's People

Contributors

dmamontov avatar faserf avatar gormya avatar hudsonbrendon avatar imgbotapp avatar nemesis24 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hass-miwifi's Issues

How can i make a auto task?

First of all, I'd like to say thank you to you for this repository.
When I add my router in the HA, I want to select a task : when the device"A" is offline, my light will be turned off. But I don't know how to select it. I don't know what should i select in the trigger. Could you please help me? Thank you very much. And sorry for my bad English. Wish you have a good day. : )

Add supports RA82

Check list:

  • xqsystem/login: 🟢
  • xqsystem/init_info: 🟢
  • xqsystem/reboot: 🟢
  • misystem/status: 🟢
  • xqnetwork/mode: 🟢
  • misystem/topo_graph: 🟢
  • xqnetwork/wan_info: 🟢
  • misystem/led: 🟢
  • xqnetwork/wifi_detail_all: 🟢
  • xqnetwork/wifi_connect_devices: 🟢
  • misystem/devicelist: 🟢
  • misystem/newstatus: 🟢

Update for device_tracker.kmd1027703 fails

Hello,

My router is scheduled to reboot every night, so the connection to it is down during few minutes.
Here is the log record:

Logger: homeassistant.helpers.entity
Source: custom_components/miwifi/device_tracker.py:260
Integration: MiWiFi (documentation)
First occurred: 3:58:04 AM (42 occurrences)
Last logged: 4:04:54 AM

Update for device_tracker.kmd1027703 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 446, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 641, in async_device_update
raise exc
File "/config/custom_components/miwifi/device_tracker.py", line 260, in async_update
self._device["ip"] = device["ip"][0]["ip"] if "ip" in device else "0:0:0:0"
IndexError: list index out of range

Perhaps, list "_device[]" is empty in such cases, so it makes reason to frame it with "try / except".

Thanks

Add supports RB01

Check list:

  • xqsystem/login: 🟢
  • xqsystem/init_info: 🟢
  • xqsystem/reboot: ⚪
  • xqnetwork/set_wifi: ⚪
  • xqnetwork/set_wifi_without_restart: ⚪
  • xqsystem/upgrade_rom: ⚪
  • xqsystem/flash_permission: ⚪
  • misystem/status: 🟢
  • xqsystem/check_rom_update: 🟢
  • xqnetwork/mode: 🟢
  • misystem/topo_graph: 🟢
  • xqnetwork/wan_info: 🟢
  • misystem/led: 🟢
  • xqnetwork/wifi_detail_all: 🟢
  • xqnetwork/wifi_diag_detail_all: 🟢
  • xqnetwork/avaliable_channels: 🟢
  • xqnetwork/wifi_connect_devices: 🟢
  • misystem/devicelist: 🟢
  • misystem/newstatus: 🟢
  • xqnetwork/wifiap_signal: 🟢

Icons not loaded even with existing "legacy_known_devices.yaml" file

I need help with icon setting for device trackers.

I have created the file "legacy_known_devices.yaml" as the documentations says to, but the icons are not loaded when the device tracker objects are created.
image

The items within the file are created as following:

DEVICE_123:
  **icon: mdi:cellphone**
  mac: 00:00:00:AA:00:AA
  name: Device_123
  picture:
  track: true

When checking the device_tracker entity, there is no icon.
image

Is there any additional setup required to show the icon properly?

[BUG] 5G Wi-Fi band switch does not work well

Describe the bug
Hi, thank you very much for this new version. I have updated to version 2.5.0 but I see that the 5G Wi-Fi band switch does not work well, it is always ON even if the network is turned off. (switch.miwifi_XX_XX_XX_XX_XX_XX_wifi_5g)
Thank you.

  • HASS version: 2022.4.0
  • Home Assistant Core 2022.4.6
  • Home Assistant Operating System 7.6
  • Component version 2.5.0
  • Router model AX3600
  • Router firmware version 1.1.19 CN

Error news home assistant 2022.4

Logger: homeassistant.components.sensor
Source: helpers/entity_registry.py:529
Integration: Capteur (documentation, issues)
First occurred: 18:37:13 (2 occurrences)
Last logged: 18:37:13

Error adding entities for domain sensor with platform miwifi
Error while setting up miwifi platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in _async_add_entity
entry = entity_registry.async_get_or_create(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 345, in async_get_or_create
return self.async_update_entity(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 529, in async_update_entity
raise ValueError("entity_category must be a valid EntityCategory instance")
ValueError: entity_category must be a valid EntityCategory instance

Logger: homeassistant.components.switch
Source: helpers/entity_registry.py:529
Integration: Commutateur (documentation, issues)
First occurred: 18:37:12 (2 occurrences)
Last logged: 18:37:13

Error adding entities for domain switch with platform miwifi
Error while setting up miwifi platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in _async_add_entity
entry = entity_registry.async_get_or_create(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 345, in async_get_or_create
return self.async_update_entity(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 529, in async_update_entity
raise ValueError("entity_category must be a valid EntityCategory instance")
ValueError: entity_category must be a valid EntityCategory instance

Logger: homeassistant.components.light
Source: helpers/entity_registry.py:529
Integration: Lumière (documentation, issues)
First occurred: 18:36:24 (2 occurrences)
Last logged: 18:36:24

Error adding entities for domain light with platform miwifi
Error while setting up miwifi platform for light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in _async_add_entity
entry = entity_registry.async_get_or_create(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 345, in async_get_or_create
return self.async_update_entity(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 529, in async_update_entity
raise ValueError("entity_category must be a valid EntityCategory instance")
ValueError: entity_category must be a valid EntityCategory instance

Logger: homeassistant.components.binary_sensor
Source: helpers/entity_registry.py:529
Integration: Capteur binaire (documentation, issues)
First occurred: 18:36:24 (2 occurrences)
Last logged: 18:36:24

Error adding entities for domain binary_sensor with platform miwifi
Error while setting up miwifi platform for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in _async_add_entity
entry = entity_registry.async_get_or_create(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 345, in async_get_or_create
return self.async_update_entity(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 529, in async_update_entity
raise ValueError("entity_category must be a valid EntityCategory instance")
ValueError: entity_category must be a valid EntityCategory instance

Last update problem

After 2.0.9 update lost all control on ax3600... Only device list work now.
No info memory, led, reboot, etc

Add supports RB04(redmi ax5400 gaming)

Check list:

  • xqsystem/login: 🟢
  • xqsystem/init_info: 🟢
  • misystem/status: 🟢
  • xqnetwork/mode: 🟢
  • misystem/topo_graph: 🟢
  • xqsystem/check_rom_update: 🔴
  • xqnetwork/wan_info: 🟢
  • misystem/led: 🟢
  • xqnetwork/wifi_detail_all: 🟢
  • xqnetwork/wifi_diag_detail_all: 🟢
  • xqnetwork/avaliable_channels: 🟢
  • xqnetwork/wifi_connect_devices: 🟢
  • misystem/devicelist: 🟢
  • xqnetwork/wifiap_signal: 🟢
  • misystem/newstatus: 🟢
  • xqsystem/reboot: ⚪
  • xqsystem/upgrade_rom: ⚪
  • xqsystem/flash_permission: ⚪
  • xqnetwork/set_wifi: ⚪
  • xqnetwork/set_wifi_without_restart: ⚪

Add supports RA50

Check list:

  • xqsystem/login: 🟢
  • xqsystem/init_info: 🟢
  • xqsystem/reboot: 🟢
  • xqnetwork/wifi_up: 🟢
  • xqnetwork/wifi_down: 🟢
  • xqnetwork/set_wifi: 🟢
  • misystem/status: 🟢
  • xqnetwork/mode: 🟢
  • misystem/topo_graph: 🟢
  • xqnetwork/wan_info: 🟢
  • misystem/led: 🟢
  • xqnetwork/wifi_detail_all: 🟢
  • xqnetwork/avaliable_channels: 🟢
  • xqnetwork/wifi_connect_devices: 🟢
  • misystem/devicelist: 🟢
  • misystem/newstatus: 🟢
  • xqnetwork/wifiap_signal: 🟢

Feedback V2.0.0b

Thanks for this great huge update to V2! Some Feedback from me:

  1. I would recommend generating the unique ids not like "miwif_macadress", instead it would be better to generate the name based on its own device name registered in miwif.
    For example if I have a device named TCL-AndroidTV, its name should be device_tracker.tcl_androidtv or maybe device_tracker.tcl_androidtv_macadress and not device_tracker.miwifi_f8_4f_ad_4f_82_99

  2. Some sensors are loosing its connecting quite fast:
    image
    I am unsure how to provide some better information.

  3. The temperature sensor always displays 0.0°C

  4. It seems I cant use two miwifi with this integration anymore. I can connect successfully to both of them, but all sensors switches etc are in the second miwif device from the first miwifi device.
    Meaning: Once i connect my second miwifi device, it moves the integration stuff from the first integration to the second integration and I am missing the controls for the second device.

To fix any issue I have already tried removing the integration multiple times.

[BUG] Integration does not connect to the router

Describe the bug
Everything was working fine until today's update.
After updating all sensors gave unknown states.

Since it was not solved, he reinstalled the HACK and the Integration.

The problem is that it doesn't connect to the router, it seems... Since entering the IP to activate the integration gives an error

Logger: custom_components.miwifi.updater
Source: custom_components/miwifi/updater.py:287
Integration: MiWiFi (documentation, issues)
First occurred: 22:11:19 (10 occurrences)
Last logged: 22:12:28

Log

Error connecting to router (attempt #6 of 10): LuciConnectionException('Connection error')
Error connecting to router (attempt #7 of 10): LuciConnectionException('Connection error')
Error connecting to router (attempt #8 of 10): LuciConnectionException('Connection error')
Error connecting to router (attempt #9 of 10): LuciConnectionException('Connection error')
Error connecting to router (attempt #10 of 10): LuciConnectionException('Connection error')

Please complete the following information:

  • HASS version: [e.g. 2022.4.6]
  • Component version [e.g. 2.5.1]
  • Router model [e.g. AX3600]
  • Router firmware version [1.1.19 CN]

name device_tracker idea

If possible device_tracker name is mac address, i mean device_tracker.iphonesam or device_tracker.12_45_ed_12_45_00.
Sorry for my english.

Thanks for your job !

Erreur new version 2.0.5 ax3600 mod repeater

Cette erreur provient d'une intégration personnalisée

Logger: homeassistant
Source: custom_components/miwifi/updater.py:843
Integration: MiWiFi (documentation, issues)
First occurred: 22:34:36 (1 occurrences)
Last logged: 22:34:36

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/miwifi/init.py", line 86, in async_start
await updater.update(True)
File "/config/custom_components/miwifi/updater.py", line 236, in update
await self._async_prepare(method, self.data)
File "/config/custom_components/miwifi/updater.py", line 348, in _async_prepare
await action(data)
File "/config/custom_components/miwifi/updater.py", line 678, in _async_prepare_device_restore
self._clean_devices()
File "/config/custom_components/miwifi/updater.py", line 843, in _clean_devices
delta = now - datetime.strptime(
TypeError: strptime() argument 1 must be str, not list

[Feature Request] Option to control WiFi range through HA

Thank you again for your awesome work. The integration is working so great for me.

i am only missing one option, so i am asking if it is possible:
I am using the Chinese Firmware which allows me to use higher WiFi ranges. I don’t know if these higher values are bad or good, but I would feel better if I could automate the WiFi range via HA.
MiWifi offers three options: short, middle or „through the wall“
I would like to automate these options that HA could set it at night to short and over the day when I need it to „through the wall“.

Does the Luci API allow access to these values? For example to create a HA Switch with the value „on“ for „through the wall“ and off for short? Or even better a input_selector

thank you in advance

Questions ?? Miwifi repeater recognize password or invalid ip

Sans titre

I've got my 2 MiWifi repeater recognize, but i can't give a password, this is not the same as the router.
When i give the same as the router I've got an "Invalid IP" message.

Can hass-miwifi detect the devices of the repeater?
If yes what is the way to give the good IP/Password?

Thanks for all.

Add supports RM1800

Check list:

  • xqsystem/login: 🟢
  • xqsystem/init_info: 🟢
  • xqsystem/reboot: 🟢
  • misystem/status: 🟢
  • xqnetwork/mode: 🟢
  • misystem/topo_graph: 🟢
  • xqnetwork/wan_info: 🟢
  • misystem/led: 🟢
  • xqnetwork/wifi_detail_all: 🟢
  • xqnetwork/wifi_connect_devices: 🟢
  • misystem/devicelist: 🟢
  • misystem/newstatus: 🟢

[BUG] Some enitiy not available after update

Describe the bug
Some entities not available after update. Delete whole component and re-download won't fix.

miwifiss
miwifi11
miwifi12
miwifi13

Please complete the following information:

  • HASS version: 2022.4.7
  • Component version 2.54/2.6.0
  • Router model : R3600
  • Router firmware version 3.0.22 (LV)

MiWiFi no

Снимок экрана 2022-02-26 в 00 19 42

Снимок экрана 2022-02-26 в 00 20 10

Settings > Integrations > Plus > MiWiFi

no integration.
Where to look for it?
how to install it correctly?

Platform miwifi does not generate unique IDs

I have 2 miwifi.

Logger: homeassistant.components.device_tracker
Source: helpers/entity_platform.py:593
Integration: Отслеживание устройств (documentation, issues)
First occurred: 16:41:25 (18 occurrences)
Last logged: 16:41:25

Platform miwifi does not generate unique IDs. ID miwifi-xx:xx:xx:xx:xx:xx is already used by device_tracker.miwifi_xx_xx_xx_xx_xx_xx - ignoring device_tracker.miwifi_xx_xx_xx_xx_xx_xx

Error adding entities for domain

Error adding entities for domain switch with platform miwifi 11:13:29 – (ERROR) Switch - message first occurred at 11:13:29 and shows up 2 times Error adding entities for domain button with platform miwifi 11:13:29 – (ERROR) Button - message first occurred at 11:13:29 and shows up 2 times Error adding entities for domain light with platform miwifi 11:13:29 – (ERROR) Light - message first occurred at 11:13:29 and shows up 2 times Error adding entities for domain sensor with platform miwifi 11:13:29 – (ERROR) Sensor - message first occurred at 11:13:29 and shows up 2 times Error adding entities for domain binary_sensor with platform miwifi 11:13:29 – (ERROR) Binary sensor - message first occurred at 11:13:29 and shows up 2 times

`Logger: homeassistant.components.switch
Source: helpers/entity_registry.py:383
Integration: Switch (documentation, issues)
First occurred: 11:13:29 (2 occurrences)
Last logged: 11:13:29

Error adding entities for domain switch with platform miwifi
Error while setting up miwifi platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in _async_add_entity
entry = entity_registry.async_get_or_create(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 383, in async_get_or_create
raise ValueError("entity_category must be a valid EntityCategory instance")
ValueError: entity_category must be a valid EntityCategory instance
`

Used to have a button for reboot, light for led control, and uptime sensor.

Cero devices detected

Hello
I have installed your integration hass-miwifi but it not run completely. It nor detect my connected devices, all it are 0. I have reset my router with your integratition but happens the same. I have two router Xiaomi AX1800.
Please, You can help me?
pp
rr

Thanks

[question] Router support with custom firmware

The question is very stupid. Is this integration suitable for a Xiaomi Mi Router 4A Giga with firmware OpenWrt 21.02.2?

I saw this message and thought that everything should work, but alas no.
Many more Xiaomi and Redmi routers supported by MiWiFi (OpenWRT - Luci API)

The first time the integration cursed for the wrong IP, and later it showed like this:
image

I'm a newbie, and if I misunderstood something, I'm sorry.

ax9000 problem with "5G Game" wifi

2021-10-28 22:22:14 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/miwifi/core/luci_data.py", line 168, in refresh
await self.async_update()
File "/config/custom_components/miwifi/core/luci_data.py", line 93, in async_update
await self.api.prepare_data()
File "/config/custom_components/miwifi/core/luci.py", line 133, in prepare_data
await self.set_devices_list()
File "/config/custom_components/miwifi/core/luci.py", line 225, in set_devices_list
device["connection"] = CONNECTION_RANGES[device["type"]]
KeyError: 6

Slowing down when starting Home Assistant

I have noticed a slow start and went to investigate what is taking a certain time to start, I looked at the miwifi was more than 15 seconds to start. Do you know what it can be?

I have an average of 50 devices on my network at all times. Is it possible to decrease this startup time?

image

Guest Wi-Fi network

Good morning,
Congratulations for this project.
I would like to know if for future revisions it would be possible to add the guest Wi-Fi network (to activate and deactivate it)
, many thanks.

Aborted message with AX3600 and China 1.0.424 rom

I am unable to connect my AX3600 router with this integration.
I am only getting an „aborted“ message while adding the integration in the GUI.
Legacy yaml doesn’t seem to work too.
No error log.

password and IP is definitely correct.
China Rom (stable) with Root SSH Access if that matters.
The official Xiaomi device tracker integration seems also not to work, but I don’t see any log messages.

Error in the Logs

Hey. Installed the integration yesterday. Everything works perfect. AX3600 CN. But I get one error in the logs.

The unit of sensor.miwifi_28_d1_27_70_d4_16_wan_download_speed is changing, got multiple {'MB/s', 'KB/s'}, generation of long term statistics will be suppressed unless the unit is stable and matches the unit of already compiled statistics (B/s). Go to https://my.home-assistant.io/redirect/developer_statistics to fix this The unit of sensor.miwifi_28_d1_27_70_d4_16_wan_upload_speed is changing, got multiple {'KB/s', 'B/s'}, generation of long term statistics will be suppressed unless the unit is stable and matches the unit of already compiled statistics (KB/s). Go to https://my.home-assistant.io/redirect/developer_statistics to fix this

[BUG] Incorrect password for AX3000 model RA82

Hi there!

I'm able to login through the website or app with the admin password but the MiWifi integration is throwing me this error:
image

I also tried the WiFi password, just for testing, same result.

Checking the log I found this:

2022-05-08 16:39:46 DEBUG (MainThread) [custom_components.miwifi.luci] Successful request (http://192.168.31.X/cgi-bin/luci/api/xqsystem/login): b'{"code":401,"msg":"not auth"}'
2022-05-08 16:39:46 DEBUG (MainThread) [custom_components.miwifi.luci] Failed to get token (http://192.168.31.X/cgi-bin/luci/api/xqsystem/login): {'code': 401, 'msg': 'not auth'}
2022-05-08 16:39:46 DEBUG (MainThread) [custom_components.miwifi.updater] Finished fetching MiWifi updater data in 1.260 seconds (success: True)
2022-05-08 16:39:46 DEBUG (MainThread) [custom_components.miwifi.config_flow] Verify access code: 403
2022-05-08 16:39:58 DEBUG (MainThread) [custom_components.miwifi.luci] Successful request (http://192.168.31.X/cgi-bin/luci/api/xqsystem/login): b'{"code":401,"msg":"not auth"}'
2022-05-08 16:39:58 DEBUG (MainThread) [custom_components.miwifi.luci] Failed to get token (http://192.168.31.X/cgi-bin/luci/api/xqsystem/login): {'code': 401, 'msg': 'not auth'}
2022-05-08 16:39:58 DEBUG (MainThread) [custom_components.miwifi.updater] Finished fetching MiWifi updater data in 1.227 seconds (success: True)
2022-05-08 16:39:58 DEBUG (MainThread) [custom_components.miwifi.config_flow] Verify access code: 403

Router AX3000 Mesh System
Model RA82
Software v. Global 1.3.27

[BUG] Cannot turn off Wifi Switch

Describe the bug
If I turn off any wifi switch (5ghz/2,4ghz) it will turn itself on back again within 30 seconds.

image
image

Please complete the following information:

System Health

version core-2022.4.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.9
os_name Linux
os_version 5.10.103-v8
arch aarch64
timezone Europe/Berlin
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4615
Installed Version 1.24.5
Stage running
Available Repositories 1095
Downloaded Repositories 21
Home Assistant Supervisor
host_os Home Assistant OS 7.6
update_channel stable
supervisor_version supervisor-2022.04.0
docker_version 20.10.9
disk_total 234.0 GB
disk_used 54.5 GB
healthy true
supported true
board rpi4-64
supervisor_api ok
version_api ok
installed_addons SSH & Web Terminal (10.1.1), AdGuard Home (4.5.0), Home Assistant Google Drive Backup (0.106.2), MariaDB (2.4.0), Mosquitto broker (6.0.1), AirCast (3.3.0), Studio Code Server (4.2.0), Vaultwarden (Bitwarden) (0.16.0), Google Assistant SDK (2.5.0), Nextcloud (20.0.3), heimdall (0.2.0), Nginx Proxy Manager (0.11.0), Wiki.JS (1.2.3), Apache2 Minimal with MariaDB Client (2.2.1), Bash Script Executer (1.3.1), Switch LAN Play Server (1.2.1), Switch LAN Play Client (1.0.0), Assistant Relay BETA (4.0.0b2), ICantBelieveItsNotValetudo (3.6.2)
Dashboards
dashboards 1
resources 10
views 11
mode storage
- Component version: 2.4.1 - Router model: AX3600 - Router firmware version: 1.1.19

Duplicate unique id

When the integration is configured twice (eg main router + mesh repeater) the unique id of some entities are being ignored due to the unique id duplicity error.

Logs:

2022-04-10 19:59:15 ERROR (MainThread) [homeassistant.components.device_tracker] Platform miwifi does not generate unique IDs. ID miwifi-6E:43:3C:87:BF:B7 is already used by device_tracker.miwifi_6e_43_3c_87_bf_b7 - ignoring device_tracker.miwifi_6e_43_3c_87_bf_b7
2022-04-10 19:59:53 ERROR (MainThread) [homeassistant.components.device_tracker] Platform miwifi does not generate unique IDs. ID miwifi-6E:43:3C:87:BF:B7 is already used by device_tracker.miwifi_6e_43_3c_87_bf_b7 - ignoring device_tracker.miwifi_6e_43_3c_87_bf_b7
2022-04-10 19:59:53 ERROR (MainThread) [homeassistant.components.device_tracker] Platform miwifi does not generate unique IDs. ID miwifi-6E:43:3C:87:BF:B7 is already used by device_tracker.miwifi_6e_43_3c_87_bf_b7 - ignoring device_tracker.miwifi_6e_43_3c_87_bf_b7
2022-04-10 20:01:35 ERROR (MainThread) [homeassistant.components.device_tracker] Platform miwifi does not generate unique IDs. ID miwifi-30:CB:F8:29:80:7D is already used by device_tracker.miwifi_30_cb_f8_29_80_7d - ignoring device_tracker.miwifi_30_cb_f8_29_80_7d
2022-04-10 20:02:53 ERROR (MainThread) [homeassistant.components.device_tracker] Platform miwifi does not generate unique IDs. ID miwifi-30:CB:F8:29:80:7D is already used by device_tracker.miwifi_30_cb_f8_29_80_7d - ignoring device_tracker.miwifi_30_cb_f8_29_80_7d
2022-04-10 20:02:53 ERROR (MainThread) [homeassistant.components.device_tracker] Platform miwifi does not generate unique IDs. ID miwifi-30:CB:F8:29:80:7D is already used by device_tracker.miwifi_30_cb_f8_29_80_7d - ignoring device_tracker.miwifi_30_cb_f8_29_80_7d

The loop keyword argument is deprecated. Please report issue to the custom component author.

2021-12-18 20:11:37 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for miwifi using this method at custom_components/miwifi/core/luci.py, line 97: with async_timeout.timeout(self.timeout, loop = self._loop):

2021-12-18 20:11:39 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for miwifi using this method at custom_components/miwifi/core/luci.py, line 324: with async_timeout.timeout(self.timeout, loop = self._loop):

Add supports R4A

Check list:

  • xqsystem/login: 🟢
  • xqsystem/init_info: 🟢
  • xqsystem/reboot: 🟢
  • misystem/status: 🟢
  • xqnetwork/mode: 🟢
  • misystem/topo_graph: 🟢
  • xqnetwork/wan_info: 🟢
  • misystem/led: 🟢
  • xqnetwork/wifi_detail_all: 🟢
  • xqnetwork/wifi_connect_devices: 🟢
  • misystem/devicelist: 🟢
  • misystem/newstatus: 🟢

Unable to connect my MI Wifi Router 4A Gigabit

I'm trying to connect my router MI 4A Gigabit with your integration but it doesn't work.
image

I have an error message "Invalid IP". I try also try with IP 192.168.31.1 and have the same issue.

With the DEBUG mode in HA I have catch this informations:

2022-04-07 16:48:20 DEBUG (MainThread) [custom_components.miwifi.luci] Connection error ConnectError('All connection attempts failed')
2022-04-07 16:48:20 DEBUG (MainThread) [custom_components.miwifi.updater] Finished fetching MiWifi updater data in 0.012 seconds (success: True)
2022-04-07 16:48:20 DEBUG (MainThread) [custom_components.miwifi.config_flow] Verify access code: 404
2022-04-07 16:48:32 DEBUG (MainThread) [custom_components.miwifi.luci] Connection error ConnectError('All connection attempts failed')
2022-04-07 16:48:32 DEBUG (MainThread) [custom_components.miwifi.updater] Finished fetching MiWifi updater data in 0.013 seconds (success: True)
2022-04-07 16:48:32 DEBUG (MainThread) [custom_components.miwifi.config_flow] Verify access code: 404
2022-04-07 16:48:56 DEBUG (MainThread) [custom_components.miwifi.luci] Connection error ConnectTimeout('')
2022-04-07 16:48:56 DEBUG (MainThread) [custom_components.miwifi.updater] Finished fetching MiWifi updater data in 7.517 seconds (success: True)
2022-04-07 16:48:56 DEBUG (MainThread) [custom_components.miwifi.config_flow] Verify access code: 404

Could you help me?

Getting "aborted" message when trying to add (AX9000)

I did upgrade the firmware to the Chinese developer firmware (1.0.140). Do I need to rollback to 1.0.108?

{"romversion":"1.0.140","countrycode":"CN","code":0,"id":"30320/F0Z735418","routername":"Whatever","inited":1,"connect":0,"routerId":"b8e6247f-0668-9f42-3889-d52ac8228556","maccel":"1","model":"xiaomi.router.ra70","hardware":"RA70","bound":0,"language":"zh_cn","modules":{"replacement_assistant":"1"}}
This error originated from a custom integration.

Logger: custom_components.miwifi.config_flow
Source: custom_components/miwifi/config_flow.py:72
Integration: MiWiFi (documentation, issues)
First occurred: 9:27:40 PM (2 occurrences)
Last logged: 9:29:28 PM

Error setting up MiWiFi API: LuciConnectionError()

Platform miwifi does not generate unique IDs

Logger: homeassistant.components.device_tracker
Source: helpers/entity_platform.py:566
Integration: Rastreador de dispositivo (documentation, issues)
First occurred: 21:20:42 (1 occurrences)
Last logged: 21:20:42

Platform miwifi does not generate unique IDs. ID device_tracker.tira_rgb_1 is already used by device_tracker.tira_rgb_1 - ignoring device_tracker.tira_rgb_1

How do I solve this issue?

New error version 2.1.1

Cette erreur provient d'une intégration personnalisée

Logger: custom_components.miwifi.updater
Source: custom_components/miwifi/updater.py:254
Integration: MiWiFi (documentation, issues)
First occurred: 23:54:38 (1 occurrences)
Last logged: 23:54:38

Error connecting to router (attempt #1 of 10): LuciConnectionException()

Reboot of the Router creates new entites in HA

It looks like that every reboot of the MiWifi Router creates new switches and sensors.
This blows HA and syncs not working buttons to my Google Home.

This looks like a bug or am I missing something?

image

Error doing job: Task exception was never retrieved

Logger: homeassistant
Source: custom_components/miwifi/helper.py:102
Integration: MiWifi (documentation, issues)
First occurred: 10:26:25 (216 occurrences)
Last logged: 12:28:15

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 134, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh
update_callback()
File "/config/custom_components/miwifi/device_tracker.py", line 319, in _handle_coordinator_update
is_connected = parse_last_activity(
File "/config/custom_components/miwifi/helper.py", line 102, in parse_last_activity
return datetime.strptime(last_activity, "%Y-%m-%dT%H:%M:%S")
TypeError: strptime() argument 1 must be str, not tuple

Task exception was never retrieved

Опять .... )

Logger: homeassistant
Source: custom_components/miwifi/helper.py:102
Integration: MiWifi (documentation, issues)
First occurred: 12:40:10 (4 occurrences)
Last logged: 13:20:49

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 137, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 268, in _async_refresh
update_callback()
File "/config/custom_components/miwifi/device_tracker.py", line 344, in _handle_coordinator_update
is_connected = parse_last_activity(
File "/config/custom_components/miwifi/helper.py", line 102, in parse_last_activity
return datetime.strptime(last_activity, "%Y-%m-%dT%H:%M:%S")
TypeError: strptime() argument 1 must be str, not tuple

Add miwifi logo

The miwifi logo could be added to the integration, it would look much better.

image

could be this logo that is their official:

miwifi

No info about devices connected on AX1800 as AP

Hi,
First I would like to thank you for the development and distribution of this addon for HA !!!

I'm running the version Firmware: 1.0.390 on the rm1800 as an AP, the main router is from another brand.
I can connect the router to the HA without a problem, the issue is that I cannot see any device connected to the wifi , no mac at all.
When I activate the option force load reboot set to True and reboot the HA and the router, it stop's loading all information and show the message at the integration page Retrying setup: None , I tried on graph mode and trough yaml but had the same issue.

I would like to know if maybe is a misconfiguration or I need to downgrade to version 1.0.378(CN)

Thanks

New error version 2.0.5 device tracker

Cette erreur provient d'une intégration personnalisée

Logger: homeassistant
Source: custom_components/miwifi/device_tracker.py:383
Integration: MiWiFi (documentation, issues)
First occurred: 23:41:59 (27 occurrences)
Last logged: 23:41:59

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/miwifi/device_tracker.py", line 383, in check_ports
result = sock.connect_ex((self.ip_address, port))
TypeError: str, bytes or bytearray expected, not NoneType

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.