fhempy: miio (Xiaomi WiFi Devices)

Begonnen von dominik, 30 Oktober 2020, 21:26:31

Vorheriges Thema - Nächstes Thema

dominik

fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

curt

Zitat von: dominik am 09 Dezember 2020, 17:17:03
Bitte nochmals um das Logfile nach dem Restart. Poste bitte auch die Ausgabe von
ps -efa|grep python

Bis auf das grep selbst ist da nichts zu sehen.
Aber mir fällt etwas anderes auf: Du schreibst zu Anfang, dass Python-3 Pflicht wäre.


# python -V
Python 2.7.16
root@fhem:/opt/fhem# cat /etc/issue
Raspbian GNU/Linux 10 \n \l


Aptitude search bringt allerdings


i A python2 - interactive high-level object-oriented language (Python2 version)
i A python3 - interactive high-level object-oriented language (default python3 version)


Jetzt bin ich etwas ratlos, was ist da zu tun?

Ich will nochmal sagen, dass das Ganze am 05./06.12. bei mir ja funktionierte.

Auf Log(s) habe ich jetzt verzichtet, vermutlich bringt das in der Phase nichts. Falls - bitte sagen welches.

Danke!
RPI 4 - Jeelink HomeMatic Z-Wave

Stelaku

Hallo Dominik
Zitat
Puh, also das ist ja schon sehr eigenartig. Wie kann sich ein Command per App auf FHEM auswirken? Das kann nur passieren, wenn dazwischen von FHEM automatisch schon ein status oder ähnliches getriggert wird.
Kannst du bitte probieren, direkt nach der Steuerung per App innerhalb weniger Sekunden ein status zu machen?
Das update ist jetzt kpl. durchgeflaufen Fhem shutdown restart und den pi gleich auch einmal rebootet. Und nun nach Herzenslust getestet.
Ich konnte die Meldung aber sehr schnell wieder reproduzieren. Ich habe die app auf Fernbedienung stehen Anzeige im Handy mit den 4 Richtungspfeilen.
Wenn ich jetzt in Fhem auf status gehe kommt noch keine Meldung. Ich kann wie ein irrer auf das set icon im Device klicken (schnell hintereinander).
Sobald ich den Pfeil für die Fahrt nach vorne im Handy tippe und fast zeitgleich das set icon klicke (einmal) passiert noch nichts. Klicke ich jetzt nocheinmal auf das set icon in Fhem erscheint das Pop up Fenster mit der Medlung

Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 336, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 168, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'

Ab jetzt kommt die Meldung immer wieder wenn ich auf das Icon set klicke.
Erst wenn ich auf über Fhem den Sauger auf pause stelle werden die readings aktualliesiert und ich kann wieder ohne Fehlermeldung das set Icon klicken.
Hier mal ein Log des Device von meinen Sauger.

2020-12-10_06:24:47 Martha_1 active
2020-12-10_06:24:48 Martha_1 ViomiVacuumState.Docked
2020-12-10_06:27:20 Martha_1 active
2020-12-10_06:27:25 Martha_1 ViomiVacuumState.Docked
2020-12-10_06:29:42 Martha_1 status
2020-12-10_06:30:13 Martha_1 status
2020-12-10_06:30:13 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x7243e810>
2020-12-10_06:30:36 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x7243eff0>
2020-12-10_06:31:05 Martha_1 pause
2020-12-10_06:31:07 Martha_1 ViomiVacuumState.Idle
2020-12-10_06:31:07 Martha_1 error_code: 0
2020-12-10_06:31:07 Martha_1 error: Unknown error 0
2020-12-10_06:31:10 Martha_1 status
2020-12-10_06:31:13 Martha_1 status
2020-12-10_06:31:14 Martha_1 status
2020-12-10_06:31:15 Martha_1 status
2020-12-10_06:31:16 Martha_1 status
2020-12-10_06:31:17 Martha_1 status
2020-12-10_06:31:17 Martha_1 status
2020-12-10_06:31:17 Martha_1 status
2020-12-10_06:31:17 Martha_1 status
2020-12-10_06:31:17 Martha_1 status
2020-12-10_06:31:18 Martha_1 status
2020-12-10_06:31:18 Martha_1 status
2020-12-10_06:32:01 Martha_1 status
2020-12-10_06:32:01 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x7253ef10>
2020-12-10_06:32:28 Martha_1 status
2020-12-10_06:32:28 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x7243e7b0>
2020-12-10_06:32:37 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x723e71d0>
2020-12-10_06:33:05 Martha_1 status
2020-12-10_06:33:05 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x7243e030>
2020-12-10_06:33:42 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x723e7890>
2020-12-10_06:33:56 Martha_1 pause
2020-12-10_06:34:00 Martha_1 status
2020-12-10_06:34:01 Martha_1 status
2020-12-10_06:34:01 Martha_1 status
2020-12-10_06:34:01 Martha_1 status
2020-12-10_06:34:01 Martha_1 status
2020-12-10_06:34:02 Martha_1 status
2020-12-10_06:34:02 Martha_1 status
2020-12-10_06:34:02 Martha_1 status
2020-12-10_06:34:02 Martha_1 status
2020-12-10_06:34:02 Martha_1 status
2020-12-10_06:34:03 Martha_1 status
2020-12-10_06:34:03 Martha_1 status
2020-12-10_06:34:03 Martha_1 status
2020-12-10_06:34:03 Martha_1 status
2020-12-10_06:34:03 Martha_1 status
2020-12-10_06:34:04 Martha_1 status
2020-12-10_06:34:04 Martha_1 status
2020-12-10_06:34:04 Martha_1 status
2020-12-10_06:34:04 Martha_1 status
2020-12-10_06:34:05 Martha_1 status
2020-12-10_06:34:05 Martha_1 status
2020-12-10_06:34:05 Martha_1 status
2020-12-10_06:34:05 Martha_1 status
2020-12-10_06:34:05 Martha_1 status
2020-12-10_06:34:06 Martha_1 status
2020-12-10_06:34:06 Martha_1 status
2020-12-10_06:34:06 Martha_1 status
2020-12-10_06:34:06 Martha_1 status
2020-12-10_06:34:07 Martha_1 status
2020-12-10_06:34:12 Martha_1 home
2020-12-10_06:34:15 Martha_1 ViomiVacuumState.Returning
2020-12-10_06:34:15 Martha_1 error_code: 2104
2020-12-10_06:34:15 Martha_1 error: Unknown error 2104
2020-12-10_06:35:48 Martha_1 ViomiVacuumState.Docked
2020-12-10_06:35:48 Martha_1 error_code: 2105
2020-12-10_06:35:48 Martha_1 error: Fully charged
2020-12-10_06:41:28 Martha_1 status
2020-12-10_06:41:28 Martha_1 status
2020-12-10_06:41:28 Martha_1 status
2020-12-10_06:41:28 Martha_1 status
2020-12-10_06:41:29 Martha_1 status
2020-12-10_06:41:42 Martha_1 status
2020-12-10_06:41:42 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x7243e410>
2020-12-10_06:41:53 Martha_1 home
2020-12-10_06:42:03 Martha_1 pause
2020-12-10_06:43:15 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x7243e630>
2020-12-10_06:43:31 Martha_1 status
2020-12-10_06:43:31 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x7395e7b0>
2020-12-10_06:44:20 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x7243e770>
2020-12-10_06:45:25 Martha_1 ViomiVacuumState.Idle2
2020-12-10_06:45:25 Martha_1 error_code: 0
2020-12-10_06:45:25 Martha_1 error: Unknown error 0
2020-12-10_06:45:25 Martha_1 clean_area: 0
2020-12-10_06:45:46 Martha_1 pause
2020-12-10_06:45:54 Martha_1 status
2020-12-10_06:45:55 Martha_1 status
2020-12-10_06:45:55 Martha_1 status
2020-12-10_06:45:55 Martha_1 status
2020-12-10_06:45:56 Martha_1 status
2020-12-10_06:45:56 Martha_1 status
2020-12-10_06:45:56 Martha_1 status
2020-12-10_06:45:56 Martha_1 status
2020-12-10_06:45:56 Martha_1 status


Diese Einträge<miio.viomivacuum.ViomiVacuumStatus object at 0x7243e410>
erscheinen immer zusammen mit der Fehlermeldung. Früher hatte ich die auch im log des Device. Dachte immer das sind Standortinformationen wo der Sauger gerade im Raum steht.


Parrallel mal das log /opt/fhem/log/PythonBinding-2020-12-10.log


2020-12-10 06:24:41,200 - INFO     - fhempy.lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-10 06:24:46,261 - INFO     - fhempy.lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1
2020-12-10 06:26:49,441 - INFO     - fhempy.lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-10 06:27:18,703 - INFO     - fhempy.lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1
2020-12-10 06:30:15,250 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 336, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 168, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 11693212)
2020-12-10 06:30:25,752 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 336, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 168, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 76431441)
2020-12-10 06:30:29,050 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 336, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 168, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 9576265)
2020-12-10 06:33:06,080 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 336, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 168, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 33187430)
2020-12-10 06:33:13,743 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 336, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 168, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 29223769)
2020-12-10 06:41:43,653 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 336, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 168, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 58965164)
2020-12-10 06:42:13,470 - ERROR    - miio.miioprotocol: Got error when receiving: timed out
2020-12-10 06:42:13,471 - ERROR    - fhempy.lib.utils: Error in asyncio thread
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 192, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 192, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 192, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 192, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 29, in run_blocking
    return await asyncio.get_event_loop().run_in_executor(pool, function)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/viomivacuum.py", line 357, in home
    self.send("set_charge", [1])
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/device.py", line 144, in send
    command, parameters, retry_count, extra_parameters=extra_parameters
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 236, in send
    extra_parameters=extra_parameters,
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 236, in send
    extra_parameters=extra_parameters,
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 236, in send
    extra_parameters=extra_parameters,
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 240, in send
    raise DeviceException("No response from the device") from ex
miio.exceptions.DeviceException: No response from the device
2020-12-10 06:42:13,479 - ERROR    - asyncio: Task exception was never retrieved
future: <Task finished coro=<miio.send_command() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/miio/miio.py:117> exception=DeviceException('No response from the device')>
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 192, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 192, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 192, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 192, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/miio/miio.py", line 137, in send_command
    reply = await utils.run_blocking(functools.partial(fct, *args))
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 29, in run_blocking
    return await asyncio.get_event_loop().run_in_executor(pool, function)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/viomivacuum.py", line 357, in home
    self.send("set_charge", [1])
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/device.py", line 144, in send
    command, parameters, retry_count, extra_parameters=extra_parameters
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 236, in send
    extra_parameters=extra_parameters,
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 236, in send
    extra_parameters=extra_parameters,
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 236, in send
    extra_parameters=extra_parameters,
  File "/opt/fhem/.local/lib/python3.7/site-packages/miio/miioprotocol.py", line 240, in send
    raise DeviceException("No response from the device") from ex
miio.exceptions.DeviceException: No response from the device
2020-12-10 06:43:32,709 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 336, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 168, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 16560249)
2020-12-10 06:44:22,865 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 336, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 168, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 82589016)
2020-12-10 06:45:08,611 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 336, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 168, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 6267236)
2020-12-10 06:45:11,205 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 336, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 168, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 33967588)
2020-12-10 06:45:37,379 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 336, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 168, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 53513368)


Alles andere Funktioniert echt super. Auch diese Meldung beeinträchtig die Bedienung des Moduls nicht. Diese konstellation kommt ja normal nicht vor.
Was mir auch noch aufgefallen ist, die Kommunikation zwischen Sauger und Fhem ist sehr schnell. Drücke direkt am Sauger die home taste wird mir das in Fhem inerhalb weniger Sekunden auch angezeigt. Das war in der alten Version nicht so. Da hat das schon mal ein paar Minuten gedauert bis der Status auf Return gegangen ist.

Viele Grüsse

Stephan


dominik

Hi,
die Information, dass die status Meldungen so schnell bei dir ankommen ist sehr wertvoll. Hast du das Attribut update_functions im Einsatz? Wenn nicht, sollte das Statusupdate naemlich nur alle 60s gemacht werden. Die Info, dass bei dir die Statusupdates aber sofort ankommen, bedeutet, dass da eine Endlosschleife drin ist die andauernd den Status abruft.

Bitte daher noch um Info ob du das Attribut update_functions nutzt.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

dominik

Zitat von: curt am 10 Dezember 2020, 01:35:21
Bis auf das grep selbst ist da nichts zu sehen.
Aber mir fällt etwas anderes auf: Du schreibst zu Anfang, dass Python-3 Pflicht wäre.


# python -V
Python 2.7.16
root@fhem:/opt/fhem# cat /etc/issue
Raspbian GNU/Linux 10 \n \l


Aptitude search bringt allerdings


i A python2 - interactive high-level object-oriented language (Python2 version)
i A python3 - interactive high-level object-oriented language (default python3 version)


Jetzt bin ich etwas ratlos, was ist da zu tun?

Ich will nochmal sagen, dass das Ganze am 05./06.12. bei mir ja funktionierte.

Auf Log(s) habe ich jetzt verzichtet, vermutlich bringt das in der Phase nichts. Falls - bitte sagen welches.

Danke!

Python3 ist bei dir sicher installiert, sonst wuerde da eine Fehlermeldung von fhempy kommen.
python3 -V
Sollte die richtige Info liefern.

Kommt im Log noch immer diese Fehlermeldung
OSError: [Errno 98] error while attempting to bind on address ('0.0.0.0', 15733): address already in use

Wenn ja, mach bitte
pi@raspberry39:~ $ sudo fuser 15733/tcp
15733/tcp:            5008
pi@raspberry39:~ $ ps -p 5008
  PID TTY          TIME CMD
5008 ?        00:18:53 fhempy
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Stelaku

Zitat
Hi,
die Information, dass die status Meldungen so schnell bei dir ankommen ist sehr wertvoll. Hast du das Attribut update_functions im Einsatz? Wenn nicht, sollte das Statusupdate naemlich nur alle 60s gemacht werden. Die Info, dass bei dir die Statusupdates aber sofort ankommen, bedeutet, dass da eine Endlosschleife drin ist die andauernd den Status abruft.

Bitte daher noch um Info ob du das Attribut update_functions nutzt.

Hallo Dominik

Das Attribut update_functions nutze ich nicht.

Ich habe gerade nochmal getestet, ohne das ich etwas mache wird alle 65 Sekunden in mein Device log der status gesetzt .
Wenn ich zufällig gerade dann auf start oder pause auf der app klicke wenn Fhem den status anfordert sieht das erstmal so aus als ob er so schnell aktualliesiert.

Dann habe ich den Sauger per Fernbedienung aus der Ladestation herausgefahren und nichts weiter gemacht. Im log vom Device Martha_1 wird weiter ca alle 65 Sekunden aktualliesiert.
gleichzeitig habe ich im log für /opt/fhem/log/PythonBinding-2020-12-10.log immer wieder reingeschaut nachdem sich der status neu geschrieben hat. es war keine Fehlermeldung.
Aber sobald ich selber einen set <dev> status über den set Icon anfordere kommt das pop up Fenster und es wird ein log Eintrag in /opt/fhem/log/PythonBinding-2020-12-10.log geschrieben

2020-12-10_21:36:19 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x72494730>
2020-12-10_21:37:24 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x72494510>
2020-12-10_21:38:29 Martha_1 status: <miio.viomivacuum.ViomiVacuumStatus object at 0x72494c50>
2020-12-10_21:39:35 Martha_1 ViomiVacuumState.Idle
2020-12-10_21:39:35 Martha_1 error_code: 0
2020-12-10_21:39:35 Martha_1 error: Unknown error 0
2020-12-10_21:41:45 Martha_1 battery: 99


Gruß

Stephan









dominik

Was meinst du eigentlich mit set icon?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

curt

#82
Hallo @dominik,

Zitat von: dominik am 10 Dezember 2020, 20:43:30
Kommt im Log noch immer diese Fehlermeldung
OSError: [Errno 98] error while attempting to bind on address ('0.0.0.0', 15733): address already in use

Nein, habe ich nicht mehr.

Zitat von: dominik am 10 Dezember 2020, 20:43:30
Wenn ja, mach bitte

Ich mache trotzdem mal:

# python3 -V
Python 3.7.3

# fuser 15733/tcp
15733/tcp:             708

# ps -p 708
  PID TTY          TIME CMD
  708 ?        00:00:01 python3


Log nach Reboot hänge ich an.
(P.S: Zitatebene korrigiert)
RPI 4 - Jeelink HomeMatic Z-Wave

Stelaku

#83
ZitatWas meinst du eigentlich mit set icon?

Moin Dominik

Ich hab mir schon gedacht das das zu Mißverständnissen kommt. Mit set ( ICON ) meine ich das ICON oben links in der Device übersicht. Hab mal ein Bild angehängt.
Das hat  mich aber jetzt auf eine Idee gebracht.
Ich hab das ganze mal nicht mit der Device Übersicht gemacht sondern oben direkt in der Kommandozeile den Befehl set Martha_1 status eingegen und das dann auch schnell hintereinander.
Jetzt bekomme ich die Fehlermeldung nicht mehr reproduziert. Es gibt auch keinen log Eintrag in /opt/fhem/log/PythonBinding-2020-12-11.log
Was mir noch aufgefallen ist, und ich glaube das ist das Problem. Normalerweise wenn ich einen Befehl in der Device Übersicht mit den set  ( ICON ) absetzte wird die Web Seite einmal neu geladen
und ich würde dann wenn ich erneut auf das Icon klicke den carpet_mode setzen. Das ist bei mir aber nicht der fall, wenn ich im drop down menü set Martha_1 status ausgewählt habe.
Wenn ich jetzt auf set klicke bleibt die Device übersicht gleich und ich kann erneut auf set klicken und dann kommt die Fehlermeldung wenn ich Martha_1 zuvor mit der Fernbedienung gefahren habe.

Viele Grüße

Stephan



Stelaku

Ich hab noch ein bisschen herumprobiert. Ich habe ein kpl. neuen Fhem Server Jungfreulich aufgesetzt. Da ist nichts weiter drauf als fempy.
Nach der Installation konnte ich den set status Befehl über das besagte Icon anklicken und das drop down menü wurde neu aufgebaut. Ohne Fehlermeldung.
Was aber in der Grundversion von der Datei viomivacuum.py nicht funktioniert ist der move Befehl. Da hast Du ja eine Änderung vorgenommen. post #12
Zitat
Ich habe einen Pull Request dazu erstellt:
https://github.com/rytilahti/python-miio/pull/872

Diese Datei habe ich dann mit root Rechten in das Verzeichnis
/opt/fhem/.local/lib/python3.7/site-packages/miio Kopiert.

Fhem neu gestartet. Natürlich kommt jetzt die Medlung im log für fempy. Das es Berechtigungs Probleme gibt.
Could not install packages due to an EnvironmentError: [Errno 13] Keine Berechtigung: '/root/.cache/pip/wheels/6d/39/5c/8cce6617ff784b42b764a52b6331248cbcbf7006a2e01fe835'
Check the permissions.

Fhem wieder gestopt und die Rechte der Datei auf Fhem:dialout gesetzt.
Fhem wieder gestartet. Ohne Erfolg die Meldung mit der Berechtigung blieb.
Fhem wieder gestopt und für das ganze Fhem Verzeichnis die Berechtigung neu gesetzt.
sudo chown -R fhem:dialout /opt/fhem
Fhem wieder gestartet. Auch ohne Erfolg. Keine Berechtigung.
Erst nach einen reboot des pi´s ging local_pybindig auf opened.
Ab jetzt konnte ich den Saugere wieder mit set Martha_1 move Forward 4 manuell steuern.
Aber wie Du Dir bestimmt denken kannst kommt die pop up Meldung wenn ich auf das ICON für set Martha_1 status zweimal draufklicke.

Kann es sein das die Datei aus post #12 im update noch nicht mit drin ist, und deshalb bei Dir auch nicht den Fehler erzeugt ?

Viele Grüsse

Stephan


dominik

Zitat von: curt am 11 Dezember 2020, 03:19:52
Hallo @dominik,

Nein, habe ich nicht mehr.

Ich mache trotzdem mal:

# python3 -V
Python 3.7.3

# fuser 15733/tcp
15733/tcp:             708

# ps -p 708
  PID TTY          TIME CMD
  708 ?        00:00:01 python3


Log nach Reboot hänge ich an.
(P.S: Zitatebene korrigiert)

Sieht doch schon gut aus, du hast nur mehr ein Timeout bei der Verbindung zum Vacuum. Token und IP sind richtig?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

dominik

@Stelaku,
das mit den Berechtigungen ist sehr eigenartig. Aber ok, damit hängt es glaube ich nicht zusammen.

Das mehrmals auf das Set Icon klicken dürfte das Problem sein. Wenn ich da einmal klicke, dann lädt sich die FHEM Website neu und ich muss "status" wieder auswählen bevor ich set klicken kann. Das ist der Standard. Wenn du das so machst, bekommst du keinen Fehler?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

curt

Zitat von: dominik am 11 Dezember 2020, 18:30:00
Token und IP sind richtig?

IP ist richtig und von FHEM aus via ping erreichbar. Beim Token weiß ich nicht, wie ich das prüfen könnte. Zwischendrin hatte ich wohl nochmal den/einen Token mit gleicher Mailadresse und gleichem Gerät angefordert - da kam aber -so denke ich- der gleiche Token.

Ok, kann ich die Richtigkeit des Token prüfen? Falls nicht, wie weiter?
RPI 4 - Jeelink HomeMatic Z-Wave

Stelaku

ZitatDas mehrmals auf das Set Icon klicken dürfte das Problem sein. Wenn ich da einmal klicke, dann lädt sich die FHEM Website neu und ich muss "status" wieder auswählen bevor ich set klicken kann. Das ist der Standard. Wenn du das so machst, bekommst du keinen Fehler?

Hallo Dominik

Das passiert leider bei mir nicht. Wenn ich auf set klicke wird die seite nicht neu geladen und ich kann ohne neue Auswahl im drop down sofort wieder auf set klicken. Das Standart Verhalten so wie Du es bei Dir beobachten kannst habe ich auch aber nur mit der Standart  Datei viomivacuum.py. Nur mit der Standart Datei gehen die move Befehle bei mir nicht. Weil da ja die wie Du geschrieben hattest
ZitatIch weiß schon was fehlt, die Annotation im Code. Ich vermute clean_mode kannst du auch nicht setzen, oder?

Vieleicht kannst Du den Fehler bei Dir reproduzieren wenn Du die Datei
ZitatIch habe einen Pull Request dazu erstellt:
https://github.com/rytilahti/python-miio/pull/872
in Deiner Installation auch dort einfügst.

Viele Grüsse

Stephan

Stelaku

ZitatIP ist richtig und von FHEM aus via ping erreichbar. Beim Token weiß ich nicht, wie ich das prüfen könnte. Zwischendrin hatte ich wohl nochmal den/einen Token mit gleicher Mailadresse und gleichem Gerät angefordert - da kam aber -so denke ich- der gleiche Token.

Ok, kann ich die Richtigkeit des Token prüfen? Falls nicht, wie weiter?

Hallo curt

Du müsstes doch auch das Device xiaomi_tokens bei Dir haben.
Du solltest den Token über das Device einfach nochmal anfragen.
Ich hab das gerade bei mir ausprobiert und es hat erst ein neues reading für den token gegeben als ich das Device xiaomi_tokens einmal gelöscht habe und dann wieder neu mit
define xiaomi_tokens PythonModule xiaomi_tokens
angelegt habe.
Dann wie gehabt einmal den Benutzernamen eingebn
danach das passwort und zu guter letzt get token klicken.
Seite aktualliesieren und der token wird als reading angezeigt.

Viele Grüsse

Stephan