Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xiaomi Power Strip V1 is unable to handle some V2 properties #302

Closed
syssi opened this issue Apr 8, 2018 · 7 comments
Closed

Xiaomi Power Strip V1 is unable to handle some V2 properties #302

syssi opened this issue Apr 8, 2018 · 7 comments

Comments

@syssi
Copy link
Collaborator

syssi commented Apr 8, 2018

cp. home-assistant/core#13749

@syssi
Copy link
Collaborator Author

syssi commented Apr 8, 2018

@anounyym1 Could you provide the output of

mirobo --ip <ip> --token <token> raw_command get_prop "['power', 'temperature', 'current', 'mode', 'power_consume_rate', 'wifi_led', 'power_price', 'voltage', 'power_factor', 'elec_leakage']"

I would like to know which properties the qmi.powerstrip.v1 can handle.

@anounyym1
Copy link

Sending cmd get_prop with params ['power', 'temperature', 'current', 'mode', 'power_consume_rate', 'wifi_led', 'power_price', 'voltage', 'power_factor', 'elec_leakage']
ERROR:miio.protocol:unable to parse json '{"result":["off",50,1,"normal",0,,,23057,12,8],"id":1}': Expecting value: line 1 column 34 (char 33)
Traceback (most recent call last):
  File "/usr/local/bin/mirobo", line 11, in <module>
    sys.exit(cli())
  File "/home/pi/.local/lib/python3.5/site-packages/miio/click_common.py", line 47, in __call__
    return self.main(*args, **kwargs)
  File "/home/pi/.local/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/pi/.local/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pi/.local/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pi/.local/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/pi/.local/lib/python3.5/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/home/pi/.local/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/pi/.local/lib/python3.5/site-packages/miio/vacuum_cli.py", line 596, in raw_command
    click.echo(vac.raw_command(cmd, params))
  File "/home/pi/.local/lib/python3.5/site-packages/miio/vacuum.py", line 270, in raw_command
    return self.send(cmd, params)
  File "/home/pi/.local/lib/python3.5/site-packages/miio/device.py", line 264, in send
    self.__id = m.data.value["id"]
TypeError: 'NoneType' object is not subscriptable

@syssi
Copy link
Collaborator Author

syssi commented Apr 8, 2018

Thanks for the fast feedback. This helps a lot!

@syssi
Copy link
Collaborator Author

syssi commented Apr 8, 2018

This request provides a proper responds, correct?

mirobo --ip <ip> --token <token> raw_command get_prop "[ 'power', 'temperature', 'current', 'mode', 'power_consume_rate', 'voltage', 'power_factor', 'elec_leakage']"

@anounyym1
Copy link

Yes

Sending cmd get_prop with params ['power', 'temperature', 'current', 'mode', 'power_consume_rate', 'voltage', 'power_factor', 'elec_leakage']
['off', 50, 1, 'normal', 0, 23137, -12, 8]

Thank you!

@syssi
Copy link
Collaborator Author

syssi commented Apr 8, 2018

Cool. This fix won't make it into Home Assistant 0.67 but it will be fixed with 0.68. In the mean time you could change the model at your configuration.yaml to chuangmi.plug.m1. You will lose the power consumption attributes but the device will be controllable again.

@anounyym1
Copy link

That seems to work, thanks!

@syssi syssi closed this as completed in #303 Apr 8, 2018
@syssi syssi changed the title Xiaomi Power Strip V1 is unable to handle the new properties Xiaomi Power Strip V1 is unable to handle some V2 properties Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants