fhempy: tuya (lokal)

Begonnen von dominik, 26 April 2022, 19:12:25

Vorheriges Thema - Nächstes Thema

satprofi

Zitat von: dominik am 16 Juli 2022, 10:59:37
...und der letzte Parameter darf nicht der Devicename sein, sonder die Device ID.

Toll, jetzt ist auch das weg nach scandevice.........
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

dominik

Verstehe ich nicht ganz was du damit meinst? Bitte ein bisschen mehr Infos.
Wenn's für dich ok ist, kannst du mir per PN den Developer Login von der TuYa Plattform schicken, dann schau ich mir das an. Ich denke so kommen wir am schnellsten zum Ziel.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

satprofi

du hast PN. Vielleicht klappts ja bei dir.

Ich habe die device id angegeben, und nach dem scan ist jetzt das device verschwunden in fhem.
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

satprofi

Hallo!
Gute neuigkeiten. Habe jetzt tuya_system gelöscht, neu angelegt, und siehe da er findet jetzt 3 von 5 devices!
wie das denn?

jetzt muss ich die devices nur mehr in fhem finden......
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

dominik

Jetzt nur mehr create_device machen. Die automatische Anlage der Devices habe ich deaktiviert, da manche ziemlich viele Devices haben aber nicht alle anlegen wollen.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

satprofi

Zitat von: dominik am 16 Juli 2022, 13:37:00
Jetzt nur mehr create_device machen. Die automatische Anlage der Devices habe ich deaktiviert, da manche ziemlich viele Devices haben aber nicht alle anlegen wollen.

ja, mach ich, aber nur 1 wird angelegt. der rest nicht. was jetzt wieder schuld?
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

dominik

Was passiert bei den anderen wenn du create_device machst? Log?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

satprofi

#127
Zitat von: dominik am 16 Juli 2022, 13:48:28
Was passiert bei den anderen wenn du create_device machst? Log?

nix ! das fhem_log wirft mir nur diese zeilen aus, verbose 5


2022.07.16 14:04:33 4: BindingsIo (local_pybinding): start fhempyFunction: tuya_system => Set (70542736)
2022.07.16 14:04:33 4: BindingsIo (local_pybinding): <<< WS: {"function":"Set","FHEMPYTYPE":"tuya","NAME":"tuya_system","defargs":["tuya_system","fhempy","tuya","setup","jusdyxxxxxxxxx","cce6628xxxxxxxxxxxxx","bfb727311ed41a0cc8ycsq"],"id":"70542736","defargsh":{},"argsh":{},"msgtype":"function","args":["tuya_system","?"],"PYTHONTYPE":"tuya"}
2022.07.16 14:04:33 5: DevIo_SimpleWrite local_pybinding: 7b2266756e6374696f6e223a22536574222c224648454d505954595045223a2274757961222c224e414d45223a22747579615f73797374656d222c2264656661726773223a5b22747579615f73797374656d222c226668656d7079222c2274757961222c227365747570222c226a75736479336e76626134377234763163347376222c226363653636323832383666663432383961373863333735333263653562626564222c2262666237323733313165643431613063633879637371225d2c226964223a223730353432373336222c226465666172677368223a7b7d2c226172677368223a7b7d2c226d736774797065223a2266756e6374696f6e222c2261726773223a5b22747579615f73797374656d222c223f225d2c22505954484f4e54595045223a2274757961227d
2022.07.16 14:04:33 5: BindingsIo (local_pybinding): DevIo_SimpleRead
2022.07.16 14:04:33 5: BindingsIo (local_pybinding): DevIo_SimpleRead WithTimeout
2022.07.16 14:04:33 5: BindingsIo (local_pybinding): QUEUE: start handling - 0
2022.07.16 14:04:33 5: BindingsIo (local_pybinding): QUEUE: finished handling - 0
2022.07.16 14:04:33 5: BindingsIo (local_pybinding): DevIo_SimpleRead
2022.07.16 14:04:33 5: BindingsIo (local_pybinding): DevIo_SimpleRead WithTimeout
2022.07.16 14:04:33 4: BindingsIo (local_pybinding): >>> WS: {"function": "Set", "FHEMPYTYPE": "tuya", "NAME": "tuya_system", "defargs": ["tuya_system", "fhempy", "tuya", "setup", "jusdy3xxxxxxx", "cce6628286ff4289xxxxxxx", "bfb727311ed41a0cc8ycsq"], "id": "70542736", "defargsh": {}, "argsh": {}, "msgtype": "function", "args": ["tuya_system", "?"], "PYTHONTYPE": "tuya", "finished": 1, "returnval": "Unknown argument ?, choose one of scan_devices:noArg create_device:Wohnzimmer_bffee61d5656c19f0e6zas,Gang_oben_bfb727311ed41a0cc8ycsq,AWOW+32.8ft_WIFI__music_RGB_light_strip_bf7d89a7f6cc66b9adaufh,Smart_Digital_LED_Strip_bf66cd5d458b7a1f03to3k,Socket_4_bf50219899eabfb485synp"}
2022.07.16 14:04:33 5: BindingsIo (local_pybinding): QUEUE: start handling - 1
2022.07.16 14:04:33 5: processMessage: {"function": "Set", "FHEMPYTYPE": "tuya", "NAME": "tuya_system", "defargs": ["tuya_system", "fhempy", "tuya", "setup", "jusdy3nvbxxxxxx", "cce6628286xxxxxx", "bfb727311ed41a0cc8ycsq"], "id": "70542736", "defargsh": {}, "argsh": {}, "msgtype": "function", "args": ["tuya_system", "?"], "PYTHONTYPE": "tuya", "finished": 1, "returnval": "Unknown argument ?, choose one of scan_devices:noArg create_device:Wohnzimmer_bffee61d5656c19f0e6zas,Gang_oben_bfb727311ed41a0cc8ycsq,AWOW+32.8ft_WIFI__music_RGB_light_strip_bf7d89a7f6cc66b9adaufh,Smart_Digital_LED_Strip_bf66cd5d458b7a1f03to3k,Socket_4_bf50219899eabfb485synp"}
2022.07.16 14:04:33 5: BindingsIo (local_pybinding): QUEUE: finished handling - 0
2022.07.16 14:04:33 4: BindingsIo (local_pybinding): end fhempyFunction: tuya_system => Set (70542736) - result: Unknown argument ?, choose one of scan_devices:noArg create_device:Wohnzimmer_bffee61d5656c19f0e6zas,Gang_oben_bfb727311ed41a0cc8ycsq,AWOW+32.8ft_WIFI__music_RGB_light_strip_bf7d89a7f6cc66b9adaufh,Smart_Digital_LED_Strip_bf66cd5d458b7a1f03to3k,Socket_4_bf50219899eabfb485synp
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

satprofi

habe es nochmals probiert, und es sieht so aus das nur das 1. in der liste aus cloud angelegt wird. habe das angelegte gelöscht, und anderes versucht anzulegen, klappt nicht. nur das 1. in der liste legt sich immer neu an
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

dominik

Bitte fhempy Log nach dem create_device vom 2. Device posten.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

satprofi

hallo.
fehler gefunden. musste alle über die tuya_cloud angelegten devices löschen, erst danach konnte ich die neuen createn.
auf das musst erst kommen. danke für deine geduld.
lg
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

dominik

Ah, ja, weil es ist der selbe Devicename. Kann ich noch schauen ob ich da eine Fehlermeldung generieren kann.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Wasserwerk33

Hallo Leute,

habe immer eine server Stopped. Was habe ich falsch gemacht??

defmod tuya_system fhempy tuya setup  mk8mcxngauhxxxxxxx 9f6688f13d27480cbdf7axxxxxxxx 32804800bcddc2xxxxx
                                                            (Access ID/Client ID:)   (Access Secret/Client Secret:)      (smartlife Geräte ID:)

Das müsste doch so richtig sein oder??

und der schreibt immer running und Springt dann wieder in stopped:
(fhempyserver_15733)

Habe ich was vergessen??

Danke für eure Hilfe.

satprofi

schalter schalten wie wild.
in fhem gerade gesehen

Failed to execute function Define: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _new_conn conn = connection.create_connection( File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1012, in _validate_conn conn.connect() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 353, in connect conn = self._new_conn() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 181, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno -3] Temporary failure in name resolution During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/fhem/.local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen retries = retries.increment( File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openapi.tuyaeu.com', port=443): Max retries exceeded with url: /v1.0/token?grant_type=1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/fhem_pythonbinding.py", line 307, in handle_function ret = await self.execute_function(hash, fhem_reply_done, nmInstance) File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/fhem_pythonbinding.py", line 378, in execute_function ret = await asyncio.wait_for( File "/usr/lib/python3.9/asyncio/tasks.py", line 481, in wait_for return fut.result() File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/tuya/tuya.py", line 85, in Define await self.setup_cloud() File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/tuya/tuya.py", line 93, in setup_cloud self.tuya_cloud = await utils.run_blocking( File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/utils.py", line 34, in run_blocking return await asyncio.get_event_loop().run_in_executor(pool, function) File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/opt/fhem/.local/lib/python3.9/site-packages/tinytuya/__init__.py", line 1890, in __init__ self.token = self._gettoken() File "/opt/fhem/.local/lib/python3.9/site-packages/tinytuya/__init__.py", line 1995, in _gettoken response_dict = self._tuyaplatform('token?grant_type=1') File "/opt/fhem/.local/lib/python3.9/site-packages/tinytuya/__init__.py", line 1956, in _tuyaplatform response = requests.get(url, headers=headers) File "/opt/fhem/.local/lib/python3.9/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, **kwargs) File "/opt/fhem/.local/lib/python3.9/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/opt/fhem/.local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/opt/fhem/.local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/opt/fhem/.local/lib/python3.9/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='openapi.tuyaeu.com', port=443): Max retries exceeded with url: /v1.0/token?grant_type=1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

satprofi

Hallo.
habe hier einen Smartmeter eingebunden, der mir dieses reading liefert

phase_a

{"electricCurrent":3.12,"power":0.749,"voltage":238.8}

Wie bekomme ich die einzelnen Werte als eigenes reading?
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram