iobroker-community-adapters / ioBroker.mihome-vacuum

Control your Xiaomi vacuum cleaner
MIT License
109 stars 51 forks source link

Add support for new vaccum robot Xiaomi Mijia STYJ02YM #78

Closed JulianGehrmann closed 3 years ago

JulianGehrmann commented 5 years ago

Hi,

is it possible to add support for new xiaomi vacuum Xiaomi Mijia STYJ02YM? If there is anything I can support with just contact me.

Thank you very much!

kwetnico commented 5 years ago

Yes please add support Xiaomi Mijia STYJ02YM !

MeisterTR commented 5 years ago

what work and what did not work? At this time no one figured out what commands are possible for this robot. So someone have to get the token by an older mihome app and monitor the wifi connection from the robot with wireshart to get the new commands...

MrTea2007 commented 4 years ago

Hi, I have such a robot (XIAOMI MIJIA STYJ02YM - vacuum robot) at home and so can help to read the commands. What do I have to do and install?

I have installed the adapter mihome-vacuum and read the token using iPhone backup. The adapter is green and the objects in the ioBroker display matching data.

I can tell by the firmware version number that the token seems to fit, because it's correct with the version number from the Xiaomi home app.

iobroker-Objects-mihome-vaccum.0
Info
  device_fw Firmware -> 3.5.3_0044
  device_model       -> viomi.vacuum.v7

The log shows at startup:

mihome-vacuum.0 2019-11-12 09: 11: 41.534 info (5285) New generation or new fw detected, create new states
mihome-vacuum.0 2019-11-12 09: 11: 40.436 info (5285) Create state clean_home for controlling by cloud adapter
mihome-vacuum.0 2019-11-12 09: 11: 40.429 info (5285) Expert mode enabled, states created
mihome-vacuum.0 2019-11-12 09: 11: 40.397 info (5285) starting. Version 1.1.6 in /opt/iobroker/node_modules/iobroker.mihome-vacuum, node: v8.12.0
MeisterTR commented 4 years ago

you need a pc with a wifi hotspot and install wireshark. your phone and the robot must be in the network. then start wireshark recording and "play" with the app. I dont know if there is any local traffic, maybe the robot can only cloud connection. Then its not possible to add the robot. If there are local udp messages send me the file with the token and i will encrypt the messages and search the new commands..

Adam198912 commented 4 years ago

Hello can you be a little bit more clear? i can do the wireshark thins and so on. but i will need a more deep instruction.

MeisterTR commented 4 years ago

here is a little description https://github.com/jghaanstra/com.robot.xiaomi-mi

MeisterTR commented 4 years ago

ok someone found the commads https://github.com/rytilahti/python-miio/commit/57c10097b7b86094bea19dff73c17cefdd1103a5

MeisterTR commented 4 years ago

https://forum.iobroker.net/topic/27831/xiaomi-styj02ym-roborock-s5-max-mithelfer-gesucht

Ciubas commented 4 years ago

It is added to the official home assistant py files yet?

MeisterTR commented 4 years ago

Bitte mal die 2.2.0 von git testen viel geht noch nicht, ist erstmal ein test ich werde den Adapter wahrscheinlich einmal auf links ziehen müssen weil es zwei komplett unterschiedliche apis sind. was sollte gehen:

niko1987 commented 4 years ago

Servus,

Der Adapter läuft bei mir garnicht. Vielen Dank trotzdem auch für deine Bemühungen.

Hier ein Logauszug. `

host.ubuntu 2020-08-13 21:18:14.904 error instance system.adapter.mihome-vacuum.0 terminated with code 1 (JS_CONTROLLER_STOPPED)
host.ubuntu 2020-08-13 21:18:14.903 error Caught by controller[0]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
host.ubuntu 2020-08-13 21:18:14.903 error Caught by controller[0]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
host.ubuntu 2020-08-13 21:18:14.903 error Caught by controller[0]: at Module.load (internal/modules/cjs/loader.js:653:32)
host.ubuntu 2020-08-13 21:18:14.903 error Caught by controller[0]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
host.ubuntu 2020-08-13 21:18:14.903 error Caught by controller[0]: at Module._compile (internal/modules/cjs/loader.js:778:30)
host.ubuntu 2020-08-13 21:18:14.903 error Caught by controller[0]: at Object. (/opt/iobroker/node_modules/iobroker.mihome-vacuum/main.js:14:22)
host.ubuntu 2020-08-13 21:18:14.903 error Caught by controller[0]: at require (internal/modules/cjs/helpers.js:25:18)
host.ubuntu 2020-08-13 21:18:14.903 error Caught by controller[0]: at Module.require (internal/modules/cjs/loader.js:692:17)
host.ubuntu 2020-08-13 21:18:14.903 error Caught by controller[0]: at Function.Module._load (internal/modules/cjs/loader.js:562:25)
host.ubuntu 2020-08-13 21:18:14.903 error Caught by controller[0]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
host.ubuntu 2020-08-13 21:18:14.903 error Caught by controller[0]: Error: Cannot find module './lib/viomiVacuum'
host.ubuntu 2020-08-13 21:18:14.902 error Caught by controller[0]: ^
host.ubuntu 2020-08-13 21:18:14.902 error Caught by controller[0]: throw err;
host.ubuntu 2020-08-13 21:18:14.902 error Caught by controller[0]: internal/modules/cjs/loader.js:638

` Gruß Niko

MeisterTR commented 4 years ago

sorry mein fehler bitte nochmal von git und min 10 minuten laufen laufen lassen

niko1987 commented 4 years ago

Jetzt funktioniert zwar der Adapter, jedoch auch nach 20-30 Minuten keine Verbindung zum Roboter.

MeisterTR commented 4 years ago

ist der datenpunkt mit model gefüllt? zeig mal ein debug log

MeisterTR commented 4 years ago

alternativ mal ein "miIO.info" über "eigene befehle" (vorher in der config aktivieren) schicken

niko1987 commented 4 years ago

Guten Morgen,

Hier der Auszug aus dem Log mit miIO.info `

mihome-vacuum.0 2020-08-14 09:54:18.451 debug (31293) no answer for get_prop id:9 received, giving up
mihome-vacuum.0 2020-08-14 09:54:13.451 debug (31293) sendMsg[3] >>> {"id":9,"method":"get_prop","params":["run_state","suction_grade","mode","err_state","battary_life","start_time","order_time","s_time","s_area","v_state","zone_data","repeat_sta
mihome-vacuum.0 2020-08-14 09:54:08.450 debug (31293) sendMsg[2] >>> {"id":9,"method":"get_prop","params":["run_state","suction_grade","mode","err_state","battary_life","start_time","order_time","s_time","s_area","v_state","zone_data","repeat_sta
mihome-vacuum.0 2020-08-14 09:54:04.424 debug (31293) Receive <<< {"partner_id":"","id":10,"code":0,"message":"ok","result":{"hw_ver":"Linux","fw_ver":"3.5.8_1059","ap":{"ssid":"FRITZ!Box 7490","bssid":"DC:39:6F:43:4E:80","rssi":-43},"netif":{"lo
mihome-vacuum.0 2020-08-14 09:54:03.450 debug (31293) Next WiFi check: 14.08 09:55
mihome-vacuum.0 2020-08-14 09:54:03.450 debug (31293) sendMsg[1] >>> {"id":10,"method":"miIO.info"}
mihome-vacuum.0 2020-08-14 09:54:03.449 debug (31293) sendMsg[1] >>> {"id":9,"method":"get_prop","params":["run_state","suction_grade","mode","err_state","battary_life","start_time","order_time","s_time","s_area","v_state","zone_data","repeat_sta
mihome-vacuum.0 2020-08-14 09:53:58.454 debug (31293) no answer for get_prop id:8 received, giving up
mihome-vacuum.0 2020-08-14 09:53:53.452 debug (31293) sendMsg[3] >>> {"id":8,"method":"get_prop","params":["run_state","suction_grade","mode","err_state","battary_life","start_time","order_time","s_time","s_area","v_state","zone_data","repeat_sta
mihome-vacuum.0 2020-08-14 09:53:48.450 debug (31293) sendMsg[2] >>> {"id":8,"method":"get_prop","params":["run_state","suction_grade","mode","err_state","battary_life","start_time","order_time","s_time","s_area","v_state","zone_data","repeat_sta
mihome-vacuum.0 2020-08-14 09:53:43.448 debug (31293) sendMsg[1] >>> {"id":8,"method":"get_prop","params":["run_state","suction_grade","mode","err_state","battary_life","start_time","order_time","s_time","s_area","v_state","zone_data","repeat_sta
mihome-vacuum.0 2020-08-14 09:53:38.451 debug (31293) no answer for get_prop id:7 received, giving up
mihome-vacuum.0 2020-08-14 09:53:33.450 debug (31293) sendMsg[3] >>> {"id":7,"method":"get_prop","params":["run_state","suction_grade","mode","err_state","battary_life","start_time","order_time","s_time","s_area","v_state","zone_data","repeat_sta
mihome-vacuum.0 2020-08-14 09:53:28.449 debug (31293) sendMsg[2] >>> {"id":7,"method":"get_prop","params":["run_state","suction_grade","mode","err_state","battary_life","start_time","order_time","s_time","s_area","v_state","zone_data","repeat_sta
mihome-vacuum.0 2020-08-14 09:53:23.448 debug (31293) sendMsg[1] >>> {"id":7,"method":"get_prop","params":["run_state","suction_grade","mode","err_state","battary_life","start_time","order_time","s_time","s_area","v_state","zone_data","repeat_sta
mihome-vacuum.0 2020-08-14 09:53:18.451 debug (31293) no answer for get_status id:5 received, giving up
mihome-vacuum.0 2020-08-14 09:53:08.447 debug (31293) sendMsg[2] >>> {"id":5,"method":"get_status"}
mihome-vacuum.0 2020-08-14 09:53:03.524 info (31293) Detect Viomi Device: dreame.vacuum.mc1808
mihome-vacuum.0 2020-08-14 09:53:03.523 info (31293) New generation or new fw(3.5.8,1059) detected, create new states goto and zoneclean
mihome-vacuum.0 2020-08-14 09:53:03.522 debug (31293) Receive <<< {"partner_id":"","id":6,"code":0,"message":"ok","result":{"hw_ver":"Linux","fw_ver":"3.5.8_1059","ap":{"ssid":"FRITZ!Box 7490","bssid":"DC:39:6F:43:4E:80","rssi":-43},"netif":{"lo
mihome-vacuum.0 2020-08-14 09:53:03.447 debug (31293) Next WiFi check: 14.08 09:54
mihome-vacuum.0 2020-08-14 09:53:03.446 debug (31293) sendMsg[1] >>> {"id":6,"method":"miIO.info"}
mihome-vacuum.0 2020-08-14 09:53:03.445 debug (31293) sendMsg[1] >>> {"id":5,"method":"get_status"}
mihome-vacuum.0 2020-08-14 09:52:58.462 debug (31293) sendTo "getStatus" to system.adapter.mihome-vacuum.0 from system.adapter.mihome-vacuum.0
mihome-vacuum.0 2020-08-14 09:52:58.462 debug (31293) no answer for id:3 received, giving up
mihome-vacuum.0 2020-08-14 09:52:56.355 debug (31293) Receive <<< {"partner_id":"","id":4,"code":0,"message":"ok","result":{"hw_ver":"Linux","fw_ver":"3.5.8_1059","ap":{"ssid":"FRITZ!Box 7490","bssid":"DC:39:6F:43:4E:80","rssi":-43},"netif":{"lo
mihome-vacuum.0 2020-08-14 09:52:56.249 debug (31293) sendMsg[1] >>> {"id":4,"method":"miIO.info"}
mihome-vacuum.0 2020-08-14 09:52:56.248 info (31293) send message: Method: miIO.info

`

MeisterTR commented 4 years ago

bitte mal von hier installieren, aber mitte vorher den alten löschen. https://github.com/MeisterTR/ioBroker.mihome-vacuum

https://forum.iobroker.net/topic/37028/test-adapter-mihome-vacuum-3-x-x-styj02ym-viomi

JulianGehrmann commented 4 years ago

Ein erster Test lief durchaus erfolgreich. Daten werden angezeigt, Start und Stop funktioniert problemlos. Gute Arbeit! Danke!

schaeuzerle commented 3 years ago

Hallo @MeisterTR, hab mir die 3er aus deinem fork gezogen und mit einem neuen Adapternamen installiert (ich hoffe das ist kein Problem?) (2.x läuft in parallel mit dem alten Xiaomi). Läuft super! Anwählen von Räumen wäre noch super. Funktioniert das mit dem STYJ02YM, oder fehlen die da die commands? Danke!

MeisterTR commented 3 years ago

Räume geht leider nicht. Da gibt es kein command für. Der fork in meinen repos ist schon veraltet und hat noch viele Bugs. Hab hier jetzt einen branch rebuild3 heißt der. Schätze dass ich ihn in ein paar Tagen mergen kann...