rytilahti / python-miio

Python library & console tool for controlling Xiaomi smart appliances
https://python-miio.readthedocs.io
GNU General Public License v3.0
3.68k stars 552 forks source link

Viomi V3 #778

Closed Ciubas closed 1 year ago

Ciubas commented 4 years ago

Is there any chance to add support for Viomi V3?

rytilahti commented 4 years ago

What does miiocli viomivacuum --ip <ipaddr> --token <token> info say? Which commands are not working? This needs more input.

Ciubas commented 4 years ago

configuration.yaml

`vacuum:

logs:

Update of vacuum.viomiv3 is taking over 10 seconds 20:24:15 – main.py (WARNING) - wiadomość pojawiła się po raz pierwszy o godzinie 20:23:12 i powtarzała się 4 razy Got exception while fetching the state: No response from the device 20:24:04 – Xiaomi Miio (WARNING) - wiadomość pojawiła się po raz pierwszy o godzinie 20:22:41 i powtarzała się 4 razy Got error when receiving: timed out 20:24:04 – components/xiaomi_miio/vacuum.py (ERROR) - wiadomość pojawiła się po raz pierwszy o godzinie 20:22:41 i powtarzała się 4 razy Setup of vacuum platform xiaomi_miio is taking over 10 seconds. 20:22:29 – Odkurzacz (WARNING)

More:

2020-07-29 20:22:29 WARNING (MainThread) [homeassistant.components.vacuum] Setup of vacuum platform xiaomi_miio is taking over 10 seconds. 2020-07-29 20:22:41 ERROR (SyncWorker_16) [miio.miioprotocol] Got error when receiving: timed out 2020-07-29 20:22:41 WARNING (SyncWorker_16) [homeassistant.components.xiaomi_miio.vacuum] Got exception while fetching the state: No response from the device 2020-07-29 20:23:12 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.viomiv3 is taking over 10 seconds 2020-07-29 20:23:22 ERROR (SyncWorker_19) [miio.miioprotocol] Got error when receiving: timed out 2020-07-29 20:23:22 WARNING (SyncWorker_19) [homeassistant.components.xiaomi_miio.vacuum] Got exception while fetching the state: No response from the device 2020-07-29 20:23:33 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.viomiv3 is taking over 10 seconds 2020-07-29 20:23:43 ERROR (SyncWorker_4) [miio.miioprotocol] Got error when receiving: timed out 2020-07-29 20:23:43 WARNING (SyncWorker_4) [homeassistant.components.xiaomi_miio.vacuum] Got exception while fetching the state: No response from the device 2020-07-29 20:23:54 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.viomiv3 is taking over 10 seconds 2020-07-29 20:24:04 ERROR (SyncWorker_2) [miio.miioprotocol] Got error when receiving: timed out 2020-07-29 20:24:04 WARNING (SyncWorker_2) [homeassistant.components.xiaomi_miio.vacuum] Got exception while fetching the state: No response from the device 2020-07-29 20:24:15 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.viomiv3 is taking over 10 seconds 2020-07-29 20:24:25 WARNING (MainThread) [homeassistant.components.vacuum] Updating xiaomi_miio vacuum took longer than the scheduled update interval 0:00:20 2020-07-29 20:24:25 ERROR (SyncWorker_6) [miio.miioprotocol] Got error when receiving: timed out 2020-07-29 20:24:25 WARNING (SyncWorker_6) [homeassistant.components.xiaomi_miio.vacuum] Got exception while fetching the state: No response from the device

Device is in WiFi and have good token.

Szczegóły loga (WARNING) Logger: homeassistant.components.vacuum Source: helpers/entity_platform.py:544 Integration: Odkurzacz (documentation, issues) First occurred: 20:24:25 (1 occurrences) Last logged: 20:24:25

Updating xiaomi_miio vacuum took longer than the scheduled update interval 0:00:20


Szczegóły loga (WARNING) Logger: homeassistant.helpers.entity Source: main.py:356 First occurred: 20:23:12 (7 occurrences) Last logged: 20:25:38

Update of vacuum.viomiv3 is taking over 10 seconds


Szczegóły loga (ERROR) Logger: miio.miioprotocol Source: components/xiaomi_miio/vacuum.py:470 First occurred: 20:22:41 (8 occurrences) Last logged: 20:25:48

Got error when receiving: timed out

rytilahti commented 4 years ago

The homeassistant integration supports currently only the rockrobo vacuums which communicate differently to vacuums from other manufacturers. The viomi support is being tracked here: https://github.com/home-assistant/core/issues/27268

Ciubas commented 4 years ago

The STYJ02YM is the same like VIOMI V2 PRO and the VIOMI 3 is this same (software) like the VIOMI V2 - thank you.

rezmus commented 4 years ago

unlike the old models this viomi uses miotspec.

https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:vacuum:0000A006:viomi-v13:1

Ciubas commented 4 years ago

unlike the old models this viomi uses miotspec.

If I good understand It - they use this same software to work (V2 & V3) , but different communication ?

rytilahti commented 4 years ago

It is another protocol, the current miot support is still work in progress and I'd prefer to have it done before starting to add new miot devices. #672 is the PR for that.

@Ciubas could you please modify the title of this issue to include the model from miiocli device --ip <ipaddr> --token <token> info?

RoSulek1 commented 3 years ago

hi all

root@debian-buster-1:~# mirobo --ip 192.168.0.146 --token xxx info
viomi.vacuum.v13 v3.5.8_0008 (5C:6B:D7:02:C8:B8) @ 192.168.0.146 - token: xxxx
root@debian-buster-1:~# mirobo --ip 192.168.0.146 --token XXXX status
ERROR:miio.miioprotocol:Got error when receiving: timed out

but: root@debian-buster-1:~# miiocli viomivacuum --ip 192.168.0.146 --token xxx start
Running command start

root@debian-buster-1:~# miiocli viomivacuum --ip 192.168.0.146 --token xxx home
Running command home

miiocli --debug viomivacuum --ip 192.168.0.146 --token xxx raw_command get_prop "['all']"

root@debian-buster-1:~# miiocli --debug viomivacuum --ip 192.168.0.146 --token xxxx raw_command get_prop "['all']"                                                                   
INFO:miio.cli:Debug mode active                                                                                                                                                                                  
Running command raw_command                                                                                                                                                                                      
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''                                                                                                                                                  
DEBUG:miio.miioprotocol: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\x16X\xf2\x9b`\x1d.w' (total 16)                                                                                                                                         
        value = Container:                                                                                                                                                                                       
            length = 32                                                                                                                                                                                          
            unknown = 0                                                                                                                                                                                          
            device_id = unhexlify('1658f29b')                                                                                                                                                                    
            ts = 2021-02-05 11:39:35                                                                                                                                                                             
        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)                                                                                                                    
DEBUG:miio.miioprotocol:Discovered 1658f29b with ts: 2021-02-05 11:39:35, token: b'ffffffffffffffffffffffffffffffff'                                                                                             
DEBUG:miio.miioprotocol:192.168.0.146:54321 >>: {'id': 1, 'method': 'get_prop', 'params': ['all']}                                                                                                               
DEBUG:miio.miioprotocol:192.168.0.146:54321 (ts: 2021-02-05 11:39:35, id: 1) << {'result': [], 'id': 1} 

All commands working fine

Robert

rytilahti commented 3 years ago

Hi Robert, mirobo command only works on rockrobo vacuums, viomi support will get soon improved by this PR https://github.com/rytilahti/python-miio/pull/808 .

sigo commented 3 years ago

Hi Robert, mirobo command only works on rockrobo vacuums, viomi support will get soon improved by this PR #808 .

Hello @rytilahti. I've seen that #808 is merged. Does this means Viomi V3 is supported?

rytilahti commented 3 years ago

Hi @sigo, I'm not sure, maybe? @titilambert knows more about it, but it would be helpful to know the model for the V3 (miiocli device info).

In any case, if the support is the, the command you have to use is miiocli viomivacuum (instead of mirobo), and there is no official homeassistant support so far for other than rockrobo vacuums.

eymay commented 3 years ago

Hi @rytilahti thanks for the work, I get time out error in start viomi command V3

Running command start
ERROR:miio.miioprotocol:Got error when receiving: timed out
Error: No response from the device

Gives discover error in get_rooms command

Running command get_rooms
Error: Unable to discover the device 192.168.X.XX

My device info shows up as

Model: viomi.vacuum.v13
Hardware version: Linux
Firmware version: 3.5.8_0008

mirobo discover gives WARNING:miio.discovery:Found unsupported device viomi-vacuum-v13_miio375789762._miio._udp.local. at 192.168.X.XX, please report to developers

Ip and token should be correct.