AlexxIT / XiaomiGateway3

Home Assistant custom component for control Xiaomi Multimode Gateway (aka Gateway 3), Xiaomi Multimode Gateway 2, Aqara Hub E1 on default firmwares over LAN
https://github.com/AlexxIT/Blog
MIT License
2.47k stars 348 forks source link

Can't get device viomi.fan.v7 #1443

Closed lindsaymarkward closed 2 months ago

lindsaymarkward commented 2 months ago

Hi. Thanks for your excellent integration :)
I have a WiFi pedestal fan visible in my Mi Home app that I cannot access with this integration. Is there a way to use this integration to access and control it?

When I reload the integration, it does not find the fan. (It does have all my Zigbee buttons and sensors.) My configuration has two "integration entries", the gateway IP with 9 devices and my cloud login (email) with no devices.

When I click "configure" for the cloud one, I see these two choices:

Device

When I select the fan and click submit the screen updates to show the following extra information and still has the radio buttons:

MiCloud devices info
Name: DC Fan
Model: viomi.fan.v7
MAC: xx:xx
IP: 192.168.1.131
Token: xx
Firmware: 2.2.0

Clicking "submit" just makes the window move a bit, like a refresh, and it stays like that - no change. I enabled more logs and this is what I see when clicking submit:

2024-09-05 11:25:28.413 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.1.185] {'topic': 'log/z3', 'd
ata': b'emberAfPluginConcentratorUpdateEventHandler : 0 FFFD'} 
2024-09-05 11:25:28.419 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.1.185] {'topic': 'log/z3', 'd
ata': b'Coordinator sent MTORR'} 
2024-09-05 11:25:41.730 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.1.185] {'topic': 'gw/588E81FF
FEF6E63E/heartbeat', 'data': b'{"networkUp":true,"networkPanId":"0x7409","radioTxPower":7,"radioChannel":15}'} 
2024-09-05 11:25:55.980 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.1.185] {'topic': 'openmiio/re
port', 'data': b'{"gateway":{"firmware":"1.5.0_0102","model":"lumi.gateway.mgl03"},"miio":{"cloud_starts":1,"cloud_state
":"cloud_connected","cloud_uptime":"32m30s"},"openmiio":{"uptime":"32m31s","version":"1.2.1"},"serial":{"bluetooth_rx":2
439,"bluetooth_tx":365,"zigbee_rx":6597,"zigbee_tx":5127,"zigbee_oe":4},"zigbee":{"z3_starts":2,"z3_uptime":"31m18s"}}'}

(None of that looks like any kind of result of my choice.)

Here are some details from the Home Assistant UI about the gateway:

Gateway: ZNDMWG03LM, ZNDMWG02LM, YTC4044GL, lumi.gateway.mgl03 by Xiaomi Firmware: 1.5.0_0102

I have successfully controlled this fan with a second integration, hass-xiaomi-miot, but I'd like to use just one if I can.

So, can I use this fan with this XiaomiGateway3 integration? Thanks!

AlexxIT commented 2 months ago

Gateway not related to WiFi devices https://github.com/AlexxIT/XiaomiGateway3?tab=readme-ov-file#supported-devices

lindsaymarkward commented 2 months ago

Thanks for the prompt reply! The integration shows the fan so it looked to me like I could get it to work somehow. Perhaps you could make it not show these devices?

lindsaymarkward commented 2 months ago

Also, I just reinstalled the hass-xiaomi-miot integration to get my fan working and spent a while trying to figure out how to get the token, when I realised that your integration shows this! I imagine this is a lot less work than most of the other methods like extracting data from a phone backup or using a Python script. Thanks 👍

Token: xx

AlexxIT commented 2 months ago

https://github.com/AlexxIT/XiaomiGateway3?tab=readme-ov-file#obtain-mi-home-device-token