fhempy: Tuya Cloud

Begonnen von dominik, 30 Juli 2021, 21:36:48

Vorheriges Thema - Nächstes Thema

dominik

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

McShire

Noch im Nachtrag Einträge (immer wiederholend) im Logfile:


2023.02.05 22:01:35 3: fhempyserver_15733: read: end of file reached while sysread
2023.02.05 22:01:35 3: fhempyserver_15733: stopped
2023.02.05 22:01:35 3: fhempyserver_15733: starting
2023.02.05 22:01:35 3: fhempyserver_15733: using logfile: ./log/fhempy-2023-02-05.log


und dem fhempy-log:


WARNING: You are using pip version 22.0.4; however, version 23.0 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
2023-02-05 18:17:16,600 - ERROR    - __main__: Failed to install fhempy, exit now...
2023-02-05 18:18:17,108 - ERROR    - __main__: Failed to load fhempy
Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/bin/fhempy", line 139, in <module>
    import fhempy.lib.fhem_pythonbinding as fpb
ModuleNotFoundError: No module named 'fhempy'
2023-02-05 18:18:17,110 - INFO     - __main__: Attempting install of fhempy>=0.1.462
2023-02-05 18:19:44,777 - ERROR    - __main__: Unable to install package fhempy>=0.1.462: WARNING: The directory '/opt/fhem/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
ERROR: Could not install packages due to an OSError: [Errno 13] Keine Berechtigung: '/opt/fhem/.local'
Check the permissions.



die Verzeichnisse von /opt/fhem/.local und /opt/fhem/.cache gibt es im Verzeichnis /opt/fhem nicht nur /opt/fhem/cache, das scheint aber nicht das Richtige zu sein.

und das Ergebnis vom nicht funktionierendem pip Update im Anhang.






McShire

Die Berechtigung von /opt/fhem habe ich jetzt auf 777 gestellt

dominik

Du musst die Berechtigung von /opt/fhem/.local fixen.

chown -R fhem:dialout /opt/fhem

Dann sollte alles wieder richtig sein von den Berechtigungen.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

McShire

jetzt hat sich etwas geändert, das logo ist gelb, mal 15 min auf installation warten

McShire

danke für den Tip mit der Berechtigung.
Es tut sich was

2023-02-05 22:40:45,502 - INFO     - __main__: Attempting install of fhempy>=0.1.462
2023-02-05 22:42:44,281 - INFO     - __main__: Successfully installed fhempy>=0.1.462
2023-02-05 22:42:44,283 - ERROR    - __main__: Failed to import fhempy, exit now...
2023-02-05 22:43:48,270 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.593...
2023-02-05 22:43:48,378 - INFO     - fhempy.lib.pkg_installer: Attempting install of async-upnp-client==0.31.2
2023-02-05 22:44:05,194 - INFO     - fhempy.lib.pkg_installer: Successfully installed async-upnp-client==0.31.2 update!
2023-02-05 22:44:05,198 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2023-02-05 22:44:05,313 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2023-02-05 22:45:40,640 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.593...
2023-02-05 22:45:40,653 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2023-02-05 22:45:40,821 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2023-02-05 22:45:48,315 - INFO     - websockets.server: connection open
2023-02-05 22:45:48,317 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1



McShire

Zitat von: dominik am 05 Februar 2023, 22:45:10
Du musst die Berechtigung von /opt/fhem/.local fixen.

chown -R fhem:dialout /opt/fhem

Dann sollte alles wieder richtig sein von den Berechtigungen.

Eine Datei .local gibt es nicht im fhem-Verzeichnis

McShire

Zitat von: dominik am 05 Februar 2023, 22:45:10
Du musst die Berechtigung von /opt/fhem/.local fixen.

chown -R fhem:dialout /opt/fhem

Dann sollte alles wieder richtig sein von den Berechtigungen.

Ist das korrekt? Jetzt haben alle Dateien und Verzeichnisse unter /opt/fhem den Eigentümer dialout.

McShire

Hallo Dominik,
wenn ich es richtig sehe, ist jetzt alles ok. Siehe Logfile vom Server


2023-02-05 23:31:17,345 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.593...
2023-02-05 23:31:17,356 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2023-02-05 23:31:17,506 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2023-02-05 23:31:23,325 - INFO     - websockets.server: connection open
2023-02-05 23:31:23,327 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1


Vielen Dank für deine Hilfe.
Jetzt werde ich in den nächsten Tagen mein erstes Gerät über die Tuya Platform einbinden.

Viele Grüße
Werner

McShire

#864
Hallo Dominik,

jetzt habe ich den tuya_cloud_connector definiert.
Hier das list


Internals:
   DEF        tuya_cloud setup 5xxxxxxxxfget e1ecxxxxxxxxxxxxebe12 werxxxxxxxxxxxxxxe Kixxxxxxx0 Tuya Smart Europe
   DEVICEID   0
   FHEMPYTYPE tuya_cloud
   FUUID      63e0bad4-f33f-f21b-ccbc-281354202aeb0756
   IODev      fhempy_local
   NAME       tuya_cloud_connector
   NR         1017
   PYTHONTYPE tuya_cloud
   STATE      connecting
   TYPE       fhempy
   eventCount 11
   READINGS:
     2023-02-06 15:50:00   state           connecting
   args:
     tuya_cloud_connector
     fhempy
     tuya_cloud
     setup
     5xmxxxxxxxxxxxxxget
     e1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxe12
     wernxxxxxxxxxxxxxxxxxde
     Kixxxxxxxxxxx0
     Tuya
     Smart
     Europe
   argsh:
Attributes:
   group      tuya_cloud
   room       fhempy


was mir auffällt:
- state ist connecting, nicht connected, die Login Daten stimmen sonst kommt eine
  Fehlermeldung
- Es wird kein device gemäß meines Projektes in der tuya_development_Platform
  angelegt

Das Projekt:
Kesser Oil Radiator


Kesser Oil Radiator
Integration of the Radiator into the smart home environment fhem
Industry : Smart Home
Creation Time : 2023-01-20 22:03:43
Data Center : Central Europe Data Center
Authorization Key
Access ID/Client ID: 5xxxxxxxxxget
Access Secret/Client Secret: exxxxxxxxxxxxxxxxxxxxxxxxxxbe12
Project Code: p16xxxxxxxxxxxxxxxxxxkv9
Cloud Authorization IP AllowlistConfigure
Central Europe Data Center:1 IP(s) addedView



Was kann ich tun, damit der Radiator angelegt wird?

Viele Grüße
Werner

McShire

Die letzten Einträge im Server log:


packages/fhempy/lib/generic.py:194> exception=TypeError("unsupported operand type(s) for +: 'NoneType' and 'str'")>
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/generic.py", line 202, in _handle_task_result
    task.result()
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/generic.py", line 196, in _run_coro
    await coro
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/tuya_cloud/tuya_cloud_setup.py", line 58, in run_setup
    if await self._init_tuya_sdk() is True:
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/tuya_cloud/tuya_cloud_setup.py", line 106, in _init_tuya_sdk
    else await utils.run_blocking(
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/utils.py", line 72, in run_blocking
    return await asyncio.get_event_loop().run_in_executor(pool, function)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/opt/fhem/.local/lib/python3.9/site-packages/tuya_iot/openapi.py", line 208, in connect
    response = self.post(
  File "/opt/fhem/.local/lib/python3.9/site-packages/tuya_iot/openapi.py", line 316, in post
    return self.__request("POST", path, None, body)
  File "/opt/fhem/.local/lib/python3.9/site-packages/tuya_iot/openapi.py", line 260, in __request
    url = {self.endpoint + path},\
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'


McShire

und das Logfile nach shutdown restart:


2023-02-06 18:21:33,055 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.593...
2023-02-06 18:21:33,066 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2023-02-06 18:21:39,824 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2023-02-06 18:21:39,879 - DEBUG    - fhempy.lib.fhem: <<< WS: {"msgtype": "version", "version": "0.1.593", "python": "3.9.16", "os": "posix", "system": "Linux", "release": "5.15.84-v7+", "hostname": "raspi3B"}
2023-02-06 18:21:39,978 - DEBUG    - fhempy.lib.fhem_pythonbinding: >>> 60881822: {'PYTHONTYPE': 'tuya_cloud', 'function': 'Define', 'FHEMPYTYPE': 'tuya_cloud', 'defargsh': {}, 'NAME': 'tuya_cloud_connector', 'argsh': {}, 'id': '60881822', 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxget', 'e1xxxxxxxxxxxxxxxxxx2', 'werxxxxxxxxxx.de', 'Kixxxxxxx0', 'Tuya', 'Smart', 'Europe'], 'msgtype': 'function', 'args': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxfget', 'e1xxxxxxxxxxxxxxxe12', 'werner.schwetje@t-online.de', 'Kixxxxxxxxx70', 'Tuya', 'Smart', 'Europe']}
2023-02-06 18:21:39,979 - DEBUG    - fhempy.lib.fhem_pythonbinding: <<< 60881822 1.15ms: {'PYTHONTYPE': 'tuya_cloud', 'function': 'Define', 'FHEMPYTYPE': 'tuya_cloud', 'defargsh': {}, 'NAME': 'tuya_cloud_connector', 'argsh': {}, 'id': '60881822', 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xmxxxxxxxxxxxfget', 'e1xxxxxxxxxxxxxe12', 'wernxxxxxxxxxxxxxxne.de', 'Kisxxxxxxxxxxxxxx0', 'Tuya', 'Smart', 'Europe'], 'msgtype': 'function', 'args': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxxxxxet', 'exxxxxxxxxxxxxxxxxxxxbe12', 'werxxxxxxxxxxxxxxxxxxxde', 'Kisxxxxxxxxxxxxxxx0', 'Tuya', 'Smart', 'Europe'], 'finished': 1, 'returnval': ''}
2023-02-06 18:21:40,375 - WARNING  - asyncio: Executing <Task pending name='Task-11' coro=<send_latest_release() running at /opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/fhem.py:311> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x74f2d190>()] created at /usr/local/lib/python3.9/asyncio/base_events.py:429> created at /usr/local/lib/python3.9/asyncio/tasks.py:361> took 0.154 seconds
2023-02-06 18:21:40,401 - DEBUG    - fhempy.lib.fhem_pythonbinding: >>> 50102601: {'args': ['tuya_cloud_connector', '?'], 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxxt', 'exxxxxxxxxxxxxxxxxxe12', 'wexxxxxxxxxxxxxxxxxxxxe', 'Kixxxxxxxxxxxxxxxxx0', 'Tuya', 'Smart', 'Europe'], 'msgtype': 'function', 'NAME': 'tuya_cloud_connector', 'argsh': {}, 'id': '50102601', 'FHEMPYTYPE': 'tuya_cloud', 'function': 'Set', 'defargsh': {}, 'PYTHONTYPE': 'tuya_cloud'}
2023-02-06 18:21:40,404 - DEBUG    - fhempy.lib.fhem_pythonbinding: <<< 50102601 3.54ms: {'args': ['tuya_cloud_connector', '?'], 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxxxxget', 'e1xxxxxxxxxxxxxxxxxxxxxxxxxe12', 'werxxxxxxxxxxxxxxxxxxxxxxe', 'Kixxxxxxxxxxxxxxxx0', 'Tuya', 'Smart', 'Europe'], 'msgtype': 'function', 'NAME': 'tuya_cloud_connector', 'argsh': {}, 'id': '50102601', 'FHEMPYTYPE': 'tuya_cloud', 'function': 'Set', 'defargsh': {}, 'PYTHONTYPE': 'tuya_cloud', 'finished': 1, 'returnval': ''}
2023-02-06 18:21:40,469 - DEBUG    - fhempy.lib.fhem: <<< WS: {"msgtype": "version", "version_available": "0.1.593", "version_release_notes": "<html><a href=\"https://github.com/fhempy/fhempy/releases\" target=\"_blank\">Release Notes</a></html>"}
2023-02-06 18:21:41,364 - DEBUG    - fhempy.lib.core.discover_fhempy.discover_fhempy: Found service: _http._tcp.local. - Brother MFC-J5625DW._http._tcp.local.
2023-02-06 18:21:41,365 - DEBUG    - fhempy.lib.core.discover_fhempy.discover_fhempy: Service Brother MFC-J5625DW._http._tcp.local. found, service info: AsyncServiceInfo(type='_http._tcp.local.', name='Brother MFC-J5625DW._http._tcp.local.', addresses=[b'\xc0\xa8\xb2 '], port=80, weight=0, priority=0, server='BRWB01041AE0F5D.local.', properties={}, interface_index=None)
2023-02-06 18:21:41,770 - DEBUG    - fhempy.lib.fhem: <<< 88384148: {'awaitId': 88384148, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "AttrVal('tuya_cloud_connector', 'verbose', '3')"}
2023-02-06 18:21:41,783 - DEBUG    - fhempy.lib.fhem: >>> 88384148 12.70ms: {'error': 0, 'awaitId': 88384148, 'result': '3'}
2023-02-06 18:21:41,810 - DEBUG    - fhempy.lib.fhem: <<< 34482423: {'awaitId': 34482423, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': '$init_done'}
2023-02-06 18:21:41,908 - DEBUG    - fhempy.lib.fhem: >>> 34482423 98.66ms: {'error': 0, 'awaitId': 34482423, 'result': 1}
2023-02-06 18:21:41,919 - DEBUG    - fhempy.lib.fhem: <<< 78437842: {'awaitId': 78437842, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "AttrVal('tuya_cloud_connector', 'room', '')"}
2023-02-06 18:21:41,932 - DEBUG    - fhempy.lib.fhem: >>> 78437842 13.07ms: {'result': 'fhempy', 'awaitId': 78437842, 'error': 0}
2023-02-06 18:21:41,943 - DEBUG    - fhempy.lib.fhem: <<< 83773436: {'awaitId': 83773436, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "AttrVal('tuya_cloud_connector', 'group', '')"}
2023-02-06 18:21:41,956 - DEBUG    - fhempy.lib.fhem: >>> 83773436 13.13ms: {'error': 0, 'awaitId': 83773436, 'result': 'tuya_cloud'}
2023-02-06 18:21:42,103 - DEBUG    - fhempy.lib.fhem: <<< 79257858: {'awaitId': 79257858, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "setDevAttrList('tuya_cloud_connector', ' IODev '.$readingFnAttributes)"}
2023-02-06 18:21:42,460 - DEBUG    - fhempy.lib.fhem: >>> 79257858 357.40ms: {'result': ' IODev:fhempy_local event-aggregator event-min-interval event-on-change-reading event-on-update-reading oldreadings stateFormat:textField-long timestamp-on-change-reading', 'awaitId': 79257858, 'error': 0}
2023-02-06 18:21:42,471 - DEBUG    - fhempy.lib.fhem: <<< 79393227: {'awaitId': 79393227, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "AttrVal('tuya_cloud_connector', 'verbose', '3')"}
2023-02-06 18:21:43,219 - DEBUG    - fhempy.lib.fhem: >>> 79393227 748.61ms: {'result': '3', 'awaitId': 79393227, 'error': 0}
2023-02-06 18:21:43,235 - DEBUG    - fhempy.lib.fhem: <<< 81640974: {'awaitId': 81640974, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "readingsSingleUpdate($defs{'tuya_cloud_connector'},'state','connecting',1)"}
2023-02-06 18:21:43,238 - DEBUG    - fhempy.lib.fhem_pythonbinding: <<< WS: {"PYTHONTYPE": "tuya_cloud", "function": "Define", "FHEMPYTYPE": "tuya_cloud", "defargsh": {}, "NAME": "tuya_cloud_connector", "argsh": {}, "defargs": ["tuya_cloud_connector", "fhempy", "tuya_cloud", "setup", "5xxxxxxxxxxxxxxxxxxxet", "e1xxxxxxxxxxxxxxxxxxxxxxxxxxx12", "werxxxxxxxxxxxxxxxxe", "Kixxxxxxxxxxxxxxxxxx70", "Tuya", "Smart", "Europe"], "msgtype": "update_hash", "args": ["tuya_cloud_connector", "fhempy", "tuya_cloud", "setup", "5xxxxxxxxxxxxxxxxxxet", "e1xxxxxxxxxxxxxxxxxxxxxxxxx12", "wxxxxxxxxxxxxxxxxe", "Kixxxxxxxxxxxxxxxxx0", "Tuya", "Smart", "Europe"], "DEVICEID": 0}
2023-02-06 18:21:43,420 - DEBUG    - fhempy.lib.fhem_pythonbinding: >>> 14613249: {'FHEMPYTYPE': 'tuya_cloud', 'function': 'Set', 'defargsh': {}, 'PYTHONTYPE': 'tuya_cloud', 'args': ['tuya_cloud_connector', '?'], 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxxxxxxt', 'e1xxxxxxxxxxxxxxxxx12', 'wxxxxxxxxxxxxxxxxxxxxxxe', 'Kixxxxxxxxxxxxxxxx0', 'Tuya', 'Smart', 'Europe'], 'msgtype': 'function', 'NAME': 'tuya_cloud_connector', 'argsh': {}, 'id': '14613249'}
2023-02-06 18:21:43,429 - DEBUG    - fhempy.lib.fhem_pythonbinding: <<< 14613249 8.77ms: {'FHEMPYTYPE': 'tuya_cloud', 'function': 'Set', 'defargsh': {}, 'PYTHONTYPE': 'tuya_cloud', 'args': ['tuya_cloud_connector', '?'], 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxxxxxxxxxet', 'exxxxxxxxxxxxxxxxxx12', 'wxxxxxxxxxxxxxxxxxxxxe', 'Kixxxxxxxxxxxxxxxxxx', 'Tuya', 'Smart', 'Europe'], 'msgtype': 'function', 'NAME': 'tuya_cloud_connector', 'argsh': {}, 'id': '14613249', 'finished': 1, 'returnval': 'Unknown argument ?, choose one of '}
2023-02-06 18:21:43,441 - DEBUG    - fhempy.lib.fhem: >>> 81640974 206.01ms: {'error': 0, 'result': 'connecting', 'awaitId': 81640974}
2023-02-06 18:21:43,456 - ERROR    - tuya_cloud_connector: Exception raised by task: <Task finished name='Task-30' coro=<FhemModule._run_coro() done, defined at /opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/generic.py:194> exception=TypeError("unsupported operand type(s) for +: 'NoneType' and 'str'") created at /usr/local/lib/python3.9/asyncio/tasks.py:361>
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/generic.py", line 202, in _handle_task_result
    task.result()
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/generic.py", line 196, in _run_coro
    await coro
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/tuya_cloud/tuya_cloud_setup.py", line 58, in run_setup
    if await self._init_tuya_sdk() is True:
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/tuya_cloud/tuya_cloud_setup.py", line 106, in _init_tuya_sdk
    else await utils.run_blocking(
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/utils.py", line 72, in run_blocking
    return await asyncio.get_event_loop().run_in_executor(pool, function)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/opt/fhem/.local/lib/python3.9/site-packages/tuya_iot/openapi.py", line 208, in connect
    response = self.post(
  File "/opt/fhem/.local/lib/python3.9/site-packages/tuya_iot/openapi.py", line 316, in post
    return self.__request("POST", path, None, body)
  File "/opt/fhem/.local/lib/python3.9/site-packages/tuya_iot/openapi.py", line 260, in __request
    url = {self.endpoint + path},\
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'


dominik

Dein Define ist falsch:
define tuya_cloud_connector fhempy tuya_cloud setup <CLIENT_ID> <CLIENT_SECRET> <USERNAME> <PASSWORD> [<APPTYPE>] [<REGION>]

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

McShire

tuyaSmart hat er nicht akzeptiert TuyaSmart und andere Variationen auch nicht nur Tuya Smart, so heißt die App auch

McShire

#869
Hallo Dominik,

Das Ist das Ergebnis, wenn ich tuyaSmart oder die anderen Varianten einsetze.

tuya_cloud
tuya_cloud_connector
failed to login: {'code': 1106, 'msg': 'permission deny', 'success': False, 't': 1675711982082, 'tid': '11d23659a65511edae3d265fe02d1603'}

und das Ergebnis bei Tuya Smart:
Readings
state
connecting
2023-02-06 21:10:48

Ich habe jetzt ziemlich alles durchprobiert, nur bei Tuya Smart und (Tuya Smart) wird das Reading state connecting.
Dabei sieht der Server Tuya Smart oder (Tuya Smart) als 2 Parameter an, im Logfile steht dann xxx' , '(Tuya' , 'Smart) ', 'Europe

Wie kann ich dem Server beibringen das Tuya Smart ein Parameter/String ist, in Hochkomma setzen funktioniert leider auch nicht.
Oder wie kann man dem Tuya Server sagen, dass er tuyaSmart als den Namen der App versteht?

Das login und der state connecting funktionieren immer nur, wenn die Tuya und Smart getrennt sind, aber im Log werden sie dann immer als 2 Parameter aufgeführt.

Wenn ich "Tuya Smart" schreibe, steht im Log xxx0", "Tuya", "Smart", "Europe"] und im state failed to login
Bei allen anderen Zeichen ''Tuya Smart'' (2x Hochkomma) oder (Tuya Smart) usw steht im Log xxxxx0', 'Tuya', 'Smart', 'Europe']
oder xxxx0', '(Tuya', 'Smart)', 'Europe'] usw.
Bei 'Tuya Smart' wird im Log der Parameter richtig dargestellt xxxxx0', 'Tuya Smart', 'Europe'] , aber dann Fehlermeldung und kein login und kein conncting, weil es dann vermutlich so wie du es geschrieben hast tuyaSmart im log heißen muss.

Bei tuyaSmart steht imLogfile das Argument xxxxx0', 'tuyaSmart', 'Europe'], aber failed to login und kein connecting.

Da komme ich ohne deine Hilfe nicht mehr weiter.

Hier ist noch einmal der vollständige Log-Eintrag für tuyaSmart


2023-02-06 22:59:57,576 - DEBUG    - fhempy.lib.fhem_pythonbinding: >>> 11008797: {'function': 'Define', 'msgtype': 'function', 'NAME': 'tuya_cloud_connector', 'args': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxet', 'exxxxxxxxxxxxxxx2', 'werner.schwetje@t-online.de', 'Kxxxxxxxxxxxxxxx0', 'tuyaSmart', 'Europe'], 'defargsh': {}, 'FHEMPYTYPE': 'tuya_cloud', 'PYTHONTYPE': 'tuya_cloud', 'argsh': {}, 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxxt', 'exxxxxxxxxxxxxe12', 'wxxxxxxxxxxxxxde', 'Kxxxxxxxxxxxxx0', 'tuyaSmart', 'Europe'], 'id': '11008797'}
2023-02-06 22:59:57,585 - DEBUG    - fhempy.lib.fhem_pythonbinding: <<< 11008797 8.76ms: {'function': 'Define', 'msgtype': 'function', 'NAME': 'tuya_cloud_connector', 'args': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxet', 'e1xxxxxxxxxxxxx12', 'werxxxxxxxxxxxxxe', 'Kxxxxxxxxxxxxx0', 'tuyaSmart', 'Europe'], 'defargsh': {}, 'FHEMPYTYPE': 'tuya_cloud', 'PYTHONTYPE': 'tuya_cloud', 'argsh': {}, 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxeget', 'exxxxxxxxxxxxx12', 'wxxxxxxxxxxxxxee', 'Kxxxxxxxxxxxxxe0', 'tuyaSmart', 'Europe'], 'id': '11008797', 'finished': 1, 'returnval': ''}
2023-02-06 22:59:57,617 - DEBUG    - fhempy.lib.fhem_pythonbinding: >>> 80410359: {'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xmvn7d9yt9crdfwfget', 'e1xxxxxxxxxxxxxee12', 'wxxxxxxxxxxxxxxee', 'Kxxxxxxxxxxxxxe70', 'tuyaSmart', 'Europe'], 'id': '80410359', 'argsh': {}, 'PYTHONTYPE': 'tuya_cloud', 'FHEMPYTYPE': 'tuya_cloud', 'defargsh': {}, 'args': ['tuya_cloud_connector', '?'], 'NAME': 'tuya_cloud_connector', 'function': 'Set', 'msgtype': 'function'}
2023-02-06 22:59:57,622 - DEBUG    - fhempy.lib.fhem_pythonbinding: <<< 80410359 4.73ms: {'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxxeet', 'e1xxxxxxxxxxxxxe12', 'xxxxxxxxxxxxxee', 'xxxxxxxxxxxxxe0', 'tuyaSmart', 'Europe'], 'id': '80410359', 'argsh': {}, 'PYTHONTYPE': 'tuya_cloud', 'FHEMPYTYPE': 'tuya_cloud', 'defargsh': {}, 'args': ['tuya_cloud_connector', '?'], 'NAME': 'tuya_cloud_connector', 'function': 'Set', 'msgtype': 'function', 'finished': 1, 'returnval': ''}
2023-02-06 22:59:57,644 - DEBUG    - fhempy.lib.fhem: <<< 89171413: {'awaitId': 89171413, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "AttrVal('tuya_cloud_connector', 'verbose', '3')"}
2023-02-06 22:59:57,657 - DEBUG    - fhempy.lib.fhem: >>> 89171413 13.42ms: {'error': 0, 'awaitId': 89171413, 'result': '3'}
2023-02-06 22:59:57,671 - DEBUG    - fhempy.lib.fhem: <<< 80742028: {'awaitId': 80742028, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': '$init_done'}
2023-02-06 22:59:57,685 - DEBUG    - fhempy.lib.fhem: >>> 80742028 13.15ms: {'awaitId': 80742028, 'error': 0, 'result': 1}
2023-02-06 22:59:57,695 - DEBUG    - fhempy.lib.fhem: <<< 82745635: {'awaitId': 82745635, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "AttrVal('tuya_cloud_connector', 'room', '')"}
2023-02-06 22:59:57,709 - DEBUG    - fhempy.lib.fhem: >>> 82745635 13.35ms: {'result': 'fhempy', 'awaitId': 82745635, 'error': 0}
2023-02-06 22:59:57,719 - DEBUG    - fhempy.lib.fhem: <<< 22455893: {'awaitId': 22455893, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "AttrVal('tuya_cloud_connector', 'group', '')"}
2023-02-06 22:59:57,732 - DEBUG    - fhempy.lib.fhem: >>> 22455893 13.35ms: {'awaitId': 22455893, 'error': 0, 'result': 'tuya_cloud'}
2023-02-06 22:59:57,804 - DEBUG    - fhempy.lib.fhem: <<< 52560252: {'awaitId': 52560252, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "setDevAttrList('tuya_cloud_connector', ' IODev '.$readingFnAttributes)"}
2023-02-06 22:59:57,821 - DEBUG    - fhempy.lib.fhem: >>> 52560252 16.81ms: {'awaitId': 52560252, 'error': 0, 'result': ' IODev:fhempy_local event-aggregator event-min-interval event-on-change-reading event-on-update-reading oldreadings stateFormat:textField-long timestamp-on-change-reading'}
2023-02-06 22:59:57,831 - DEBUG    - fhempy.lib.fhem: <<< 88782319: {'awaitId': 88782319, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "AttrVal('tuya_cloud_connector', 'verbose', '3')"}
2023-02-06 22:59:57,844 - DEBUG    - fhempy.lib.fhem: >>> 88782319 13.08ms: {'awaitId': 88782319, 'error': 0, 'result': '3'}
2023-02-06 22:59:57,859 - DEBUG    - fhempy.lib.fhem: <<< 85258269: {'awaitId': 85258269, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "readingsSingleUpdate($defs{'tuya_cloud_connector'},'state','connecting',1)"}
2023-02-06 22:59:57,861 - DEBUG    - fhempy.lib.fhem_pythonbinding: <<< WS: {"function": "Define", "msgtype": "update_hash", "NAME": "tuya_cloud_connector", "args": ["tuya_cloud_connector", "fhempy", "tuya_cloud", "setup", "5xxxxxxxxxxxxxeget", "e1xxxxxxxxxxxxxe12", "wxxxxxxxxxxxxxee", "Kxxxxxxxxxxxxxe0", "tuyaSmart", "Europe"], "defargsh": {}, "FHEMPYTYPE": "tuya_cloud", "PYTHONTYPE": "tuya_cloud", "argsh": {}, "defargs": ["tuya_cloud_connector", "fhempy", "tuya_cloud", "setup", "5xxxxxxxxxxxxxeet", "e1xxxxxxxxxxxxxe12", "wxxxxxxxxxxxxxee", "Kixxxxxxxxxxxxxe0", "tuyaSmart", "Europe"], "DEVICEID": 0}
2023-02-06 22:59:57,880 - DEBUG    - fhempy.lib.fhem_pythonbinding: >>> 49718475: {'PYTHONTYPE': 'tuya_cloud', 'FHEMPYTYPE': 'tuya_cloud', 'defargsh': {}, 'args': ['tuya_cloud_connector', '?'], 'id': '49718475', 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxxet', 'exxxxxxxxxxxxxe2', 'wxxxxxxxxxxxxxee', 'Kixxxxxxxxxxxxxe', 'tuyaSmart', 'Europe'], 'argsh': {}, 'msgtype': 'function', 'function': 'Set', 'NAME': 'tuya_cloud_connector'}
2023-02-06 22:59:57,889 - DEBUG    - fhempy.lib.fhem_pythonbinding: <<< 49718475 8.73ms: {'PYTHONTYPE': 'tuya_cloud', 'FHEMPYTYPE': 'tuya_cloud', 'defargsh': {}, 'args': ['tuya_cloud_connector', '?'], 'id': '49718475', 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xmvn7d9yt9crdfwfget', 'e1eca018ed9a415caa693cbe305ebe12', 'werner.schwetje@t-online.de', 'Kis$IW$1970', 'tuyaSmart', 'Europe'], 'argsh': {}, 'msgtype': 'function', 'function': 'Set', 'NAME': 'tuya_cloud_connector', 'finished': 1, 'returnval': 'Unknown argument ?, choose one of '}
2023-02-06 22:59:57,902 - DEBUG    - fhempy.lib.fhem: >>> 85258269 43.15ms: {'error': 0, 'awaitId': 85258269, 'result': 'connecting'}
2023-02-06 22:59:57,922 - DEBUG    - urllib3.connectionpool: Starting new HTTPS connection (1): openapi.tuyaeu.com:443
2023-02-06 22:59:58,256 - DEBUG    - urllib3.connectionpool: https://openapi.tuyaeu.com:443 "POST /v1.0/iot-01/associated-users/actions/authorized-login HTTP/1.1" 200 112
2023-02-06 22:59:58,268 - DEBUG    - fhempy.lib.fhem: <<< 83822785: {'awaitId': 83822785, 'NAME': 'tuya_cloud_connector', 'msgtype': 'command', 'command': "readingsSingleUpdate($defs{'tuya_cloud_connector'},'state','failed to login: {\\'code\\': 1106, \\'msg\\': \\'permission deny\\', \\'success\\': False, \\'t\\': 1675720798234, \\'tid\\': \\'98af4d4ca66911ed97b7f276006a160b\\'}',1)"}
2023-02-06 22:59:58,288 - DEBUG    - fhempy.lib.fhem_pythonbinding: >>> 50533045: {'args': ['tuya_cloud_connector', '?'], 'defargsh': {}, 'FHEMPYTYPE': 'tuya_cloud', 'PYTHONTYPE': 'tuya_cloud', 'argsh': {}, 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxeet', 'exxxxxxxxxxxxxe2', 'wxxxxxxxxxxxxxee', 'Kxxxxxxxxxxxxxe0', 'tuyaSmart', 'Europe'], 'id': '50533045', 'function': 'Set', 'msgtype': 'function', 'NAME': 'tuya_cloud_connector'}
2023-02-06 22:59:58,296 - DEBUG    - fhempy.lib.fhem_pythonbinding: <<< 50533045 8.59ms: {'args': ['tuya_cloud_connector', '?'], 'defargsh': {}, 'FHEMPYTYPE': 'tuya_cloud', 'PYTHONTYPE': 'tuya_cloud', 'argsh': {}, 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxeet', 'e1xxxxxxxxxxxxxe12', 'wxxxxxxxxxxxxxe', 'Kxxxxxxxxxxxxxe0', 'tuyaSmart', 'Europe'], 'id': '50533045', 'function': 'Set', 'msgtype': 'function', 'NAME': 'tuya_cloud_connector', 'finished': 1, 'returnval': 'Unknown argument ?, choose one of '}
2023-02-06 22:59:58,310 - DEBUG    - fhempy.lib.fhem: >>> 83822785 41.57ms: {'result': "failed to login: {'code': 1106, 'msg': 'permission deny', 'success': False, 't': 1675720798234, 'tid': '98af4d4ca66911ed97b7f276006a160b'}", 'awaitId': 83822785, 'error': 0}
2023-02-06 22:59:58,317 - ERROR    - tuya_cloud_connector: Tuya login error response: {'code': 1106, 'msg': 'permission deny', 'success': False, 't': 1675720798234, 'tid': '98af4d4ca66911ed97b7f276006a160b'}
2023-02-06 23:00:21,342 - DEBUG    - fhempy.lib.fhem_pythonbinding: >>> 28827027: {'args': ['tuya_cloud_connector', '?'], 'defargsh': {}, 'FHEMPYTYPE': 'tuya_cloud', 'PYTHONTYPE': 'tuya_cloud', 'argsh': {}, 'id': '28827027', 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxet', 'exxxxxxxxxxxxxe2', 'wxxxxxxxxxxxxxede', 'Kixxxxxxxxxxxxxe70', 'tuyaSmart', 'Europe'], 'msgtype': 'function', 'function': 'Set', 'NAME': 'tuya_cloud_connector'}
2023-02-06 23:00:21,351 - DEBUG    - fhempy.lib.fhem_pythonbinding: <<< 28827027 8.65ms: {'args': ['tuya_cloud_connector', '?'], 'defargsh': {}, 'FHEMPYTYPE': 'tuya_cloud', 'PYTHONTYPE': 'tuya_cloud', 'argsh': {}, 'id': '28827027', 'defargs': ['tuya_cloud_connector', 'fhempy', 'tuya_cloud', 'setup', '5xxxxxxxxxxxxxeet', 'exxxxxxxxxxxxxe12', 'wxxxxxxxxxxxxxee', 'Kixxxxxxxxxxxxxe0', 'tuyaSmart', 'Europe'], 'msgtype': 'function', 'function': 'Set', 'NAME': 'tuya_cloud_connector', 'finished': 1, 'returnval': 'Unknown argument ?, choose one of '}



Viele Grüße
Werner