fhempy: tuya (lokal)

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

Vorheriges Thema - Nächstes Thema

Konfusius

Ja, steht bei py.Binding dahinter

dominik

Hmmm...bitte dann noch das Log anschauen ob da was ersichtlich ist.

...und dp_06 Reading wird aktualisiert, oder?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Konfusius

Ja gerade gemacht:
WARNING  - SmartMeter: dp_06 in spec but not found locally. This should be reported to TuYa

dominik

Sonst kein ERROR? Das WARNING ist ok.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Konfusius

#169
Habe eben mal die Last geändert > Readingwert bei dp_06 ändert sich!
Nein sonst alle ok. keine Errors

UND KEINEN STRESS! Ich hab Zeit, nur wenn DU Lust und Zeit hast. Danke für die tolle Arbeit, ich wollte das Smart Meter schon zurück schicken, weil kein
Tasmota mehr drauf ging...

dominik

Teste bitte mit 0.1.390 und stell vorher das Device auf verbose=5. Danach sollten im fhempy Log jede Menge DEBUG Messages mit
handle type ...
sein. Kopier mir die bitte hier rein.

Kann sein, dass ich die erst morgen anschau...ist schon spät ;)
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Konfusius

Auf verbose 5 gestellt Update Neustart
Hier der Log:
2022-08-06 22:58:04,310 - INFO     - fhempy.lib.fhem_pythonbinding: Start update...
2022-08-06 22:58:04,313 - INFO     - fhempy.lib.pkg_installer: Attempting install of fhempy
2022-08-06 22:58:24,407 - INFO     - fhempy.lib.pkg_installer: Successfully installed fhempy update!
2022-08-06 22:58:24,433 - INFO     - fhempy.lib.fhem_pythonbinding: Restart initiated...
2022-08-06 22:58:24,449 - INFO     - fhempy.lib.fhem_pythonbinding: All modules successfully undefined!
2022-08-06 22:58:24,451 - INFO     - websockets.server: server closing
2022-08-06 22:58:34,505 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to handle message:
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 945, in transfer_data
    message = await self.read_message()
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 1015, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 1090, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 1145, in read_frame
    frame = await Frame.read(
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/framing.py", line 70, in read
    data = await reader(2)
  File "/usr/lib/python3.9/asyncio/streams.py", line 723, in readexactly
    await self._wait_for_data('readexactly')
  File "/usr/lib/python3.9/asyncio/streams.py", line 517, in _wait_for_data
    await self._waiter
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/fhem_pythonbinding.py", line 166, in _onMessage
    await self.handle_message(msg, hash)
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/fhem_pythonbinding.py", line 186, in handle_message
    await self.handle_function(hash, msg)
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/fhem_pythonbinding.py", line 345, in handle_function
    await self.sendBackReturn(hash, ret)
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/fhem_pythonbinding.py", line 110, in sendBackReturn
    await self.wsconnection.send(msg.encode("utf-8"))
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 620, in send
    await self.ensure_open()
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 930, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: sent 1001 (going away); no close frame received
2022-08-06 22:58:34,508 - ERROR    - fhempy.lib.fhem_pythonbinding: fhempy failed to handle message(id: 15020048)
2022-08-06 22:58:34,510 - ERROR    - fhempy.lib.fhem_pythonbinding: Failed to handle message: {"FHEMPYTYPE":"tuya","defargsh":{},"function":"Set","msgtype":"function","id":"15020048","args":["SmartMeter","?"],"NAME":"SmartMeter","defargs":["SmartMeter","fhempy","tuya","nqbs1onwskmmmaac","bf5e65db3d968eedfdos5i","192.168.19.31","4682e6f9063b6557","3.3","hrdphtup7m7qrty354st","fed25485277f4325afa37f4208329c76"],"argsh":{},"PYTHONTYPE":"tuya"}
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 945, in transfer_data
    message = await self.read_message()
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 1015, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 1090, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 1145, in read_frame
    frame = await Frame.read(
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/framing.py", line 70, in read
    data = await reader(2)
  File "/usr/lib/python3.9/asyncio/streams.py", line 723, in readexactly
    await self._wait_for_data('readexactly')
  File "/usr/lib/python3.9/asyncio/streams.py", line 517, in _wait_for_data
    await self._waiter
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/fhem_pythonbinding.py", line 144, in onMessage
    await self._onMessage(payload)
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/fhem_pythonbinding.py", line 169, in _onMessage
    await self.sendBackError(hash, "fhempy failed to handle message")
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/fhem_pythonbinding.py", line 121, in sendBackError
    await self.wsconnection.send(msg.encode("utf-8"))
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 620, in send
    await self.ensure_open()
  File "/opt/fhem/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 921, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: sent 1001 (going away); no close frame received
2022-08-06 22:58:34,534 - INFO     - websockets.server: connection closed
2022-08-06 22:58:34,539 - INFO     - websockets.server: server closed
2022-08-06 22:58:34,560 - INFO     - fhempy.lib.fhem_pythonbinding: Exit 1
2022-08-06 22:58:36,176 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.390...
2022-08-06 22:58:36,182 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2022-08-06 22:58:36,268 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2022-08-06 22:58:48,401 - INFO     - websockets.server: connection open
2022-08-06 22:58:48,410 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2022-08-06 22:58:51,051 - DEBUG    - SmartMeter: getdevices: f{resp}
2022-08-06 22:58:51,907 - WARNING  - SmartMeter: dp_06 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:58:51,970 - WARNING  - SmartMeter: dp_14 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:58:51,986 - WARNING  - SmartMeter: dp_15 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:58:52,012 - WARNING  - SmartMeter: dp_17 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:58:52,023 - WARNING  - SmartMeter: dp_20 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:58:52,046 - WARNING  - SmartMeter: dp_14 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:58:52,058 - WARNING  - SmartMeter: dp_15 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:58:52,081 - WARNING  - SmartMeter: dp_17 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:58:52,092 - WARNING  - SmartMeter: dp_20 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:58:52,105 - DEBUG    - SmartMeter: handle type Integer for dp_id 1 with value 299
2022-08-06 22:58:52,117 - DEBUG    - SmartMeter: handle type Bitmap for dp_id 10 with value 0
2022-08-06 22:58:52,129 - DEBUG    - SmartMeter: handle type Boolean for dp_id 12 with value False
2022-08-06 22:58:52,141 - DEBUG    - SmartMeter: handle type Integer for dp_id 13 with value 0
2022-08-06 22:58:52,153 - DEBUG    - SmartMeter: handle type Boolean for dp_id 16 with value True
2022-08-06 22:59:02,242 - INFO     - fhempy.lib.fhem_pythonbinding: Shutdown initiated...
2022-08-06 22:59:02,277 - INFO     - fhempy.lib.fhem_pythonbinding: All modules successfully undefined!
2022-08-06 22:59:02,283 - INFO     - websockets.server: server closing
2022-08-06 22:59:08,645 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.390...
2022-08-06 22:59:08,652 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2022-08-06 22:59:08,739 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2022-08-06 22:59:18,413 - INFO     - websockets.server: connection open
2022-08-06 22:59:18,421 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2022-08-06 22:59:20,751 - DEBUG    - SmartMeter: getdevices: f{resp}
2022-08-06 22:59:21,619 - WARNING  - SmartMeter: dp_06 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:21,680 - WARNING  - SmartMeter: dp_14 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:21,692 - WARNING  - SmartMeter: dp_15 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:21,715 - WARNING  - SmartMeter: dp_17 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:21,727 - WARNING  - SmartMeter: dp_20 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:21,749 - WARNING  - SmartMeter: dp_14 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:21,761 - WARNING  - SmartMeter: dp_15 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:21,784 - WARNING  - SmartMeter: dp_17 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:21,796 - WARNING  - SmartMeter: dp_20 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:21,809 - DEBUG    - SmartMeter: handle type Integer for dp_id 1 with value 299
2022-08-06 22:59:21,821 - DEBUG    - SmartMeter: handle type Bitmap for dp_id 10 with value 0
2022-08-06 22:59:21,833 - DEBUG    - SmartMeter: handle type Boolean for dp_id 12 with value False
2022-08-06 22:59:21,845 - DEBUG    - SmartMeter: handle type Integer for dp_id 13 with value 0
2022-08-06 22:59:21,857 - DEBUG    - SmartMeter: handle type Boolean for dp_id 16 with value True
2022-08-06 22:59:40,663 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.390...
2022-08-06 22:59:40,669 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2022-08-06 22:59:40,757 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2022-08-06 22:59:47,144 - INFO     - websockets.server: connection open
2022-08-06 22:59:47,153 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2022-08-06 22:59:48,467 - WARNING  - asyncio: Executing <Handle _SelectorDatagramTransport._read_ready() created at /usr/lib/python3.9/asyncio/selector_events.py:259> took 0.102 seconds
2022-08-06 22:59:50,094 - WARNING  - SmartMeter: dp_06 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:50,139 - WARNING  - SmartMeter: dp_14 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:50,151 - WARNING  - SmartMeter: dp_15 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:50,173 - WARNING  - SmartMeter: dp_17 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:50,185 - WARNING  - SmartMeter: dp_20 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:50,207 - WARNING  - SmartMeter: dp_14 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:50,219 - WARNING  - SmartMeter: dp_15 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:50,241 - WARNING  - SmartMeter: dp_17 in spec but not found locally. This should be reported to TuYa
2022-08-06 22:59:50,257 - WARNING  - SmartMeter: dp_20 in spec but not found locally. This should be reported to TuYa

Gute Nacht!

dominik

Hat sich der Wert von dp_06 während dem Log geändert? Weil im Log erkennt man, dass dp 6 nix geliefert hat. Wenn da doch was kommt, schau bitte noch im Log ob dort handle... steht.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

dominik

So...hat mir keine Ruhe gelassen....ich glaube ich hab den Fehler gefunden, bitte 0.1.391 testen.
gn8
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

satprofi

#174
Zitat von: dominik am 07 August 2022, 00:04:17
So...hat mir keine Ruhe gelassen....ich glaube ich hab den Fehler gefunden, bitte 0.1.391 testen.
gn8
hallo. siehr ja super aus

hab dir 3 kaffee gespendet, danke

https://paypal.me/todominik
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

dominik

Super!

Die Änderungen kannst du nur in Python machen. Das findest du hier:
/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/tuya/tuya.py
Ab Zeile 455.
Was zeigt er dir für Werte (power,current,voltage) aktuell an? Kannst du mir mal ein paar Kombinationen posten? Ich glaube Voltage muss auch noch durch 10 dividiert werden, oder?

Kaffeespende gerne via Paypal: https://paypal.me/todominik ich sag schon mal Danke!
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Konfusius

Wow, bei mir ist alles korrekt! Werte identisch mit der Smart App.
Aufm Sonntag um 04:17 Uhr??   Echt jetzt? Das ist der beste Support ever!! Hab ich noch nie erlebt!
Vielen Dank!

dominik

Zitat von: Konfusius am 07 August 2022, 09:47:47
Wow, bei mir ist alles korrekt! Werte identisch mit der Smart App.
Aufm Sonntag um 04:17 Uhr??   Echt jetzt? Das ist der beste Support ever!! Hab ich noch nie erlebt!
Vielen Dank!
Keine Sorge, es war Mitternacht (00:04:17), aber auf die Ergebnisse war ich schon im Traum gespannt :D
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 07 August 2022, 09:47:40
Super!

Die Änderungen kannst du nur in Python machen. Das findest du hier:
/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/tuya/tuya.py
Ab Zeile 455.
Was zeigt er dir für Werte (power,current,voltage) aktuell an? Kannst du mir mal ein paar Kombinationen posten? Ich glaube Voltage muss auch noch durch 10 dividiert werden, oder?

Kaffeespende gerne via Paypal: https://paypal.me/todominik ich sag schon mal Danke!

werte oassen, die app ist nicht zeitgleich. voltage durch 10, current x0, 1

gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

dominik

Super! :)

current wirklich * 0,1? Ich denke es sind mA die rauskommen. Falls ihr A wollt, dividiere ich noch durch 1000.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik