-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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
Power status for Xiamio Socket chuangmi.plug.v3 shown as always on #31653
Comments
Hey there @rytilahti, @syssi, mind taking a look at this issue as its been labeled with a integration ( |
Please add these lines to your
Restart HA and toggle the switch (1. via the MiHome app, 2. via HA). Please provide your
|
Thanks for the quick response. You can ignore Device 10.10.10.51 as it's currently not connected
|
Could you provide the firmware version of your chuangmi plug? It's part of your home-assistant.log (at the top). |
Here the complete Log. In the Mi Home App the Firmware Version 2.0.6_0012 is shown and it says it's up to date.
|
Any Update? I got still the same behavior with Version 0.107.7 |
To triage the location of the problem, could you try if the Also, the logs are showing responses from multiple devices, making it hard to see what is happening. Could you re-try with only having a single plug? |
Hi. I have the same issue. In HA power status always ON. USB part working correctly from MI Home and from HA. Here is the log when I tried to switch plug power from Mi home and from HA. 2020-04-05 15:05:12 DEBUG (SyncWorker_6) [miio.device] Got a response: Container: data = Container: data = b'' (total 0) value = b'' (total 0) offset1 = 32 offset2 = 32 length = 0 header = Container: data = b'!1\x00 \x00\x00\x00\x00\x05\xe3Ga\x00\tCk' (total 16) value = Container: length = 32 unknown = 0 device_id = b'\x05\xe3Ga' (total 4) ts = 1970-01-08 00:38:03 offset1 = 0 offset2 = 16 length = 16 checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16) 2020-04-05 15:05:12 DEBUG (SyncWorker_6) [miio.device] Discovered 05e34761 with ts: 1970-01-08 00:38:03, token: b'ffffffffffffffffffffffffffffffff' 2020-04-05 15:05:12 DEBUG (SyncWorker_6) [miio.device] 192.168.1.11:54321 >>: {'id': 1, 'method': 'miIO.info', 'params': []} 2020-04-05 15:05:12 INFO (MainThread) [homeassistant.components.xiaomi_miio.switch] Initializing with host 192.168.1.63 (token 0f15f...) 2020-04-05 15:05:12 DEBUG (SyncWorker_2) [miio.protocol] Unable to decrypt, returning raw bytes: b'' 2020-04-05 15:05:12 DEBUG (SyncWorker_2) [miio.device] Got a response: Container: data = Container: data = b'' (total 0) value = b'' (total 0) offset1 = 32 offset2 = 32 length = 0 header = Container: data = b'!1\x00 \x00\x00\x00\x00\x03\xdb~\xd2^\x89\xc9\x88' (total 16) value = Container: length = 32 unknown = 0 device_id = b'\x03\xdb~\xd2' (total 4) ts = 2020-04-05 12:05:28 offset1 = 0 offset2 = 16 length = 16 checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16) 2020-04-05 15:05:12 DEBUG (SyncWorker_2) [miio.device] Discovered 03db7ed2 with ts: 2020-04-05 12:05:28, token: b'ffffffffffffffffffffffffffffffff' 2020-04-05 15:05:12 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 >>: {'id': 1, 'method': 'get_status', 'params': []} 2020-04-05 15:05:12 DEBUG (SyncWorker_7) [miio.protocol] Unable to decrypt, returning raw bytes: b'' 2020-04-05 15:05:13 DEBUG (SyncWorker_7) [miio.device] Got a response: Container: data = Container: data = b'' (total 0) value = b'' (total 0) offset1 = 32 offset2 = 32 length = 0 header = Container: data = b"!1\x00 \x00\x00\x00\x00\x07'bv\x00\x00\x07\xf8" (total 16) value = Container: length = 32 unknown = 0 device_id = b"\x07'bv" (total 4) ts = 1970-01-01 00:34:00 offset1 = 0 offset2 = 16 length = 16 checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16) 2020-04-05 15:05:13 DEBUG (SyncWorker_7) [miio.device] Discovered 07276276 with ts: 1970-01-01 00:34:00, token: b'ffffffffffffffffffffffffffffffff' 2020-04-05 15:05:13 DEBUG (SyncWorker_5) [miio.protocol] Unable to decrypt, returning raw bytes: b'' 2020-04-05 15:05:13 DEBUG (SyncWorker_7) [miio.device] 192.168.1.63:54321 >>: {'id': 1, 'method': 'get_prop', 'params': ['on', 'usb_on', 'temperature', 'wifi_led']} 2020-04-05 15:05:13 DEBUG (SyncWorker_5) [miio.device] Got a response: Container: data = Container: data = b'' (total 0) value = b'' (total 0) offset1 = 32 offset2 = 32 length = 0 header = Container: data = b"!1\x00 \x00\x00\x00\x00\x07'bv\x00\x00\x07\xf8" (total 16) value = Container: length = 32 unknown = 0 device_id = b"\x07'bv" (total 4) ts = 1970-01-01 00:34:00 offset1 = 0 offset2 = 16 length = 16 checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16) 2020-04-05 15:05:13 DEBUG (SyncWorker_5) [miio.device] Discovered 07276276 with ts: 1970-01-01 00:34:00, token: b'ffffffffffffffffffffffffffffffff' 2020-04-05 15:05:13 DEBUG (SyncWorker_5) [miio.device] 192.168.1.63:54321 >>: {'id': 2, 'method': 'get_prop', 'params': ['on', 'usb_on', 'temperature', 'wifi_led']} 2020-04-05 15:05:13 DEBUG (SyncWorker_0) [miio.protocol] Unable to decrypt, returning raw bytes: b'' 2020-04-05 15:05:13 DEBUG (SyncWorker_0) [miio.device] Got a response: Container: data = Container: data = b'' (total 0) value = b'' (total 0) offset1 = 32 offset2 = 32 length = 0 header = Container: data = b'!1\x00 \x00\x00\x00\x00\x05\xe3Ga\x00\tCl' (total 16) value = Container: length = 32 unknown = 0 device_id = b'\x05\xe3Ga' (total 4) ts = 1970-01-08 00:38:04 offset1 = 0 offset2 = 16 length = 16 checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16) 2020-04-05 15:05:13 DEBUG (SyncWorker_5) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:34:01, id: 2) << {'id': 2, 'result': ['off', False, 38, 'on'], 'exe_time': 340} 2020-04-05 15:05:13 DEBUG (SyncWorker_5) [miio.device] 192.168.1.63:54321 >>: {'id': 3, 'method': 'get_power', 'params': []} 2020-04-05 15:05:13 DEBUG (SyncWorker_7) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:34:01, id: 1) << {'id': 1, 'result': ['off', False, 38, 'on'], 'exe_time': 330} 2020-04-05 15:05:13 DEBUG (SyncWorker_7) [miio.device] 192.168.1.63:54321 >>: {'id': 2, 'method': 'get_power', 'params': []} 2020-04-05 15:05:13 DEBUG (SyncWorker_5) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:34:01, id: 3) << {'id': 3, 'result': [0], 'exe_time': 80} 2020-04-05 15:05:13 DEBUG (MainThread) [homeassistant.components.xiaomi_miio.switch] Got new state: 2020-04-05 15:05:13 DEBUG (SyncWorker_7) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:34:01, id: 2) << {'id': 2, 'result': [0], 'exe_time': 80} 2020-04-05 15:05:13 DEBUG (MainThread) [homeassistant.components.xiaomi_miio.switch] Got new state: 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] Retrying with incremented id, retries left: 3 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.protocol] Unable to decrypt, returning raw bytes: b'' 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] Got a response: Container: data = Container: data = b'' (total 0) value = b'' (total 0) offset1 = 32 offset2 = 32 length = 0 header = Container: data = b'!1\x00 \x00\x00\x00\x00\x03\xdb~\xd2^\x89\xc9\x8d' (total 16) value = Container: length = 32 unknown = 0 device_id = b'\x03\xdb~\xd2' (total 4) ts = 2020-04-05 12:05:33 offset1 = 0 offset2 = 16 length = 16 checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16) 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] Discovered 03db7ed2 with ts: 2020-04-05 12:05:33, token: b'ffffffffffffffffffffffffffffffff' 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 >>: {'id': 102, 'method': 'get_status', 'params': []} 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 (ts: 2020-04-05 12:05:33, id: 102) << {'result': [{'msg_ver': 8, 'msg_seq': 1978, 'state': 8, 'battery': 100, 'clean_time': 2539, 'clean_area': 35620000, 'error_code': 0, 'map_present': 1, 'in_cleaning': 0, 'fan_power': 90, 'dnd_enabled': 0}], 'id': 102} 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 >>: {'id': 103, 'method': 'get_consumable', 'params': []} 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 (ts: 2020-04-05 12:05:33, id: 103) << {'result': [{'main_brush_work_time': 685657, 'side_brush_work_time': 312184, 'filter_work_time': 127697, 'sensor_dirty_time': 87621}], 'id': 103} 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 >>: {'id': 104, 'method': 'get_clean_summary', 'params': []} 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 (ts: 2020-04-05 12:05:33, id: 104) << {'result': [1567648, 23145735000, 767, [1585925438, 1585731599, 1585645623, 1585645200, 1585558800, 1585299601, 1585213199, 1585126800, 1585040401, 1584954000, 1584694801, 1584608402, 1584522001, 1584435602, 1584349201, 1584184874, 1584090001, 1584003600, 1583917199, 1583830801]], 'id': 104} 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 >>: {'id': 105, 'method': 'get_clean_summary', 'params': []} 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 (ts: 2020-04-05 12:05:33, id: 105) << {'result': [1567648, 23145735000, 767, [1585925438, 1585731599, 1585645623, 1585645200, 1585558800, 1585299601, 1585213199, 1585126800, 1585040401, 1584954000, 1584694801, 1584608402, 1584522001, 1584435602, 1584349201, 1584184874, 1584090001, 1584003600, 1583917199, 1583830801]], 'id': 105} 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 >>: {'id': 106, 'method': 'get_clean_record', 'params': [1585925438]} 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 (ts: 2020-04-05 12:05:33, id: 106) << {'result': [[1585925438, 1585927977, 2539, 35620000, 0, 1]], 'id': 106} 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 >>: {'id': 107, 'method': 'get_dnd_timer', 'params': []} 2020-04-05 15:05:17 DEBUG (SyncWorker_2) [miio.device] 192.168.1.106:54321 (ts: 2020-04-05 12:05:33, id: 107) << {'result': [{'start_hour': 22, 'start_minute': 0, 'end_hour': 8, 'end_minute': 0, 'enabled': 1}], 'id': 107} 2020-04-05 15:05:20 DEBUG (SyncWorker_0) [miio.device] Retrying with incremented id, retries left: 3 2020-04-05 15:05:20 DEBUG (SyncWorker_0) [miio.protocol] Unable to decrypt, returning raw bytes: b'' 2020-04-05 15:05:20 DEBUG (SyncWorker_0) [miio.device] Got a response: Container: data = Container: data = b'' (total 0) value = b'' (total 0) offset1 = 32 offset2 = 32 length = 0 header = Container: data = b'!1\x00 \x00\x00\x00\x00\x05\xe3Ga\x00\tCs' (total 16) value = Container: length = 32 unknown = 0 device_id = b'\x05\xe3Ga' (total 4) ts = 1970-01-08 00:38:11 offset1 = 0 offset2 = 16 length = 16 checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16) 2020-04-05 15:05:44 DEBUG (SyncWorker_5) [miio.device] 192.168.1.63:54321 >>: {'id': 4, 'method': 'get_prop', 'params': ['on', 'usb_on', 'temperature', 'wifi_led']} 2020-04-05 15:05:44 DEBUG (SyncWorker_2) [miio.device] 192.168.1.63:54321 >>: {'id': 3, 'method': 'get_prop', 'params': ['on', 'usb_on', 'temperature', 'wifi_led']} 2020-04-05 15:05:44 DEBUG (SyncWorker_5) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:34:33, id: 4) << {'id': 4, 'result': ['on', False, 38, 'on'], 'exe_time': 340} 2020-04-05 15:05:44 DEBUG (SyncWorker_5) [miio.device] 192.168.1.63:54321 >>: {'id': 5, 'method': 'get_power', 'params': []} 2020-04-05 15:05:44 DEBUG (SyncWorker_2) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:34:33, id: 3) << {'id': 3, 'result': ['on', False, 38, 'on'], 'exe_time': 330} 2020-04-05 15:05:44 DEBUG (SyncWorker_2) [miio.device] 192.168.1.63:54321 >>: {'id': 4, 'method': 'get_power', 'params': []} 2020-04-05 15:05:44 DEBUG (SyncWorker_5) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:34:33, id: 5) << {'id': 5, 'result': [100], 'exe_time': 90} 2020-04-05 15:05:44 DEBUG (MainThread) [homeassistant.components.xiaomi_miio.switch] Got new state: 2020-04-05 15:05:45 DEBUG (SyncWorker_2) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:34:33, id: 4) << {'id': 4, 'result': [100], 'exe_time': 80} 2020-04-05 15:05:45 DEBUG (MainThread) [homeassistant.components.xiaomi_miio.switch] Got new state: 2020-04-05 15:06:15 DEBUG (SyncWorker_7) [miio.device] 192.168.1.63:54321 >>: {'id': 5, 'method': 'get_prop', 'params': ['on', 'usb_on', 'temperature', 'wifi_led']} 2020-04-05 15:06:15 DEBUG (SyncWorker_4) [miio.device] 192.168.1.63:54321 >>: {'id': 6, 'method': 'get_prop', 'params': ['on', 'usb_on', 'temperature', 'wifi_led']} 2020-04-05 15:06:15 DEBUG (SyncWorker_7) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:35:04, id: 5) << {'id': 5, 'result': ['off', False, 38, 'on'], 'exe_time': 330} 2020-04-05 15:06:15 DEBUG (SyncWorker_7) [miio.device] 192.168.1.63:54321 >>: {'id': 6, 'method': 'get_power', 'params': []} 2020-04-05 15:06:15 DEBUG (SyncWorker_4) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:35:04, id: 6) << {'id': 6, 'result': ['off', False, 38, 'on'], 'exe_time': 330} 2020-04-05 15:06:15 DEBUG (SyncWorker_4) [miio.device] 192.168.1.63:54321 >>: {'id': 7, 'method': 'get_power', 'params': []} 2020-04-05 15:06:15 DEBUG (SyncWorker_7) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:35:05, id: 6) << {'id': 6, 'result': [0], 'exe_time': 80} 2020-04-05 15:06:15 DEBUG (MainThread) [homeassistant.components.xiaomi_miio.switch] Got new state: 2020-04-05 15:06:15 DEBUG (SyncWorker_4) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:35:05, id: 7) << {'id': 7, 'result': [0], 'exe_time': 80} 2020-04-05 15:06:15 DEBUG (MainThread) [homeassistant.components.xiaomi_miio.switch] Got new state: 2020-04-05 15:06:27 DEBUG (SyncWorker_2) [miio.device] 192.168.1.63:54321 >>: {'id': 8, 'method': 'set_power', 'params': ['off']} 2020-04-05 15:06:27 DEBUG (SyncWorker_2) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:35:16, id: 8) << {'code': 0, 'id': 8, 'result': ['ok'], 'exe_time': 50} 2020-04-05 15:06:27 DEBUG (MainThread) [homeassistant.components.xiaomi_miio.switch] Response received from plug: ['ok'] 2020-04-05 15:06:46 DEBUG (SyncWorker_8) [miio.device] 192.168.1.63:54321 >>: {'id': 9, 'method': 'get_prop', 'params': ['on', 'usb_on', 'temperature', 'wifi_led']} 2020-04-05 15:06:46 DEBUG (SyncWorker_0) [miio.device] 192.168.1.63:54321 >>: {'id': 10, 'method': 'get_prop', 'params': ['on', 'usb_on', 'temperature', 'wifi_led']} 2020-04-05 15:06:46 DEBUG (SyncWorker_8) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:35:36, id: 9) << {'id': 9, 'result': ['off', False, 38, 'on'], 'exe_time': 330} 2020-04-05 15:06:46 DEBUG (SyncWorker_8) [miio.device] 192.168.1.63:54321 >>: {'id': 10, 'method': 'get_power', 'params': []} 2020-04-05 15:06:46 DEBUG (SyncWorker_0) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:35:36, id: 10) << {'id': 10, 'result': ['off', False, 38, 'on'], 'exe_time': 330} 2020-04-05 15:06:46 DEBUG (SyncWorker_0) [miio.device] 192.168.1.63:54321 >>: {'id': 11, 'method': 'get_power', 'params': []} 2020-04-05 15:06:46 DEBUG (SyncWorker_8) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:35:36, id: 10) << {'id': 10, 'result': [0], 'exe_time': 80} 2020-04-05 15:06:46 DEBUG (MainThread) [homeassistant.components.xiaomi_miio.switch] Got new state: 2020-04-05 15:06:46 DEBUG (SyncWorker_0) [miio.device] 192.168.1.63:54321 (ts: 1970-01-01 00:35:36, id: 11) << {'id': 11, 'result': [0], 'exe_time': 80} 2020-04-05 15:06:46 DEBUG (MainThread) [homeassistant.components.xiaomi_miio.switch] Got new state: Respond from miplug command: ildar@ubuntu_test:~$ miplug --ip 192.168.1.63 --token 0f15f0.... Power: False Temperature: 35 HA version: 0.107.7 |
The same problem here. Started whe I've updated firmware to 2.0.6_0012. miiocli tool displays correct power state, looks like the problem is with integration. Please let me know how can I help to find the problem |
I've found the problem. Looks like before the update power value was reported either as "on":True or "on":False, but now it is reported as "on":"on" or "on":"off". I've fixed class ChuangmiPlugStatus of python_miio in file chuangmi_plug.py and everything works fine.
|
Could you please create a PR to python-miio? |
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. |
With Home assistant version 0.112 it's finally fixed. Thanks a lot |
* Adding docs for temp sensors * added sensors * Update source/_integrations/weatherflow_cloud.markdown Co-authored-by: Klaas Schoute <klaas_schoute@hotmail.com> * tiny tweak * Addind more sensor descriptions * Updated sensor table * addressing both integrations in a note as well * small updaets * Removed wind from docs * Apply sentence-style capitalization * Update source/_integrations/weatherflow.markdown Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Tightnened up the docs * tiny tweaks * Update source/_integrations/weatherflow.markdown Co-authored-by: Klaas Schoute <klaas_schoute@hotmail.com> * Update source/_integrations/weatherflow_cloud.markdown Co-authored-by: Klaas Schoute <klaas_schoute@hotmail.com> * Update source/_integrations/weatherflow_cloud.markdown Co-authored-by: Klaas Schoute <klaas_schoute@hotmail.com> * Update source/_integrations/weatherflow.markdown Co-authored-by: Klaas Schoute <klaas_schoute@hotmail.com> --------- Co-authored-by: Klaas Schoute <klaas_schoute@hotmail.com> Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
The problem
I'm using 2 of the Xiaomi socket Version chuangmi.plug.v3. Since some time, I guess it started with HA Version 0.100, the sockets power status is not working properly in HA anymore. The status shows always powered on even if the plug is turn off. (manually or via the Xiaomi app). When I switch it off in HA the status in HA changes back to on after a few seconds. (Plug stays off).
Environment
Home Assistant 0.105.2 running in HASS.io on Ubuntu VM
https://www.home-assistant.io/integrations/switch.xiaomi_miio/
Problem-relevant
configuration.yaml
name: Desk light office
host: 10.10.10.22
token: xxxxxxxxxxxxxxxxxxxxxxxx
model: chuangmi.plug.v3
Traceback/Error logs
Additional information
The text was updated successfully, but these errors were encountered: