home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.06k stars 29.73k forks source link

qmi.powerstrip.v1 device doesn't work #37960

Closed shlatchz closed 3 years ago

shlatchz commented 4 years ago

The problem

qmi.powerstrip.v1 device doesn't work

Environment

Problem-relevant configuration.yaml

  - platform: xiaomi_miio
    host: 192.168.1.110
    token: 703d73327520d9907c5b510930ce2514
    model: qmi.powerstrip.v1
    name: "Coffee Table Power Strip"

Traceback/Error logs

2020-07-18 16:03:29 ERROR (MainThread) [homeassistant.components.xiaomi_miio.switch] Got exception while fetching the state: Unable to discover the device 192.168.1.110
2020-07-18 16:03:29 WARNING (MainThread) [homeassistant.components.switch] Setup of switch platform xiaomi_miio is taking over 10 seconds.
2020-07-18 16:04:00 ERROR (SyncWorker_1) [miio.miioprotocol] Unable to discover a device at address 192.168.1.110

Additional information

probot-home-assistant[bot] commented 4 years ago

Hey there @rytilahti, @syssi, mind taking a look at this issue as its been labeled with an integration (xiaomi_miio) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

rytilahti commented 4 years ago

Is it working with python-miio & miiocli? If not, that's an upstream issue and should be reported there. Looking at the log it looks like that the device is not responsive at all ("Unable to discover the device" indicates that the device did not respond to the initial handshake).

shlatchz commented 4 years ago

@rytilahti I see it with miio

Device ID: 79205124
Model info: Unknown
Address: 192.168.1.110
Token: ???
Support: Unknown
shlatchz commented 4 years ago

updated token

Device ID: 79205124
Model info: qmi.powerstrip.v1
Address: 192.168.1.110
Token: a78f3b309bc0cdb4300c4e49af21a9b1 via stored token
Support: At least basic

Device ID: 79205124
Model info: qmi.powerstrip.v1
Address: 192.168.1.110
Token: a78f3b309bc0cdb4300c4e49af21a9b1 via stored token
Support: At least basic

Type info: miio:power-strip, miio, power-strip
Capabilities: switchable-mode, mode, switchable-power, restorable-state, power, state

Firmware version: 3.4.2_82
Hardware version: RTL8711AF

WiFi: mr_poopybutthole (62:38:E0:CE:42:39) RSSI: -45

Remote access (Mi Home App): UDP

Properties:
  - power: false
  - mode: normal
shlatchz commented 4 years ago

home assistant still produces the same error

rytilahti commented 4 years ago

How about miiocli plug --ip <address> --token <token> status? I don't see why it wouldn't be working though, considering the token seems to be correct now.

shlatchz commented 4 years ago

@rytilahti no output

i'm using miio not miiocli

rytilahti commented 4 years ago

Yes, and homeassistant is using python-miio (which is another implementation, miiocli is python-miio's console tool), but it should also work anyway. You get no output at all? How about info instead of status? You can also try to enable the debug output by adding --debug right after the miiocli.

shlatchz commented 4 years ago

@rytilahti

mirobo discover
INFO:miio.discovery:Discovering devices with mDNS, press any key to quit...
INFO:miio.discovery:lumi-gateway-v3_miio83641608._miio._udp.local. @ 192.168.1.205, check https://github.com/Danielhiversen/PyXiaomiGateway: token: 00000000000000000000000000000000
INFO:miio.discovery:Found a supported 'ChuangmiIr' at 192.168.1.232 - token: 780b691de8fb723257957000c180b009
INFO:miio.discovery:Found a supported 'PowerStrip' at 192.168.1.123 - token: 00000000000000000000000000000000
miiocli --debug plug --ip 192.168.1.110 --token a78f3b309bc0cdb4300c4e49af21a9b1 status
INFO:miio.cli:Debug mode active
ERROR:miio.miioprotocol:Unable to discover a device at address 192.168.1.110
DEBUG:miio.click_common:Exception: Unable to discover the device 192.168.1.110
Traceback (most recent call last):
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\miio\click_common.py", line 59, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\miio\click_common.py", line 280, in wrap
    kwargs["result"] = func(*args, **kwargs)
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\click\decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\miio\click_common.py", line 245, in command_callback
    return miio_command.call(miio_device, *args, **kwargs)
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\miio\click_common.py", line 193, in call
    return method(*args, **kwargs)
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\miio\chuangmi_plug.py", line 139, in status
    values = self.get_properties(properties)
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\miio\device.py", line 232, in get_properties
    values.extend(self.send(property_getter, _props[:max_properties]))
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\miio\device.py", line 147, in send
    command, parameters, retry_count, extra_parameters=extra_parameters
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\miio\miioprotocol.py", line 150, in send
    self.send_handshake()
  File "c:\users\mrstudent-lc\appdata\local\programs\python\python37\lib\site-packages\miio\miioprotocol.py", line 77, in send_handshake
    raise DeviceException("Unable to discover the device %s" % self.ip)
miio.exceptions.DeviceException: Unable to discover the device 192.168.1.110
Error: Unable to discover the device 192.168.1.110
rytilahti commented 4 years ago

You have different IP address in the discovery than in the following info query, could that be the reason? Or do you have two devices, where one is not being discovered and the other one is?

shlatchz commented 4 years ago

@rytilahti those are other devices, which do work. Only the qmi.powerstrip.v1 doesn't It's weird that the device is discoverable by miio but not by miiocli.

rytilahti commented 4 years ago

Yes, that's really odd, I don't really have an idea what could cause such behavior..

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.