fhempy: tuya (lokal)

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

Vorheriges Thema - Nächstes Thema

satprofi

Zitat von: Gisbert am 25 November 2025, 13:56:45Hallo Xsantos,

ich betreibe 3 Tuya-Geräte (2x schaltbare Steckdosen mit Leistungsmessung, 1x Luftentfeuchter) ausschließlich mit lokaler Cloud. Die Geräte hatten genau einmal Zugang zum Internet zur Einrichtung

Viele Grüße Gisbert



wie stellst du das an ? bei mir geht nichts mehr über lokale anbindung. nur mehr mit tuya-connector.
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

Gisbert

Zitat von: satprofi am 10 Dezember 2025, 11:31:42wie stellst du das an ? bei mir geht nichts mehr über lokale anbindung. nur mehr mit tuya-connector.

Das ist jetzt schon länger her, ca. 2.5 ~ 3 Jahre. Damals funktionierte es so, dass man einen Entwickler-Account haben musste und man das jeweilige Gerät einmalig in der Cloud anmelden musste. Danach hab ich die Geräte ohne Internet-Anschluss in der lokalen Cloud betrieben. Das funktioniert bis jetzt reibungslos.

Viele Grüße Gisbert
Proxmox | UniFi | Homematic, VCCU, HMUART | ESP8266 | ATtiny85 | Wasser-, Stromzähler | tuya local | Wlan-Kamera | SIGNALduino, Rauchmelder FA21/22RF | RHASSPY | DEYE | JK-BMS | ESPHome | Panasonic Heishamon

satprofi

Zitat von: Gisbert am 10 Dezember 2025, 13:49:04
Zitat von: satprofi am 10 Dezember 2025, 11:31:42wie stellst du das an ? bei mir geht nichts mehr über lokale anbindung. nur mehr mit tuya-connector.

Das ist jetzt schon länger her, ca. 2.5 ~ 3 Jahre.  Das funktioniert bis jetzt reibungslos.

Viele Grüße Gisbert

also seitdem ich zugang zur cloud verloren hatte, klappts nur mehr über smartlife. alle befehle zu tuya_local werden nicht ausgeführt, weil "initialing"
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

frank_41

Hallo fhem Leute,
habe mich auch mal an tuya probiert. Ich habe einen Wifi Thermostat von Blitzwolf BW-TRV16. Der läuft auch mit der Tuya App und ich habe
mir eine Tuya Developer Account eingerichtet. fhempy scheint die Daten auch korrekt von der Cloud zu holen.
Wenn ich den Thermostat aber anlege (mit korrekter IP) bekomme ich immer:

ERROR OPENING SOCKET!!!192.168.178.63

Mir scheint fhempy kriegt keinen Zugriff ?? Woran kann das liegen ?


Internals:
   DEF        tuya mdkqafv3dxxxxxxx bfbf2383b160xxxxxxxxx 192.168.178.63 3.3 v4dtfyxxxxxxxxxxxxxx c3864d2523xxxxxxxxxxxxxxxxxxxxxx
   DEVICEID   bfbf2383b160xxxxxxxxx
   FHEMPYTYPE tuya
   FUUID      693b1748-f33f-8841-098c-7f90c22766f73f34
   IODev      fhempy_local
   NAME       tuya_local_bfbf2383b160xxxxxxxxx
   NR         611
   PYTHONTYPE tuya
   STATE      Initializing...
   TYPE       fhempy
   eventCount 1
   READINGS:
     2025-12-11 20:11:42   active_time     1765376439
     2025-12-11 20:11:42   biz_type        0
     2025-12-11 20:11:42   category        wk
     2025-12-11 20:11:42   create_time     1765361816
     2025-12-11 20:11:42   icon            smart/icon/ay1506337792739cXrIR/a8d8220d497fc5f4d06fcd5d79c639b8.jpg
     2025-12-11 20:11:42   id              bfbf2383b160xxxxxxxxx
     2025-12-11 20:11:42   ip              77.23.71.231
     2025-12-11 20:11:42   lat             52.28
     2025-12-11 20:11:42   local_key       x*UHZYxxxxxxxxxx
     2025-12-11 20:11:42   lon             10.54
     2025-12-11 20:11:42   model           BW-TRV16
     2025-12-11 20:11:42   name            WiFi Thermostat Radiator Vavle 2
     2025-12-11 20:11:45   online          0
     2025-12-11 20:11:42   owner_id        260067294
     2025-12-11 20:11:42   product_id      mdkqafv3dxxxxxxx
     2025-12-11 20:11:42   product_name    WiFi Thermostat Radiator Vavle
     2025-12-11 21:27:51   state           Initializing...
     2025-12-11 20:11:42   sub             0
     2025-12-11 20:11:42   time_zone       +01:00
     2025-12-11 20:11:42   uid             eu176235xxxxxxxxxxxx
     2025-12-11 20:11:42   update_time     1765455575
     2025-12-11 20:11:42   uuid            305e2d23187bd145
   args:
     tuya_local_bfbf2383b160xxxxxxxxx
     fhempy
     tuya
     mdkqafv3dxxxxxxx
     bfbf2383b160xxxxxxxxx
     192.168.178.63
     3.3
     v4dtfyxxxxxxxxxxxxxx
     c3864d2523xxxxxxxxxxxxxxxxxxxxxx
   argsh:
Attributes:
   alias      WiFi Thermostat Radiator Vavle 2
   group      tuya
   localkey   x*UHZYxxxxxxxxxx
   room       fhempy
   tuya_spec_functions [{'code': 'switch', 'dp_id': 1, 'type': 'Boolean', 'values': {}, 'desc': 'switch'}, {'code': 'mode', 'dp_id': 2, 'type': 'Enum', 'values': {'range': ['auto']}, 'desc': 'mode'}, {'code': 'temp_set', 'dp_id': 3, 'type': 'Integer', 'values': {'unit': '℃', 'min': 50, 'max': 350, 'scale': 1, 'step': 5}, 'desc': 'temp set'}, {'code': 'temp_correction', 'dp_id': 7, 'type': 'Integer', 'values': {'unit': '℃', 'min': -99, 'max': 99, 'scale': 1, 'step': 1}, 'desc': 'temp correction'}, {'code': 'upper_temp', 'dp_id': 10, 'type': 'Integer', 'values': {'unit': '℃', 'min': 150, 'max': 350, 'scale': 1, 'step': 5}, 'desc': 'upper temp'}, {'code': 'lower_temp', 'dp_id': 11, 'type': 'Integer', 'values': {'unit': '℃', 'min': 50, 'max': 140, 'scale': 1, 'step': 5}, 'desc': 'lower temp'}, {'code': 'child_lock', 'dp_id': 17, 'type': 'Boolean', 'values': {}, 'desc': 'child lock'}, {'code': 'frost', 'dp_id': 20, 'type': 'Boolean', 'values': {}, 'desc': 'frost'}, {'code': 'factory_reset', 'dp_id': 103, 'type': 'Boolean', 'values': {}, 'desc': 'factory reset'}, {'code': 'work_days', 'dp_id': 104, 'type': 'Enum', 'values': {'range': ['5_2', '6_1', '7']}, 'desc': 'work days'}]
   tuya_spec_status [{'code': 'switch', 'dp_id': 1, 'type': 'Boolean', 'values': {}}, {'code': 'mode', 'dp_id': 2, 'type': 'Enum', 'values': {'range': ['auto']}}, {'code': 'temp_set', 'dp_id': 3, 'type': 'Integer', 'values': {'unit': '℃', 'min': 50, 'max': 350, 'scale': 1, 'step': 5}}, {'code': 'temp_current', 'dp_id': 4, 'type': 'Integer', 'values': {'unit': '℃', 'min': 0, 'max': 800, 'scale': 1, 'step': 1}}, {'code': 'temp_correction', 'dp_id': 7, 'type': 'Integer', 'values': {'unit': '℃', 'min': -99, 'max': 99, 'scale': 1, 'step': 1}}, {'code': 'fault', 'dp_id': 9, 'type': 'Bitmap', 'values': {'label': ['battery_temp_fault']}}, {'code': 'upper_temp', 'dp_id': 10, 'type': 'Integer', 'values': {'unit': '℃', 'min': 150, 'max': 350, 'scale': 1, 'step': 5}}, {'code': 'lower_temp', 'dp_id': 11, 'type': 'Integer', 'values': {'unit': '℃', 'min': 50, 'max': 140, 'scale': 1, 'step': 5}}, {'code': 'battery_percentage', 'dp_id': 16, 'type': 'Integer', 'values': {'unit': '%', 'min': 0, 'max': 100, 'scale': 0, 'step': 1}}, {'code': 'child_lock', 'dp_id': 17, 'type': 'Boolean', 'values': {}}, {'code': 'frost', 'dp_id': 20, 'type': 'Boolean', 'values': {}}, {'code': 'factory_reset', 'dp_id': 103, 'type': 'Boolean', 'values': {}}, {'code': 'work_days', 'dp_id': 104, 'type': 'Enum', 'values': {'range': ['5_2', '6_1', '7']}}]
   verbose    5
2025-12-11 22:06:24,335 - DEBUG    - fhempy.lib.fhem: <<< 30576647: {'awaitId': 30576647, 'NAME': 'tuya_local_bfbfxxxxxxxxxxxxx7ckrf', 'msgtype': 'command', 'command': "AttrVal('tuya_local_bfbfxxxxxxxxxxxxx7ckrf', 'tuya_spec_status', '[]')"}
2025-12-11 22:06:24,336 - DEBUG    - fhempy.lib.fhem: >>> 30576647 1.30ms: {'result': "[{'code': 'switch', 'dp_id': 1, 'type': 'Boolean', 'values': {}}, {'code': 'mode', 'dp_id': 2, 'type': 'Enum', 'values': {'range': ['auto']}}, {'code': 'temp_set', 'dp_id': 3, 'type': 'Integer', 'values': {'unit': '℃', 'min': 50, 'max': 350, 'scale': 1, 'step': 5}}, {'code': 'temp_current', 'dp_id': 4, 'type': 'Integer', 'values': {'unit': '℃', 'min': 0, 'max': 800, 'scale': 1, 'step': 1}}, {'code': 'temp_correction', 'dp_id': 7, 'type': 'Integer', 'values': {'unit': '℃', 'min': -99, 'max': 99, 'scale': 1, 'step': 1}}, {'code': 'fault', 'dp_id': 9, 'type': 'Bitmap', 'values': {'label': ['battery_temp_fault']}}, {'code': 'upper_temp', 'dp_id': 10, 'type': 'Integer', 'values': {'unit': '℃', 'min': 150, 'max': 350, 'scale': 1, 'step': 5}}, {'code': 'lower_temp', 'dp_id': 11, 'type': 'Integer', 'values': {'unit': '℃', 'min': 50, 'max': 140, 'scale': 1, 'step': 5}}, {'code': 'battery_percentage', 'dp_id': 16, 'type': 'Integer', 'values': {'unit': '%', 'min': 0, 'max': 100, 'scale': 0, 'step': 1}}, {'code': 'child_lock', 'dp_id': 17, 'type': 'Boolean', 'values': {}}, {'code': 'frost', 'dp_id': 20, 'type': 'Boolean', 'values': {}}, {'code': 'factory_reset', 'dp_id': 103, 'type': 'Boolean', 'values': {}}, {'code': 'work_days', 'dp_id': 104, 'type': 'Enum', 'values': {'range': ['5_2', '6_1', '7']}}]", 'error': 0, 'awaitId': 30576647}
2025-12-11 22:06:24,338 - DEBUG    - fhempy.lib.fhem: <<< 21070368: {'awaitId': 21070368, 'NAME': 'tuya_local_bfbfxxxxxxxxxxxxx7ckrf', 'msgtype': 'command', 'command': "ReadingsVal('tuya_local_bfbfxxxxxxxxxxxxx7ckrf', 'category', '')"}
2025-12-11 22:06:24,339 - DEBUG    - fhempy.lib.fhem: >>> 21070368 1.09ms: {'error': 0, 'result': 'wk', 'awaitId': 21070368}
2025-12-11 22:06:27,414 - DEBUG    - aiotinytuya.core: [bfbfxxxxxxxxxxxxx7ckrf] ERROR OPENING SOCKET!!!192.168.178.63
2025-12-11 22:06:27,415 - DEBUG    - fhempy.lib.fhem: <<< 13193717: {'awaitId': 13193717, 'NAME': 'tuya_local_bfbfxxxxxxxxxxxxx7ckrf', 'msgtype': 'command', 'command': "readingsBeginUpdate($defs{'tuya_local_bfbfxxxxxxxxxxxxx7ckrf'});;readingsBulkUpdateIfChanged($defs{'tuya_local_bfbfxxxxxxxxxxxxx7ckrf'},'online','0');;readingsEndUpdate($defs{'tuya_local_bfbfxxxxxxxxxxxxx7ckrf'},1);;"}
2025-12-11 22:06:27,417 - DEBUG    - fhempy.lib.fhem: >>> 13193717 1.82ms: {'result': None, 'error': 0, 'awaitId': 13193717}
2025-12-11 22:06:27,418 - ERROR    - tuya_local_bfbfxxxxxxxxxxxxx7ckrf: Failed to connect to device
Traceback (most recent call last):
  File "/opt/fhem/.fhempy/fhempy_venv/lib/python3.11/site-packages/fhempy/lib/tuya/tuya.py", line 563, in setup_connection
    self._connected_device = await asyncio.wait_for(connect_fct, timeout=15)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/tasks.py", line 479, in wait_for
    return fut.result()
           ^^^^^^^^^^^^
  File "/opt/fhem/.fhempy/fhempy_venv/lib/python3.11/site-packages/aiotinytuya/__init__.py", line 206, in connect
    await device.start_socket()
  File "/opt/fhem/.fhempy/fhempy_venv/lib/python3.11/site-packages/aiotinytuya/core.py", line 917, in start_socket
    raise ex
  File "/opt/fhem/.fhempy/fhempy_venv/lib/python3.11/site-packages/aiotinytuya/core.py", line 894, in start_socket
    self.reader, self.writer = await asyncio.open_connection(
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/streams.py", line 48, in open_connection
    transport, _ = await loop.create_connection(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1085, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 634, in sock_connect
    return await fut
           ^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 674, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('192.168.178.63', 6668)
2025-12-11 22:06:31,474 - DEBUG    - aiotinytuya.core: [bfbfxxxxxxxxxxxxx7ckrf] ERROR OPENING SOCKET!!!192.168.178.63


Raspberry Pi 3
RFXCOM_RFXtrx433
V 1.62 nanoCUL433
Jeelink LaCrosse
Jeelink PCA301.CUL_HM,Conbee, deCONZ