Open DmitryUdaltsov opened 4 years ago
php miio-cli.php --ip 192.168.0.232 --info --token xxx
{"id":1,"result":{"life":1314583,"uid":1671163069,"model":"dmaker.airfresh.a1","token":"xxx","ipflag":1,"fw_ver":"2.0.7","mcu_fw_ver":"0005","miio_ver":"0.0.8","hw_ver":"esp8266","mmfree":24012,"mac":"44:23:7C:65:AA:08","wifi_fw_ver":"2709610","ap":{"ssid":"xxx","bssid":"60:31:97:3C:40:E4","rssi":-52,"primary":3},"netif":{"localIp":"192.168.0.232","mask":"255.255.255.0","gw":"192.168.0.100"}},"exe_time":30}
php miio-cli.php --ip 192.168.0.232 --token xxx --sendcmd '{"method":"get_prop",,"params":[],"id":1}'
{"id":1,"result":[31,426,0,93,79,142,0,false,"favourite",false,false,false,true,false],"exe_time":180}
miiocli airpurifier --ip 192.168.0.232 --token xxx info
Model: dmaker.airfresh.a1
Hardware version: esp8266
Firmware version: 2.0.7
Network: {'localIp': '192.168.0.232', 'mask': '255.255.255.0', 'gw': '192.168.0.100'}
AP: {'ssid': 'xxx', 'bssid': '60:31:97:3C:40:E4', 'rssi': -48, 'primary': 1}
miiocli airpurifier --ip 192.168.0.232 --token xxx status
Traceback (most recent call last):
File "/usr/local/bin/miiocli", line 11, in <module>
load_entry_point('python-miio==0.4.5', 'console_scripts', 'miiocli')()
File "/usr/local/lib/python3.6/dist-packages/miio/cli.py", line 43, in create_cli
return cli(auto_envvar_prefix="MIIO")
File "/usr/local/lib/python3.6/dist-packages/miio/click_common.py", line 54, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/miio/click_common.py", line 267, in wrap
result_msg = result_msg_fmt.format(**kwargs)
File "/usr/local/lib/python3.6/dist-packages/miio/airpurifier.py", line 142, in mode
return OperationMode(self.data["mode"])
File "/usr/lib/python3.6/enum.py", line 293, in __call__
return cls.__new__(cls, value)
File "/usr/lib/python3.6/enum.py", line 535, in __new__
return cls._missing_(value)
File "/usr/lib/python3.6/enum.py", line 548, in _missing_
raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 79 is not a valid OperationMode
@syssi, hello! I also have dmaker.airfresh.a1. How can I help add a device? I see fresh activity with details here
Retrieve all properties: get_prop ["all"]
Could somebody provide the output of:
miiocli device --ip IP --token TOKEN info
miiocli device --ip IP --token TOKEN raw_command get_prop '["all"]'
@syssi , hello
admin@admin ~ % miiocli device --ip 192.168.0.100 --token ************************ info
Model: dmaker.airfresh.a1
Hardware version: esp8266
Firmware version: 2.1.0
Network: {'localIp': '192.168.0.100', 'mask': '255.255.255.0', 'gw': '192.168.0.1'}
AP: {'ssid': '********', 'bssid': '**:11:DC:49:**:**', 'rssi': -66, 'primary': 6}
admin@admin ~ % miiocli device --ip 192.168.0.100 --token ************************ raw_command get_prop '["all"]'
Running command raw_command
[2, 543, 10, 150, 45, 81, 60, True, 'auto', False, False, False, False, False]
@ilshatms Next step: Could you provide the output of:
# try to retrieve all properties again for comparison
miiocli device --ip IP --token TOKEN raw_command get_prop '["all"]'
# try to retrieve all property by name at once
miiocli device --ip IP --token TOKEN raw_command get_prop '["power", "pm25", "co2", "temperature_outside", "favourite_speed", "filter_rate", "filter_day", "control_speed", "ptc_on", "ptc_status", "child_lock", "sound", "display", "mode"]'
# try to retrieve 4 properties per request
miiocli device --ip IP --token TOKEN raw_command get_prop '["power", "pm25", "co2", "temperature_outside"]'
miiocli device --ip IP --token TOKEN raw_command get_prop '["favourite_speed", "filter_rate", "filter_day", "control_speed"]
miiocli device --ip IP --token TOKEN raw_command get_prop '["ptc_on", "ptc_status", "child_lock", "sound"]'
miiocli device --ip IP --token TOKEN raw_command get_prop '["display", "mode"]'
# please try to get an idea how much properties can be retrieved at once.
It looks like the dmaker.airfresh.a1
is very similar to the dmaker.airfresh.t2017.
@syssi done!
miiocli device --ip IP --token TOKEN raw_command get_prop '["all"]'
Running command raw_command
[2, 553, 13, 150, 45, 81, 60, True, 'auto', False, False, False, False, False]
miiocli device --ip IP --token TOKEN raw_command get_prop '["power", "pm25", "co2", "temperature_outside", "favourite_speed", "filter_rate", "filter_day", "control_speed", "ptc_on", "ptc_status", "child_lock", "sound", "display", "mode"]'
Running command raw_command
[True, 2, 554, 12, 150, 45, 81, 60, False, False, False, False, False, 'auto']
miiocli device --ip IP --token TOKEN raw_command get_prop '["power", "pm25", "co2", "temperature_outside"]'
Running command raw_command
[True, 2, 551, 12]
miiocli device --ip IP --token TOKEN raw_command get_prop '["favourite_speed", "filter_rate", "filter_day", "control_speed"]'
Running command raw_command
[120, 45, 81, 60]
miiocli device --ip IP --token TOKEN raw_command get_prop '["ptc_on", "ptc_status", "child_lock", "sound"]'
Running command raw_command
[False, False, False, False]
miiocli device --ip IP --token TOKEN raw_command get_prop '["display", "mode"]'
Running command raw_command
[False, 'auto']
miiocli device --ip IP --token TOKEN raw_command get_prop '["favourite_speed"]'
Running command raw_command
[120]
miiocli device --ip IP --token TOKEN raw_command get_prop '["filter_rate"]
Running command raw_command
[45]
Good job!
# Supported or not?
miiocli device --ip IP --token TOKEN raw_command get_prop '["screen_direction"]'
miiocli device --ip IP --token TOKEN raw_command get_prop '["ptc_level"]'
miiocli device --ip IP --token TOKEN raw_command set_ptc_level '["low"]'
miiocli device --ip IP --token TOKEN raw_command set_screen_direction '["right"]'
Аpparently not
miiocli device --ip IP --token TOKEN raw_command get_prop '["screen_direction"]'
Running command raw_command
[1, 530, 12, 120, 45, 81, 60, True, 'auto', False, False, False, False, False]
miiocli device --ip IP --token TOKEN raw_command get_prop '["ptc_level"]'
Running command raw_command
[1, 530, 11, 120, 45, 81, 60, True, 'auto', False, False, False, False, False]
miiocli device --ip IP --token TOKEN raw_command set_ptc_level '["low"]'
Error: Invalid value for '[PARAMETERS]': set_ptc_level is not a valid literal
miiocli device --ip IP --token TOKEN raw_command set_screen_direction '["right"]'
Error: Invalid value for '[PARAMETERS]': set_screen_direction is not a valid literal
Unsupported device found! Please create an issue at https://github.com/syssi/xiaomi_airpurifier/issues and provide the following data: dmaker.airfresh.a1
Device: MJXFJ-150-A1 Web link: https://item.mi.com/product/11044.html