fhempy: miio (Xiaomi WiFi Devices)

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

Vorheriges Thema - Nächstes Thema

Stelaku

Hallo Dominik

ZitatDas ist sehr eigenartig, kannst du mir sagen was du da gemacht hast? Weil auf /root sollte niemals zugegriffen werden.
Das passiert nachdem ich ein backup eingespielt habe. Verschwindet dann auch erst nach einem raspberry reboot. Das Backup spiele ich immer so ein

sudo rm -r /opt/fhem
sudo mkdir /opt/fhem
sudo tar -xvzf /media/Medion/Linux/"$Version"/FHEM/"$Datei" -C /opt/fhem/
sudo chown -R fhem:dialout /opt/fhem


das Verzeichnis .local wird auch nicht beim Fhem backup mit kopiert. Erst nach einen Reboot wird es durch das device BindingIO angelegt. Vieleicht deshalb die Berechtigungsprobleme.

ZitatÖffne bitte mal die Datei:
/opt/fhem/FHEM/bindings/python/lib/miio/miio.py
Dann in Zeile 168 folgendes einfügen:

Diese Datei hat bei mir nur 168 Zeilen. Wenn ich dich richtig verstehe soll ich doch nur die eine Zeile einfügen. bei meiner Datei fehlt die die for schleife  for arg in args[2:]:
Soll ich einfach mal das an meiner datei anfügen.
for arg in args[2:]:
                # arg ... mode
                # all_args[mode] = mode argument
                logging.getLogger(__name__).error("Handle argument: " + str(arg))
                all_args[cmd_def["args"][i]] = arg
                i += 1

Gruß

Stephan

dominik

Sorry, ich meinte diese Datei:
/opt/fhem/FHEM/bindings/python/lib/utils.py
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 08 Dezember 2020, 23:41:25
ok, dann mach jetzt bitte einen FHEM Restart.

Done. (Keine Änderung.)

Was muss ich nun tun?
RPI 4 - Jeelink HomeMatic Z-Wave

Stelaku

ZitatSorry, ich meinte diese Datei:
/opt/fhem/FHEM/bindings/python/lib/utils.py

Hallo Dominik

Datei habe ich jetzt geändert. Hier mein heutiges Log. Ich habe alle schritte die ich gemacht habe im Log kommentiert.

Nach der Änderung in der Datei hatte ich wieder den Eintrag keine Berechtigung im Log siehe Eintrag 15:43:15.
Das BindingIO blieb dann auch auf disconected. Erst nach einen reboot ging es wieder.

2020-12-08 22:03:29,520 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-09 06:46:53,348 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1
2020-12-09 06:56:01,617 - INFO     - lib.pkg_installer: Attempting install of fhempy
2020-12-09 06:56:11,108 - ERROR    - asyncio: Task exception was never retrieved
future: <Task finished coro=<PyBinding.onMessage() done, defined at /opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py:108> exception=SystemExit(1)>
Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 110, in onMessage
    await self._onMessage(payload)
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 361, in _onMessage
    raise se
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 143, in _onMessage
    sys.exit(1)
SystemExit: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
    self._run_once()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1775, in _run_once
    handle._run()
  File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 112, in onMessage
    sys.exit(1)
SystemExit: 1
2020-12-09 06:56:12,387 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-09 06:56:22,031 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1
2020-12-09 07:16:28,866 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-09 15:26:57,652 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1
2020-12-09 15:40:39,420 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-09 15:40:45,083 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1
## Änderung an der Datei /opt/fhem/FHEM/bindings/python/lib/utils.py jetzt neustart 
2020-12-09 15:43:07,847 - INFO     - __main__: Attempting install of websockets
2020-12-09 15:43:15,568 - ERROR    - __main__: Unable to install package websockets: The directory '/root/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/root/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Could not install packages due to an EnvironmentError: [Errno 13] Keine Berechtigung: '/root/.cache/pip/wheels/6d/39/5c/8cce6617ff784b42b764a52b6331248cbcbf7006a2e01fe835'
Check the permissions.

## Raspberry pi Reboot weil BindingIO disconected

2020-12-09 15:46:48,469 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-09 15:47:17,058 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1

## move Forward 4

2020-12-09 15:48:52,084 - ERROR    - lib.utils: Handle argument: Forward
2020-12-09 15:48:52,085 - ERROR    - lib.utils: Handle argument: 4

## set status das erste mal kein eintrag ins log
## set status das zweite mal

2020-12-09 15:50:06,367 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 15:50:06,377 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 6614412)

## set home
## move Befehle Sauger fährt zum Mülleimer



2020-12-09 15:53:07,930 - ERROR    - lib.utils: Handle argument: Vacuum
2020-12-09 15:53:12,991 - ERROR    - lib.utils: Handle argument: Silent
2020-12-09 15:54:47,063 - ERROR    - lib.utils: Handle argument: Forward
2020-12-09 15:54:47,063 - ERROR    - lib.utils: Handle argument: 5
2020-12-09 15:54:55,131 - ERROR    - lib.utils: Handle argument: Right
2020-12-09 15:54:55,131 - ERROR    - lib.utils: Handle argument: 0.82
2020-12-09 15:54:58,998 - ERROR    - lib.utils: Handle argument: Forward
2020-12-09 15:54:58,999 - ERROR    - lib.utils: Handle argument: 15
2020-12-09 15:55:17,045 - ERROR    - lib.utils: Handle argument: Right
2020-12-09 15:55:17,045 - ERROR    - lib.utils: Handle argument: 0.85
2020-12-09 15:55:20,943 - ERROR    - lib.utils: Handle argument: Forward
2020-12-09 15:55:20,943 - ERROR    - lib.utils: Handle argument: 9
2020-12-09 15:55:32,992 - ERROR    - lib.utils: Handle argument: Right
2020-12-09 15:55:32,993 - ERROR    - lib.utils: Handle argument: 3

## set status Befehl
## set status auch nach mehrmaligen klicken jetzt kein log eintrag

## set home und wärend der fahrt auf set status geklickt kein log
## Sauger state Docked jetzt wieder einen move Befehl

2020-12-09 15:59:39,862 - ERROR    - lib.utils: Handle argument: Forward
2020-12-09 15:59:39,863 - ERROR    - lib.utils: Handle argument: 5

## set status
## set status log eintrag kommt erst beim zweiten klick
## und das state bleibt immer auf Docked
2020-12-09 16:00:15,111 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:00:15,112 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 55497932)

## jetzt set start
## Sauger legt los und das state geht auf cleaning
## set status funktioniert ohne log eintrag
## sauger stopen
## set move

2020-12-09 16:04:09,293 - ERROR    - lib.utils: Handle argument: Forward
2020-12-09 16:04:09,293 - ERROR    - lib.utils: Handle argument: 4

## set status der aktuell angezeigte ist Idle
## set status erst beim zweiten klicken auf set kam die Meldung über Fhem
2020-12-09 16:04:58,909 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:04:58,911 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 35962919)

## set home kein log Eintrag
## move über die Handy app
## jetzt set status


2020-12-09 16:10:40,189 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:10:40,190 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 18054667)
## state bleibt auf Docked und die Meldung in Fhem wird angezeigt
## set state nachdem ich die Handy app ausgeschaltet habe Fernbedinung.
2020-12-09 16:12:35,123 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:12:35,125 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 95381176)

## jetzt per app saugen starten

2020-12-09 16:13:53,697 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:13:53,698 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 46661273)

## jetzt per app zum laden fahren
## das state im device wird auf Returning gestellt.
## wärend der fahrt zur ladestation ein set status erzeugt wieder die Meldung
2020-12-09 16:14:49,135 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:14:49,137 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 78238621)

## Sauger ist Docked jetzt ein set status

2020-12-09 16:16:33,338 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:16:33,339 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 41488255)

## Jetzt über Fhem starten
## jetzt funktioniert set state wieder ohne Log eintrag
## über app auf pause
## set status device zeigt immer noch Cleaning
## state des device geht auf Idle2
## move Befehl über FHEM

2020-12-09 16:20:49,531 - ERROR    - lib.utils: Handle argument: Left
2020-12-09 16:20:49,532 - ERROR    - lib.utils: Handle argument: 4

## Sauger ist schlecht geworden
## set status erster klick keine Änderung im device
## set status zweiter klick

2020-12-09 16:22:24,753 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:22:24,755 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 4309912)



Viele Grüße

Stephan

dominik

Zitat von: curt am 09 Dezember 2020, 09:01:12
Done. (Keine Änderung.)

Was muss ich nun tun?

Bitte nochmals um das Logfile nach dem Restart. Poste bitte auch die Ausgabe von
ps -efa|grep python
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

dominik

Zitat von: Stelaku am 09 Dezember 2020, 16:34:08
Hallo Dominik

Datei habe ich jetzt geändert. Hier mein heutiges Log. Ich habe alle schritte die ich gemacht habe im Log kommentiert.

Nach der Änderung in der Datei hatte ich wieder den Eintrag keine Berechtigung im Log siehe Eintrag 15:43:15.
Das BindingIO blieb dann auch auf disconected. Erst nach einen reboot ging es wieder.

2020-12-08 22:03:29,520 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-09 06:46:53,348 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1
2020-12-09 06:56:01,617 - INFO     - lib.pkg_installer: Attempting install of fhempy
2020-12-09 06:56:11,108 - ERROR    - asyncio: Task exception was never retrieved
future: <Task finished coro=<PyBinding.onMessage() done, defined at /opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py:108> exception=SystemExit(1)>
Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 110, in onMessage
    await self._onMessage(payload)
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 361, in _onMessage
    raise se
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 143, in _onMessage
    sys.exit(1)
SystemExit: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
    self._run_once()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1775, in _run_once
    handle._run()
  File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 112, in onMessage
    sys.exit(1)
SystemExit: 1
2020-12-09 06:56:12,387 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-09 06:56:22,031 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1
2020-12-09 07:16:28,866 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-09 15:26:57,652 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1
2020-12-09 15:40:39,420 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-09 15:40:45,083 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1
## Änderung an der Datei /opt/fhem/FHEM/bindings/python/lib/utils.py jetzt neustart 
2020-12-09 15:43:07,847 - INFO     - __main__: Attempting install of websockets
2020-12-09 15:43:15,568 - ERROR    - __main__: Unable to install package websockets: The directory '/root/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/root/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Could not install packages due to an EnvironmentError: [Errno 13] Keine Berechtigung: '/root/.cache/pip/wheels/6d/39/5c/8cce6617ff784b42b764a52b6331248cbcbf7006a2e01fe835'
Check the permissions.

## Raspberry pi Reboot weil BindingIO disconected

2020-12-09 15:46:48,469 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-09 15:47:17,058 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1

## move Forward 4

2020-12-09 15:48:52,084 - ERROR    - lib.utils: Handle argument: Forward
2020-12-09 15:48:52,085 - ERROR    - lib.utils: Handle argument: 4

## set status das erste mal kein eintrag ins log
## set status das zweite mal

2020-12-09 15:50:06,367 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 15:50:06,377 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 6614412)

## set home
## move Befehle Sauger fährt zum Mülleimer



2020-12-09 15:53:07,930 - ERROR    - lib.utils: Handle argument: Vacuum
2020-12-09 15:53:12,991 - ERROR    - lib.utils: Handle argument: Silent
2020-12-09 15:54:47,063 - ERROR    - lib.utils: Handle argument: Forward
2020-12-09 15:54:47,063 - ERROR    - lib.utils: Handle argument: 5
2020-12-09 15:54:55,131 - ERROR    - lib.utils: Handle argument: Right
2020-12-09 15:54:55,131 - ERROR    - lib.utils: Handle argument: 0.82
2020-12-09 15:54:58,998 - ERROR    - lib.utils: Handle argument: Forward
2020-12-09 15:54:58,999 - ERROR    - lib.utils: Handle argument: 15
2020-12-09 15:55:17,045 - ERROR    - lib.utils: Handle argument: Right
2020-12-09 15:55:17,045 - ERROR    - lib.utils: Handle argument: 0.85
2020-12-09 15:55:20,943 - ERROR    - lib.utils: Handle argument: Forward
2020-12-09 15:55:20,943 - ERROR    - lib.utils: Handle argument: 9
2020-12-09 15:55:32,992 - ERROR    - lib.utils: Handle argument: Right
2020-12-09 15:55:32,993 - ERROR    - lib.utils: Handle argument: 3

## set status Befehl
## set status auch nach mehrmaligen klicken jetzt kein log eintrag

## set home und wärend der fahrt auf set status geklickt kein log
## Sauger state Docked jetzt wieder einen move Befehl

2020-12-09 15:59:39,862 - ERROR    - lib.utils: Handle argument: Forward
2020-12-09 15:59:39,863 - ERROR    - lib.utils: Handle argument: 5

## set status
## set status log eintrag kommt erst beim zweiten klick
## und das state bleibt immer auf Docked
2020-12-09 16:00:15,111 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:00:15,112 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 55497932)

## jetzt set start
## Sauger legt los und das state geht auf cleaning
## set status funktioniert ohne log eintrag
## sauger stopen
## set move

2020-12-09 16:04:09,293 - ERROR    - lib.utils: Handle argument: Forward
2020-12-09 16:04:09,293 - ERROR    - lib.utils: Handle argument: 4

## set status der aktuell angezeigte ist Idle
## set status erst beim zweiten klicken auf set kam die Meldung über Fhem
2020-12-09 16:04:58,909 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:04:58,911 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 35962919)

## set home kein log Eintrag
## move über die Handy app
## jetzt set status


2020-12-09 16:10:40,189 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:10:40,190 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 18054667)
## state bleibt auf Docked und die Meldung in Fhem wird angezeigt
## set state nachdem ich die Handy app ausgeschaltet habe Fernbedinung.
2020-12-09 16:12:35,123 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:12:35,125 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 95381176)

## jetzt per app saugen starten

2020-12-09 16:13:53,697 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:13:53,698 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 46661273)

## jetzt per app zum laden fahren
## das state im device wird auf Returning gestellt.
## wärend der fahrt zur ladestation ein set status erzeugt wieder die Meldung
2020-12-09 16:14:49,135 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:14:49,137 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 78238621)

## Sauger ist Docked jetzt ein set status

2020-12-09 16:16:33,338 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:16:33,339 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 41488255)

## Jetzt über Fhem starten
## jetzt funktioniert set state wieder ohne Log eintrag
## über app auf pause
## set status device zeigt immer noch Cleaning
## state des device geht auf Idle2
## move Befehl über FHEM

2020-12-09 16:20:49,531 - ERROR    - lib.utils: Handle argument: Left
2020-12-09 16:20:49,532 - ERROR    - lib.utils: Handle argument: 4

## Sauger ist schlecht geworden
## set status erster klick keine Änderung im device
## set status zweiter klick

2020-12-09 16:22:24,753 - ERROR    - lib.utils: Handle argument: undefined
2020-12-09 16:22:24,755 - ERROR    - lib.fhem_pythonbinding: Failed to execute function Set: Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 320, in _onMessage
    fct_timeout,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/opt/fhem/FHEM/bindings/python/lib/generic.py", line 77, in Set
    return await utils.handle_set(self._conf_set, self, hash, args, argsh)
  File "/opt/fhem/FHEM/bindings/python/lib/utils.py", line 169, in handle_set
    all_args[cmd_def["args"][i]] = arg
KeyError: 'args'
(id: 4309912)



Viele Grüße

Stephan

Also irgendetwas stimmt da bei deiner Installation nicht....siehst du im BindingsIo Device ein "update"? Weil nur darueber kann dieser Logeintrag kommen
2020-12-09 06:56:01,617 - INFO     - lib.pkg_installer: Attempting install of fhempy

Das hier
## Änderung an der Datei /opt/fhem/FHEM/bindings/python/lib/utils.py jetzt neustart
2020-12-09 15:43:07,847 - INFO     - __main__: Attempting install of websockets
2020-12-09 15:43:15,568 - ERROR    - __main__: Unable to install package websockets: The directory '/root/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/root/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Could not install packages due to an EnvironmentError: [Errno 13] Keine Berechtigung: '/root/.cache/pip/wheels/6d/39/5c/8cce6617ff784b42b764a52b6331248cbcbf7006a2e01fe835'
Check the permissions.

Ist mir auch unerklärlich. Websockts wird nur installiert wenn es nicht vorhanden ist, warum ist es vor dem Neustart vorhanden und danach nicht? Da muss doch mehr passiert sein.
Mit welchem User wird bei dir fhem ausgeführt? Außerdem müssten alle Dateien in /opt/fhem dem User fhem gehören, bitte das auch prüfen ("ls -la /opt/fhem/*").

2020-12-09 16:00:15,111 - ERROR    - lib.utils: Handle argument: undefined
Wo das undefined herkommt, ist mir einfach noch nicht klar.

Konzentrieren wir uns mal auf den 1. Punkt und lösen den, damit wir hier nicht zu viel auf einmal versuchen.
Mach bitte ein sudo -u fhem pip3 uninstall fhempy und danach einen FHEM Neustart, dann poste nochmals das Log.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Stelaku

#66
Hallo Dominik
Stephan@Haus:~ $ sudo -u fhem pip3 uninstall fhempy
Uninstalling fhempy-0.1.5:
  Would remove:
    /opt/fhem/.local/bin/fhempy
    /opt/fhem/.local/lib/python3.7/site-packages/fhempy-0.1.5.dist-info/*
    /opt/fhem/.local/lib/python3.7/site-packages/lib/*
Proceed (y/n)? y
  Successfully uninstalled fhempy-0.1.5

Fhem shutdown restart
und jetzt das Log
2020-12-09 18:19:09,502 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-12-09 18:19:15,148 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 127.0.0.1

Im Device BindingIO habe ich kein update Command

ls -la /opt/fhem/

Stephan@Haus:~ $ ls -la /opt/fhem/
insgesamt 1316
drwxr-xr-x 18 fhem dialout   4096 Dez  8 16:53 .
drwxr-xr-x  4 root root      4096 Dez  8 16:46 ..
drwxr-xr-x  3 fhem dialout   4096 Dez  8 16:53 .cache
-rw-r--r--  1 fhem dialout 354762 Dez  8 16:54 CHANGED
-rw-rw-rw-  1 fhem dialout  41442 Nov 27 21:15 configDB.pm
drwxrwxrwx 50 fhem dialout   4096 Mär 11  2017 contrib
-rw-r--r--  1 fhem dialout 143698 Nov 28  2019 controls_fhem.txt
-rw-r--r--  1 fhem dialout  18092 Nov 28  2019 COPYING
drwxrwxrwx  3 fhem dialout   4096 Mär 11  2017 demolog
drwxrwxrwx  4 fhem dialout   4096 Mär 11  2017 docs
drwxrwxrwx  7 fhem dialout  32768 Nov 27 21:16 FHEM
-rw-rw-rw-  1 fhem dialout 344381 Dez  9 15:37 fhem.cfg
-rw-rw-rw-  1 fhem dialout  25544 Dez  8  2019 fhem.cfg.demo
-rwxrwxrwx  1 fhem dialout 166203 Dez  8 16:54 fhem.pl
-rw-r--r--  1 fhem dialout  18092 Nov 27 21:15 GPL_V2.txt
drwxr-xr-x  2 fhem dialout   4096 Nov 28  2019 GTags
-rw-r--r--  1 fhem dialout  28513 Nov 28  2019 HISTORY
-rwxrwxrwx  1 fhem dialout    235 Jan  4  2019 lecron.sh
-rwxrwxrwx  1 fhem dialout    422 Jan  5  2019 lecron_tacktung.sh
-rwxrwxrwx  1 fhem dialout    399 Jan  4  2019 lescan.sh
drwxr-xr-x  3 fhem dialout   4096 Jul 22 19:47 lib
drwx------  4 fhem dialout   4096 Dez  8 16:53 .local
drwxrwxrwx  2 fhem dialout   4096 Dez  9 18:29 log
-rw-r--r--  1 fhem dialout  42672 Dez  8 16:54 MAINTAINER.txt
-rw-r--r--  1 fhem dialout   5061 Nov 28  2019 Makefile
drwxr-xr-x  2 fhem dialout   4096 Nov  7  2019 Muellkalender
-rw-rw-rw-  1 fhem dialout    935 Nov 15  2015 README_DEMO.txt
-rw-r--r--  1 fhem dialout    374 Nov 28  2019 README.SVN
drwxr-xr-x  7 fhem dialout   4096 Apr 10  2019 restoreDir
drwxr-xr-x  2 fhem dialout   4096 Apr 10  2019 skripte
drwxr-xr-x  3 fhem dialout   4096 Nov 18 14:42 t
-rw-r--r--  1 fhem dialout     12 Mai  9  2017 test.sh
drwxr-xr-x  2 fhem dialout   4096 Mär 11  2017 unused
-rw-r--r--  1 fhem dialout   1978 Nov 28  2019 UPGRADE
drwxr-xr-x  6 fhem dialout   4096 Nov 28  2019 webfrontend
drwxrwxrwx  8 fhem dialout   4096 Mär 11  2017 www


dominik

Ok, die Installation dürfte jetzt passen.

Bitte jetzt nochmals "status" abfragen und dazwischen über die App den Saugroboter bewegen um sicherzustellen, dass die Readings überhaupt aktualisiert werden.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Stelaku

Hallo Dominik

Wenn ich jetzt über Fhem oder über die app die Befehle wie z.b. starten pause stop home ausführe werden die readings immer neu geschrieben. Der set status funktioniert ohne Probleme.
Nur wenn ich jetzt den Sauger z.b. per app über die Fernbedinung fahre was ja set  <dev> move ... aus Fhem endspricht und dann ein set status mache werden die readings nicht mehr aktualliesiert und die Meldung wird angezeigt mit den log Einträgen.
der set status funktioniert dann auch erst wieder wenn ich über Fhem einen von diesen Befehlen ausführe home start stop oder pause.

Gruß

Stephan

dominik

Auch wenn du nur über die App navigierst und danach status machst kommt der Fehler?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Stelaku

Das ist Richtig der Fehler kommt auch wenn ich nur über die App navigiere.
Und erst wenn ich über Fhem einen der Hauptbefehle wie start stop pause home mache geht der set status Befehl wieder.


dominik

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?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

dominik

Ich habe gerade eine größere Anpassung an fhempy eingecheckt. Bitte vor den weiteren Tests ein Update durchführen.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Stelaku

Hallo Dominik

update gerade durchgeführt. wurde wie es aussieht abgebrochen und jetzt steht BindingIO auf disconnect.

2020.12.09 22:34:52 1 : pythonbinding
2020.12.09 22:34:52 1 : UPD FHEM/10_PythonBinding.pm
2020.12.09 22:34:52 1 : UPD FHEM/10_BindingsIo.pm
2020.12.09 22:34:52 1 : UPD FHEM/10_PythonModule.pm
2020.12.09 22:34:52 1 : UPD FHEM/bindings/python/fhempy
2020.12.09 22:34:52 1 : Got 14 bytes for FHEM/bindings/python/fhempy, expected 4096
2020.12.09 22:34:52 1 : aborting.
2020.12.09 22:34:52 3 : aktion_nach_update return value: -1
2020-12-09 22:34:52 Global global UPDATE
2020.12.09 22:35:01 3 : Pythonbinding_0: starting
2020.12.09 22:35:01 3 : Pythonbinding_0: using logfile: ./log/PythonBinding-2020-12-09.log
2020.12.09 22:35:01 3 : Pythonbinding_0: read: end of file reached while sysread
2020.12.09 22:35:01 3 : Pythonbinding_0: stopped
2020.12.09 22:35:11 1 : BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Verbindungsaufbau abgelehnt (111)
2020.12.09 22:35:21 3 : Pythonbinding_0: starting
2020.12.09 22:35:21 3 : Pythonbinding_0: using logfile: ./log/PythonBinding-2020-12-09.log
2020.12.09 22:35:21 3 : Pythonbinding_0: read: end of file reached while sysread
2020.12.09 22:35:21 3 : Pythonbinding_0: stopped
2020.12.09 22:35:22 1 : BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Verbindungsaufbau abgelehnt (111)
2020.12.09 22:35:32 1 : BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Verbindungsaufbau abgelehnt (111)
2020.12.09 22:35:41 3 : Pythonbinding_0: starting
2020.12.09 22:35:41 3 : Pythonbinding_0: using logfile: ./log/PythonBinding-2020-12-09.log
2020.12.09 22:35:41 3 : Pythonbinding_0: read: end of file reached while sysread
2020.12.09 22:35:41 3 : Pythonbinding_0: stopped
2020.12.09 22:35:43 1 : BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Verbindungsaufbau abgelehnt (111)
2020.12.09 22:35:53 1 : BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Verbindungsaufbau abgelehnt (111)


Im log /log/PythonBinding-2020-12-09.log steht nichts für diese Zeiten drin es wird nicht beschrieben.
Letzte Zeitstempel 22:26 Uhr
Gruß

Stephan

dominik

#74
Ok, da dürfte dann doch noch ein Fehler im controls file sein. Habe in einem anderen Thread die gleiche Rückmeldung.

Kannst du bitte mal ein
sudo rm -f /opt/fhem/FHEM/bindings/python/fhempy
machen und danach nochmals ein update.

//Edit: Fehler gefunden, bin am Beheben.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik