iobroker-community-adapters / ioBroker.mihome-vacuum

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

Feature Request: Add possibility to command Mop-Cleaning in station #679

Closed RkcCorian closed 8 months ago

RkcCorian commented 1 year ago

Refer also to previous discussion at https://github.com/iobroker-community-adapters/ioBroker.mihome-vacuum/issues/620

@dirkhe : I create a new ticket to follow up this feature request.

Dein letzter Kommentar: Spontan sehe ih da nichts, hier https://github.com/home-assistant/core/issues/69869 diskutieren die da auch gerade darüber. Hier ist übrigens beschrieben, wie man die kommandos rausbekommt https://python-miio.readthedocs.io/en/latest/contributing.html#traffic-capturing

RkcCorian commented 1 year ago

@dirkhe : Also... ich hab inzw. WireShark am Laufen und sehe den Datenverkehr von meinem Recher (Xiami Home App über BlueStacks) zum Roboter. Allerdings fange ich mit meinem Laienwissen nicht viel damit an, sieht für mich verschlüsselt aus. Ich selber komme daher gerade nicht ohne einen Tipp weiter. :-|

RkcCorian commented 1 year ago

Muss wohl mit einem parse-pcap tool gehen, dass wieder auseinander zu bekommen. Ich kann nochmal drauf schauen, wenn ich mehr Zeit habe. Vielleicht sind die Kollegen von Home Assistant aber auch schneller... 🙈

RkcCorian commented 1 year ago

@dirkhe: Hmmm... Token habe ich ja über den Adapter... weißt Du, wie das mit "Use miiocli devtools parse-pcap script to parse the captured PCAP files" funktioniert?

dirkhe commented 1 year ago

Ich hatte das tool auch noch nicht genutzt, hazte das nur gesehn. Müsdte ich mir dann auch erst noch genauer anschauen

dirkhe commented 1 year ago

Steht doch direkt darunter miiocli devtools parse-pcap captured_traffic.pcap <token> Die pcap datei sollte dein mitgeschnittener traffic sein und token kannst du aus der adapterconf auslesen

RkcCorian commented 1 year ago

Schon, aber wie rufe ich das auf, bzw. wie installiere ich das?

dirkhe commented 1 year ago

Ich vermute mal mit pip install python-miio https://python-miio.readthedocs.io/en/latest/discovery.html#installation

RkcCorian commented 1 year ago

Ich vermute mal mit pip install python-miio https://python-miio.readthedocs.io/en/latest/discovery.html#installation

Dafür fehlen mir leider die Kenntnisse. Wenn ich mittels Portainer in der Console von ioBroker den Befehl "pip install python-miio" ausführe ist der Befehl (erwarteter Weise) unbekannt. Daher (leider) keine Ahnung wie man das installiert. 😟

dirkhe commented 1 year ago

Pip ist das installationsprogramm von python, du kannst das auch auf deinem pc ausführen. Hadt du ggf schon irendwo python installert?

RkcCorian commented 1 year ago

@dirkhe : So, hab Python nebst Pip zum Laufen bekommen, allerdings klappt die Installation von python-miio wohl nicht. Noch ne Idee?

c:\Temp\Neuer Ordner (3)>pip --version
pip 22.3 from C:\Users\Marku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip (python 3.10)

c:\Temp\Neuer Ordner (3)>pip install python-miio
Collecting python-miio
  Using cached python_miio-0.5.12-py3-none-any.whl (330 kB)
Collecting attrs
  Using cached attrs-22.1.0-py2.py3-none-any.whl (58 kB)
Collecting defusedxml<1,>=0
  Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting croniter>=1
  Using cached croniter-1.3.7-py2.py3-none-any.whl (17 kB)
Collecting PyYAML<7,>=5
  Using cached PyYAML-6.0-cp310-cp310-win_amd64.whl (151 kB)
Requirement already satisfied: pytz in c:\users\marku\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from python-miio) (2022.6)
Collecting zeroconf<1,>=0
  Using cached zeroconf-0.39.4-py3-none-any.whl (106 kB)
Collecting construct<3.0.0,>=2.10.56
  Using cached construct-2.10.68.tar.gz (57 kB)
  Preparing metadata (setup.py) ... done
Collecting tqdm<5,>=4
  Using cached tqdm-4.64.1-py2.py3-none-any.whl (78 kB)
Collecting micloud
  Using cached micloud-0.5.tar.gz (7.8 kB)
  Preparing metadata (setup.py) ... done
Collecting click>=8
  Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting netifaces<1,>=0
  Using cached netifaces-0.11.0.tar.gz (30 kB)
  Preparing metadata (setup.py) ... done
Collecting appdirs<2,>=1
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting cryptography>=35
  Using cached cryptography-38.0.1-cp36-abi3-win_amd64.whl (2.4 MB)
Collecting android_backup<1,>=0
  Using cached android_backup-0.2.0.tar.gz (6.1 kB)
  Preparing metadata (setup.py) ... done
Collecting colorama
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting python-dateutil
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting cffi>=1.12
  Using cached cffi-1.15.1-cp310-cp310-win_amd64.whl (179 kB)
Collecting async-timeout>=4.0.1
  Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting ifaddr>=0.1.7
  Using cached ifaddr-0.2.0-py3-none-any.whl (12 kB)
Collecting requests
  Using cached requests-2.28.1-py3-none-any.whl (62 kB)
Collecting tzlocal
  Using cached tzlocal-4.2-py3-none-any.whl (19 kB)
Collecting pycryptodome
  Using cached pycryptodome-3.15.0-cp35-abi3-win_amd64.whl (1.9 MB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting six>=1.5
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2022.9.24-py3-none-any.whl (161 kB)
Collecting charset-normalizer<3,>=2
  Using cached charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
Collecting pytz-deprecation-shim
  Using cached pytz_deprecation_shim-0.1.0.post0-py2.py3-none-any.whl (15 kB)
Collecting tzdata
  Using cached tzdata-2022.6-py2.py3-none-any.whl (338 kB)
Installing collected packages: netifaces, ifaddr, appdirs, android_backup, urllib3, tzdata, six, PyYAML, pycryptodome, pycparser, idna, defusedxml, construct, colorama, charset-normalizer, certifi, attrs, async-timeout, zeroconf, tqdm, requests, pytz-deprecation-shim, python-dateutil, click, cffi, tzlocal, cryptography, croniter, micloud, python-miio
  DEPRECATION: netifaces is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for netifaces ... error
  error: subprocess-exited-with-error

  × Running setup.py install for netifaces did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\config\setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running install
      C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_ext
      building 'netifaces' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> netifaces

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

c:\Temp\Neuer Ordner (3)>miiocli devtools parse-pcap Mop.pcapng <MeinenTokenHatteIchHierEingefuegt>
Der Befehl "miiocli" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
RkcCorian commented 1 year ago

Hab's, Microsoft Visual C++ 14. hatte gefehlt

RkcCorian commented 1 year ago

@dirkhe : pip install python-miio scheint jetzt geklappt zu haben. Leider geht es nach wie vor nicht... Hast Du noch eine Idee?

C:\Users\Marku>python --version
Python 3.10.8

C:\Users\Marku>pip --version
pip 22.3 from C:\Users\Marku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip (python 3.10)

C:\Users\Marku>pip install python-miio
Collecting python-miio
  Using cached python_miio-0.5.12-py3-none-any.whl (330 kB)
Collecting tqdm<5,>=4
  Using cached tqdm-4.64.1-py2.py3-none-any.whl (78 kB)
Collecting zeroconf<1,>=0
  Using cached zeroconf-0.39.4-py3-none-any.whl (106 kB)
Collecting cryptography>=35
  Using cached cryptography-38.0.1-cp36-abi3-win_amd64.whl (2.4 MB)
Collecting defusedxml<1,>=0
  Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting PyYAML<7,>=5
  Using cached PyYAML-6.0-cp310-cp310-win_amd64.whl (151 kB)
Collecting appdirs<2,>=1
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting click>=8
  Using cached click-8.1.3-py3-none-any.whl (96 kB)
Requirement already satisfied: pytz in c:\users\marku\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from python-miio) (2022.6)
Collecting micloud
  Using cached micloud-0.5.tar.gz (7.8 kB)
  Preparing metadata (setup.py) ... done
Collecting croniter>=1
  Using cached croniter-1.3.7-py2.py3-none-any.whl (17 kB)
Collecting android_backup<1,>=0
  Using cached android_backup-0.2.0.tar.gz (6.1 kB)
  Preparing metadata (setup.py) ... done
Collecting construct<3.0.0,>=2.10.56
  Using cached construct-2.10.68.tar.gz (57 kB)
  Preparing metadata (setup.py) ... done
Collecting attrs
  Using cached attrs-22.1.0-py2.py3-none-any.whl (58 kB)
Collecting netifaces<1,>=0
  Using cached netifaces-0.11.0.tar.gz (30 kB)
  Preparing metadata (setup.py) ... done
Collecting colorama
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting python-dateutil
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting cffi>=1.12
  Using cached cffi-1.15.1-cp310-cp310-win_amd64.whl (179 kB)
Collecting async-timeout>=4.0.1
  Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting ifaddr>=0.1.7
  Using cached ifaddr-0.2.0-py3-none-any.whl (12 kB)
Collecting requests
  Using cached requests-2.28.1-py3-none-any.whl (62 kB)
Collecting tzlocal
  Using cached tzlocal-4.2-py3-none-any.whl (19 kB)
Collecting pycryptodome
  Using cached pycryptodome-3.15.0-cp35-abi3-win_amd64.whl (1.9 MB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting six>=1.5
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
Collecting charset-normalizer<3,>=2
  Using cached charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2022.9.24-py3-none-any.whl (161 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting tzdata
  Using cached tzdata-2022.6-py2.py3-none-any.whl (338 kB)
Collecting pytz-deprecation-shim
  Using cached pytz_deprecation_shim-0.1.0.post0-py2.py3-none-any.whl (15 kB)
Installing collected packages: netifaces, ifaddr, appdirs, android_backup, urllib3, tzdata, six, PyYAML, pycryptodome, pycparser, idna, defusedxml, construct, colorama, charset-normalizer, certifi, attrs, async-timeout, zeroconf, tqdm, requests, pytz-deprecation-shim, python-dateutil, click, cffi, tzlocal, cryptography, croniter, micloud, python-miio
  DEPRECATION: netifaces is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for netifaces ... done
  DEPRECATION: android_backup is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for android_backup ... done
  DEPRECATION: construct is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for construct ... done
  WARNING: The script normalizer.exe is installed in 'C:\Users\Marku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script tqdm.exe is installed in 'C:\Users\Marku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  DEPRECATION: micloud is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for micloud ... done
  WARNING: The scripts miio-extract-tokens.exe, miiocli.exe and mirobo.exe are installed in 'C:\Users\Marku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed PyYAML-6.0 android_backup-0.2.0 appdirs-1.4.4 async-timeout-4.0.2 attrs-22.1.0 certifi-2022.9.24 cffi-1.15.1 charset-normalizer-2.1.1 click-8.1.3 colorama-0.4.6 construct-2.10.68 croniter-1.3.7 cryptography-38.0.1 defusedxml-0.7.1 idna-3.4 ifaddr-0.2.0 micloud-0.5 netifaces-0.11.0 pycparser-2.21 pycryptodome-3.15.0 python-dateutil-2.8.2 python-miio-0.5.12 pytz-deprecation-shim-0.1.0.post0 requests-2.28.1 six-1.16.0 tqdm-4.64.1 tzdata-2022.6 tzlocal-4.2 urllib3-1.26.12 zeroconf-0.39.4

C:\Users\Marku>cd c:\temp

c:\Temp>dir
 Datenträger in Laufwerk C: ist Windows
 Volumeseriennummer: 82A6-EE0C

 Verzeichnis von c:\Temp

01.11.2022  10:22    <DIR>          .
01.11.2022  10:22    <DIR>          ..
26.10.2022  16:44    <DIR>          .gallery
26.10.2022  16:44    <DIR>          CacheClip
07.10.2022  21:39    <DIR>          Neuer Ordner
26.10.2022  17:06    <DIR>          Neuer Ordner (2)
01.11.2022  10:32    <DIR>          Neuer Ordner (3)
               0 Datei(en),              0 Bytes
               7 Verzeichnis(se), 24.105.648.128 Bytes frei

c:\Temp>cd Neuer Ordner (3)

c:\Temp\Neuer Ordner (3)>dir
 Datenträger in Laufwerk C: ist Windows
 Volumeseriennummer: 82A6-EE0C

 Verzeichnis von c:\Temp\Neuer Ordner (3)

01.11.2022  10:32    <DIR>          .
01.11.2022  10:32    <DIR>          ..
01.11.2022  10:22         2.569.494 get-pip.py
29.10.2022  16:49           129.064 Mop.pcapng
               2 Datei(en),      2.698.558 Bytes
               2 Verzeichnis(se), 24.105.648.128 Bytes frei

c:\Temp\Neuer Ordner (3)>miiocli devtools parse-pcap Mop.pcapng <MeinenTokenHatteIchHierEingefuegt>
Der Befehl "miiocli" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
dirkhe commented 1 year ago

Steht doch hier: WARNING: The scripts miio-extract-tokens.exe, miiocli.exe and mirobo.exe are installed in 'C:\Users\Marku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH. Windows kann deine Datei nicht finden. Frag mich bitte nicht, wie das jetzt anders geht, ich kenne mich weder mit python aus, noch weiss ich nicht, wie windows da tickt.

RkcCorian commented 1 year ago

@dirkhe : Ahhh... bin in den Ordner gegangen und da liegt auch die exe. Aber dennoch klappt es nicht (wegen einem anderen Fehler). Bin leider wie gesagt nicht der Experte 🙄

 Verzeichnis von C:\Users\Marku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts

01.11.2022  18:53    <DIR>          .
01.11.2022  18:53    <DIR>          ..
01.11.2022  11:20             1.132 android-backup-pack-script.py
01.11.2022  11:20            74.752 android-backup-pack.exe
01.11.2022  11:20             1.136 android-backup-unpack-script.py
01.11.2022  11:20            74.752 android-backup-unpack.exe
01.11.2022  11:20             1.081 micloud-script.py
01.11.2022  11:20            74.752 micloud.exe
01.11.2022  11:20           108.468 miio-extract-tokens.exe
01.11.2022  11:20           108.469 miiocli.exe
01.11.2022  11:20           108.491 mirobo.exe
29.10.2022  16:49           129.064 Mop.pcapng
01.11.2022  11:20           108.494 normalizer.exe
01.11.2022  10:56           107.959 pip.exe
01.11.2022  10:56           107.959 pip3.10.exe
01.11.2022  10:56           107.959 pip3.exe
01.11.2022  11:20           108.457 tqdm.exe
              15 Datei(en),      1.222.925 Bytes
               2 Verzeichnis(se), 23.718.838.272 Bytes frei

C:\Users\Marku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts>miiocli parse-pcap Mop.pcapng <MeinenTokenHatteIchHierEingefuegt>
Usage: miiocli [OPTIONS] COMMAND [ARGS]...
Try 'miiocli --help' for help.

Error: No such command 'parse-pcap'.

C:\Users\Marku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts>
dirkhe commented 1 year ago

Das komando it lt doku auch miiocli devtools parse-pcap captured_traffic.pcap

RkcCorian commented 1 year ago

Ja, hatte ich auch versucht, leider ebenso erfolglos. Hoffe auf die Kollegen vom verlinkten Ticket

dirkhe commented 1 year ago

Habe jetzt auch mal versuche gestartet. siehe mein Kommentar in der o.g. Unterhaltung

dirkhe commented 1 year ago

kommt mit 3.9.0

RkcCorian commented 1 year ago

Sehr geil!!!!! Muss nur noch warten, bis mein Roboter zurück aus der Reparatur ist 😟

RkcCorian commented 1 year ago

@dirkhe : Moin! Nach einigen Querelen habe ich jetzt endlich wieder einen Saugroboter (der Gleiche, nur in Neu). Nun versuche ich mich erneut an der Automatisierung. Ich habe allerdings Probleme, u.a. mit dem Kommandieren vom MopWaschen, ich habe die v3.9.5 installiert.

Nun versuche ich das Mopp Waschen zu kommandieren. Hast Du eine Idee?!

Code in Blockly image

Code aus Blockly in JS

sendTo("mihome-vacuum.0", "startWashMop", '', async function (result) {
    console.log(result);
  });
console.debug("mihome-vacuum.0: " + "");

Passieren tut nichts, im Log steht...

We are in onMessage:{"command":"startWashMop","message":"","from":"system.adapter.javascript.0","callback":{"message":"","id":23,"ack":false,"time":1678456602199},"_id":94520447}

image

dirkhe commented 1 year ago

Da habe ich noch einen Fehler drin, muss ich noch nachhreichen. Du kannst aber doch auch eigentlich einfach auf den DP "washmop" gehen, und den true oder false setzten

RkcCorian commented 1 year ago

Leider nein... ich möchte Deine Queue nutzen, da wird erst Max. Saugen kommandiert, dann soll Mopp Waschen und dann Max. Wischen kommandiert werden. Da ich aber Deine Queue nutzen will weiß ich nicht, wann ich das Wischkommando schicken kann. Daher wäre ein Fix echt super!!!

RkcCorian commented 1 year ago

@dirkhe : So, hab jetzt vollständig auf Deinen Adapter umgestellt. Jetzt wäre das Mopp Waschen sehr wichtig für mich 🙃 Kann ich irgendwas tun?

dirkhe commented 1 year ago

Das wird so nicht gehen, du kannst washmop erst starten, wenn er am laden ist, sonst bekommst du eine fehlermeldung. Das wass du willst, ist noch mal viel komplexer

RkcCorian commented 1 year ago

? Verstehe ich nicht... wenn die Reinigung abgeschlossen wurde, kann ich in der App doch auch schon auf dem Weg zur Station das Mopp Waschen kommandieren...

RkcCorian commented 1 year ago

D.h. anstelle des nächsten Kommandos zum Wischen wird nach dem Saugen erstmal Mopp Waschen kommandiert

RkcCorian commented 1 year ago

Hab's gerade nachgestellt... dann ist das nicht das gesuchte Kommando. Man kann Andocken und Mopp Waschen auch über die App ansteuern. Dann wurde bislang "nur" das Kommando umgesetzt in der Station 😥

In der App klicke ich auf Station und dann Mopp waschen, dann macht der Roboter es korrekt. D.h. wir brauchen dieses Kommando. Hast Du noch Kontakt zu den Kollegen, welche das jetzt implementierte Kommando rausgefunden haben?

dirkhe commented 1 year ago

Was du mal testen könntest: Seteze den Robb etwas weiter weg und schicke ihn zurück zur Station, während er zurückfährt, sendest du über den Adapter per customcommd mal startWashMop und beobachtest die stati, wann er welchen setzt, am besten mit debuglog. Wenn wir Glück haben, setzt er den auf 26, going to mop clean. Dann könnte ich das vlt. in die queue reinpacken.

RkcCorian commented 1 year ago

Hab gerade versucht startWashMop zu kommandieren, aber es klappt nicht. Ich finde den Fehler aber nicht, kannst Du mir helfen?! Viele Grüße!

Code

sendTo("mihome-vacuum.0", 
    "startWashMop", 
    async function (result) 
  {
    console.log(result);
  });

Log

<html>
<body>
<!--StartFragment-->

2023-04-02 09:22:28.633 - debug: mihome-vacuum.0 (490) Receive <<< Helo <<< 213100200000000022682cb400005094ffffffffffffffffffffffffffffffff
--
2023-04-02 09:22:28.633 - debug: mihome-vacuum.0 (490) Time difference between Mihome Vacuum and ioBroker: -1680399520 sec
2023-04-02 09:22:29.411 - info: javascript.0 (452) Stop script script.js.archive.SaugWischRoboter_Test
2023-04-02 09:22:29.418 - info: javascript.0 (452) Start javascript script.js.archive.SaugWischRoboter_Test
2023-04-02 09:22:29.421 - info: javascript.0 (452) script.js.archive.SaugWischRoboter_Test: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
2023-04-02 09:22:29.479 - info: javascript.0 (452) script.js.archive.SaugWischRoboter_Test: Message received
2023-04-02 09:22:29.476 - info: mihome-vacuum.0 (490) send command
2023-04-02 09:22:29.478 - debug: mihome-vacuum.0 (490) We are in onMessage:{"command":"send","message":"startWashMop","from":"system.adapter.javascript.0","callback":{"message":"startWashMop","id":13,"ack":true,"time":1680420149421},"_id":94808697}
2023-04-02 09:22:29.478 - info: mihome-vacuum.0 (490) send command
2023-04-02 09:22:29.479 - debug: mihome-vacuum.0 (490) We are in onMessage:{"command":"send","message":"startWashMop","from":"system.adapter.javascript.0","callback":{"message":"startWashMop","id":14,"ack":true,"time":1680420149421},"_id":94808698}
2023-04-02 09:22:29.481 - info: javascript.0 (452) script.js.archive.SaugWischRoboter_Test: Message received
2023-04-02 09:22:29.497 - debug: xbox.0 (1455) Device status: Connected
2023-04-02 09:22:29.498 - debug: xbox.0 (1455) SGClient connection status: false
2023-04-02 09:22:29.498 - debug: xbox.0 (1455) SGClient isConnected: false
2023-04-02 09:22:38.638 - debug: mihome-vacuum.0 (490) Receive <<< Helo <<< 213100200000000022682cb40000509effffffffffffffffffffffffffffffff
2023-04-02 09:22:38.638 - debug: mihome-vacuum.0 (490) Time difference between Mihome Vacuum and ioBroker: -1680399520 sec
2023-04-02 09:22:39.344 - debug: mihome-vacuum.0 (490) get params for stock Vacuum
2023-04-02 09:22:39.345 - debug: mihome-vacuum.0 (490) Message= {"id":8865,"method":"get_status"}
2023-04-02 09:22:39.365 - debug: mihome-vacuum.0 (490) MIIO RECIVE: {"id":8865,"result":[{"msg_ver":2,"msg_seq":1562,"state":3,"battery":94,"clean_time":32,"clean_area":0,"error_code":0,"map_present":1,"in_cleaning":0,"in_returning":0,"in_fresh_state":1,"lab_status":1,"water_box_status":1,"back_type":-1,"wash_phase":0,"wash_ready":0,"fan_power":101,"dnd_enabled":0,"map_status":3,"is_locating":0,"lock_status":0,"water_box_mode":203,"water_box_carriage_status":1,"mop_forbidden_enable":1,"camera_status":3457,"is_exploring":0,"home_sec_status":0,"home_sec_enable_password":0,"adbumper_status":[0,0,0],"water_shortage_status":0,"dock_type":3,"dust_collection_status":0,"auto_dust_collection":1,"avoid_count":0,"mop_mode":300,"debug_mode":0,"collision_avoid_status":1,"switch_map_mode":0,"dock_error_status":0,"charge_status":1,"unsave_map_reason":4,"unsave_map_flag":0}],"exe_time":10}
2023-04-02 09:22:39.365 - debug: mihome-vacuum.0 (490) setGetStatus {"msg_ver":2,"msg_seq":1562,"state":3,"battery":94,"clean_time":32,"clean_area":0,"error_code":0,"map_present":true,"in_cleaning":false,"in_returning":0,"in_fresh_state":1,"lab_status":1,"water_box_status":1,"back_type":-1,"wash_phase":0,"wash_ready":0,"fan_power":101,"dnd_enabled":false,"map_status":3,"is_locating":0,"lock_status":0,"water_box_mode":203,"water_box_carriage_status":1,"mop_forbidden_enable":1,"camera_status":3457,"is_exploring":0,"home_sec_status":0,"home_sec_enable_password":0,"adbumper_status":[0,0,0],"water_shortage_status":0,"dock_type":3,"dust_collection_status":0,"auto_dust_collection":1,"avoid_count":0,"mop_mode":300,"debug_mode":0,"collision_avoid_status":1,"switch_map_mode":0,"dock_error_status":0,"charge_status":1,"unsave_map_reason":4,"unsave_map_flag":0,"error_text":"No error"}
2023-04-02 09:22:39.366 - debug: mihome-vacuum.0 (490) Message= {"id":8866,"method":"get_network_info"}
2023-04-02 09:22:39.405 - debug: mihome-vacuum.0 (490) MIIO RECIVE: {"id":8866,"result":{"ssid":"Apfelsaft_S","ip":"192.168.168.63","mac":"b0:4a:39:59:75:74","bssid":"b0:f2:08:07:63:23","rssi":-43},"exe_time":30}
2023-04-02 09:22:39.497 - debug: xbox.0 (1455) Device status: Connected
2023-04-02 09:22:39.497 - debug: xbox.0 (1455) SGClient connection status: false
2023-04-02 09:22:39.497 - debug: xbox.0 (1455) SGClient isConnected: false
2023-04-02 09:22:39.600 - debug: mihome-vacuum.0 (490) Message= {"id":8867,"method":"get_sound_volume"}
2023-04-02 09:22:39.618 - debug: mihome-vacuum.0 (490) MIIO RECIVE: {"id":8867,"result":[5],"exe_time":10}
2023-04-02 09:22:39.618 - debug: mihome-vacuum.0 (490) Message= {"id":8868,"method":"get_carpet_mode"}
2023-04-02 09:22:39.638 - warn: mihome-vacuum.0 (490) State value to set for "mihome-vacuum.0.control.sound_volume" has value "5" less than min "30"
2023-04-02 09:22:39.639 - debug: mihome-vacuum.0 (490) MIIO RECIVE: {"id":8868,"result":[{"enable":1,"current_integral":450,"current_high":500,"current_low":400,"stall_time":10}],"exe_time":11}

<!--EndFragment-->
</body>
</html>
dirkhe commented 1 year ago

Ich hatte das doch schon weiter oben geschrieben, dass ich das noch nachrreicgrn muß (irgendwie have ich im kopf, das ich das schon gemacht habe, vlt nur noch nicht gepusht). Aktuell geht das nur über den dp oder über sendCustom, dann aber mit app_wash_clean

RkcCorian commented 1 year ago

Alles gut, hatte mich auch auf Deinen letzten Kommentar gemeldet, um zu schauen, welche Statuswechsel passieren 😉😘

Was du mal testen könntest: Seteze den Robb etwas weiter weg und schicke ihn zurück zur Station, während er zurückfährt, sendest du über den Adapter per customcommd mal startWashMop und beobachtest die stati, wann er welchen setzt, am besten mit debuglog. Wenn wir Glück haben, setzt er den auf 26, going to mop clean. Dann könnte ich das vlt. in die queue reinpacken.

Folgendes probiere ich, geht aber beides nicht... mihome-vacuum.0.control.X_send_command schreiben mit startWashMop

sowie JS-Funktion mit...

sendTo("mihome-vacuum.0", 
    "app_wash_clean", 
    async function (result) 
  {
    console.log(result);
  });
dirkhe commented 1 year ago

Genau umgekehrt, siehe README:

"app_start_wash" in mihome-vacuum.0.control.X_send_command
oder 
sendTo("mihome-vacuum.0", "sendCustomCommand", 
    {method: "app_start_wash"}, 
    function (response) { /* do something with the result */}
);

Aber wenn du den master mal auscheckst, sollte jetzt auch folgendes gehen

sendTo("mihome-vacuum.0", 
    "startWashMop", 
    async function (result) 
  {
    console.log(result);
  });
dirkhe commented 10 months ago

@RkcCorian funktioniert jetzt alles, können wir das Ticket schließen?

RkcCorian commented 10 months ago

@dirkhe : Gute Frage 🙈 Ich teste es nochmal die Tage und gebe Bescheid, danke Dir!