fhempy: Tuya Cloud

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

Vorheriges Thema - Nächstes Thema

thburkhart

sehe ich das richtig, dass neue Devices anhand ihrer ID angelegt werden?

d.h. Änderung des Namens (der ja auch der ALEXA-Name ist) in der SmartLifeApp schlägt nicht zu FHEM durch ?
somit können die DEFs entsprechend angepasst werden?

1 RASPI4B, 1 RASPI3B, 2 CUL, 2 Jeelink, 60 Tuya-Devices (Schalter, Dimmer, Sensoren, Cameras), 30 HUE-Lampen, 5 MAX! WTs, 16 MAX! HTs, 12 MAX! FKs, 1 Bresser 5in1, 1 OilFox, 8 ALEXA Echos und Dots, FHEM, 5 Tasmota-Devices, SonOff -Bridge, PowerFox, Buderus KM200

Superposchi

#256
So, auf der Tuya Plattform wird der Ventilator jetzt wieder als Online angezeigt.
In Fhem habe ich das Device für den Ventilator gelöscht, da er sich immer noch nicht bedienen lies, trotz restart etc.

Nun wird der Ventilator aber nicht neu angelegt.

Nach dem Neustart bekomme ich jetzt auf dem zweiten Gerät auch nur noch ein "Ready" als STATE angezeigt und keinerlei Set-Befehle mehr.

dominik

Zitat von: thburkhart am 10 Oktober 2021, 13:42:30
sehe ich das richtig, dass neue Devices anhand ihrer ID angelegt werden?

d.h. Änderung des Namens (der ja auch der ALEXA-Name ist) in der SmartLifeApp schlägt nicht zu FHEM durch ?
somit können die DEFs entsprechend angepasst werden?

DEFs bitte nicht ändern, die müssen so bleiben. Namen einfach per alias setzen.
Den Device Name kannst du testweise per rename ändern, eventuell ist aber ein Neustart notwendig. Da hatte ich Mal einen Bug drin.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

dominik

Zitat von: Superposchi am 10 Oktober 2021, 14:20:27
So, auf der Tuya Plattform wird der Ventilator jetzt wieder als Online angezeigt.
In Fhem habe ich das Device für den Ventilator gelöscht, da er sich immer noch nicht bedienen lies, trotz restart etc.

Nun wird der Ventilator aber nicht neu angelegt.

Nach dem Neustart bekomme ich jetzt auf dem zweiten Gerät auch nur noch ein "Ready" als STATE angezeigt und keinerlei Set-Befehle mehr.

Kannst du bitte in einem Post zusammenfassen was du hast und brauchst?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

Das habe ich inzwischen schon zigmal, aber bitte gerne nochmal:

1) Ich brauche das Anlegen des Tuya-Devices für den Ventilator der auf der IoT-Plattform existiert und jetzt wieder als Online angeziegt wird in Fhem aber von mir manuell gelöscht wurde.
2) Brauche ich für das Device des Luftbefeuchters  die Bedienbarkeit. Es wird nur Ready angezeigt und keine Set-Befehle.

dominik

Sorry, vielleicht schlecht formuliert von mir. Bitte technisch zusammenfassen:
- Welches tuya_cloud Device hast du aktuell in FHEM?
- Wie lautet der technische Name des Devices auf der IoT Plattform?
- Welche Devices werden angelegt, wenn du den tuya_cloud_connector aktivierst?
- Was hat es nun mit den 2 Devices auf sich die 1 sein sollen? Wo werden 2 Devices angezeigt (welche) und wo wird ein Device angezeigt (welches)?

Bitte mit Screenshots oder copy&paste wo möglich, damit ich einen Überblick habe. Ich verstehe das Problem noch nicht ganz mit dem 2->1 Devices.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

#261
Also Grundlegend zur Hardware:
Ich habe aktuell 2 Geräte mit Tuya-Steuerung.
1) einen Luftbefeuchter
2) einen Ventilator mit zusatzmodul Luftbefeuchter

Beide werden auf der Tuya-IoT-Plattform korrekt angezeigt. Siehe Screnshot #1.

In Fhem wurden beide Devices angezeigt. Da sich der Ventilator jedoch nicht bedienen ließ, habe ich ihn gelöscht um ihn neu zu erstellen.
Auf Screenshot #2 sind alle fhempy:Tuya Devices aufgelistet. Der Ventilator fehlt und wird auch nicht automatisch neu erstellt.
Habe schon den kompletten Fhem-Server neugestartet, beim local_pybinding ein Update und auch das pythonbinding_15733 neugestartet. Den Tuya-Cloud-connector kann ich nicht ändern. Dort gibt es keinerlei Einstellmöglichkeiten (siehe Screenshot #4)
Seit diesen Versuchen wird jetzt auch der Luftbefeuchter fehlerhaft angezeigt, keine Set-Befehle mehr und das STATE zeigt lediglich ready an (Screenshot #3).

Zusätzlich fehlten ja bei beiden Devices in der Vergangenheit jede Menge Optionen, was besonders beim Ventilator dumm war, da dort die komplette Befeuchter-Befehle nicht existierten. Wahrscheinlich, da der Luftbefeuchter nur als Option auf den Ventilator aufgesetzt und durch diesen mit Spannung versorgt wird. In der App sind irgendwie dann von beiden Teilgeräten alle Funktionen in einem Eintrag zusammen steuerbar. Da es sich aber um zwei zusammengebaute Einzelteile handelt hatte ich ursprünglich überlegt ob vielleicht die Möglichkeit besteht innerhalb der Tuya-Plattform ein weiteres virtuelles Device zu erstellen, mit der IP des Ventilators aber den Funktionen eines Luftbefeuchters. Wäre ja in Fhem egal wenn dort zwei Devices zum Ventilator existiert hätten. Aber das war nur eine Überlegung um an die fehlenden Funktionen ranzukommen.

Ich hoffe das deckt jetzt alle Fragen ab.

dominik

Ok, jetzt kenn ich mich aus, danke!

Anhand der Screenshots erkennt man, dass der Connector nur auf connecting statt connected steht.
Schau Mal ins fhempy Log bzw prüfe die Parameter im Define. Eventuell ist clientid/Secret oder Username/Passwort falsch. Username/Password muss von der SmartLife App sein.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

#263
Da ja alles mal funktioniert hat und ich nichts geändert habe müssen Username und Passwort stimmen.
Wie kann ich die clientid kontrollieren? wo finde ich diese in der App/Iot-Plattform?

Hier das Log von heute, vielleicht kannst du ja einen fehler entdecken, ich kenne mich zu wenig damit aus:
2021-10-10 02:00:02,501 - WARNING  - asyncio: Executing <TimerHandle when=389825.150067971 _set_result_unless_cancelled(<Future finis...events.py:396>, None) at /usr/lib/python3.7/asyncio/futures.py:284 created at /usr/lib/python3.7/asyncio/tasks.py:566> took 0.261 seconds
2021-10-10 02:09:07,903 - ERROR    - pychromecast.socket_client: [Musikwiedergabe(192.168.178.160):32194] Error reading from socket.
2021-10-10 02:09:48,119 - ERROR    - pychromecast.socket_client: [Schlafzimmerlautsprecher(192.168.178.160):8009] Failed to connect to service ServiceInfo(type='host', data=('192.168.178.160', 8009)), retrying in 5.0s
2021-10-10 02:09:57,145 - ERROR    - pychromecast.socket_client: [Musikwiedergabe(192.168.178.161):32194] Error reading from socket.
2021-10-10 13:06:40,167 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-10-10 13:06:40,174 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-10-10 13:06:42,632 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-10-10 13:06:42,639 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-10-10 13:06:46,881 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-10-10 13:06:46,887 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-10-10 13:06:49,451 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2021-10-10 13:07:02,355 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9e4d96a1d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.021 seconds
2021-10-10 13:07:02,369 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2021-10-10 13:07:02,374 - ERROR    - fhempy.lib.fhem_pythonbinding: Connection closed error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 750, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 819, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 895, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 975, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/framing.py", line 55, in read
    data = await reader(2)
  File "/usr/lib/python3.7/asyncio/streams.py", line 677, in readexactly
    raise IncompleteReadError(incomplete, n)
asyncio.streams.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

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

Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 67, in pybinding
    async for message in websocket:
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 356, in __aiter__
    yield await self.recv()
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 421, in recv
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 726, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2021-10-10 13:07:02,374 - INFO     - fhempy.lib.fhem_pythonbinding: Restart binding
2021-10-10 13:07:22,250 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-10-10 13:07:22,257 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-10-10 13:23:39,759 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-10-10 13:23:39,767 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-10-10 13:24:06,801 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2021-10-10 13:24:18,295 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fcd63a1de10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.020 seconds
2021-10-10 13:24:28,328 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fcd631c5320>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.013 seconds
2021-10-10 13:24:38,369 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fcd631c5978>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.039 seconds
2021-10-10 14:08:07,098 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-10-10 14:08:07,105 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-10-10 14:08:16,859 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2021-10-10 14:08:28,159 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fc7ca6c9e48>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.010 seconds
2021-10-10 14:08:38,188 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fc7c9e732e8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.013 seconds
2021-10-10 14:08:48,202 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fc7c9e73940>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.013 seconds
2021-10-10 14:09:03,407 - ERROR    - fhempy.lib.fhem: Timeout - NO RESPONSE for command: readingsBeginUpdate($defs{'Wohnzimmerlautsprecher'});;
2021-10-10 14:09:05,696 - ERROR    - fhempy.lib.fhem: Failed to set result, received: {"error":0,"result":"2021-10-10 14:09:05","awaitId":49825440}
2021-10-10 14:09:32,804 - INFO     - fhempy.lib.pkg_installer: Attempting install of fhempy
2021-10-10 14:10:42,234 - ERROR    - fhempy.lib.pkg_installer: Unable to install package fhempy: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f83b5fe2278>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fhempy/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f83b5fe2048>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fhempy/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f83b64ab080>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fhempy/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f83b64ab0f0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fhempy/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f83b64ab1d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fhempy/
Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/fhempy/ (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f83b64ab320>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
2021-10-10 14:10:42,236 - INFO     - fhempy.lib.pkg_installer: Attempting install of fhempy
2021-10-10 14:10:42,525 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-10-10 14:10:42,532 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-10-10 14:10:52,640 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2021-10-10 14:11:04,061 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1c05c55e80>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.012 seconds
2021-10-10 14:11:14,094 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1c054005f8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.013 seconds
Exception in thread zeroconf-ServiceBrowser-_googlecast._tcp-139758751135488:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_services/browser.py", line 541, in run
    self._fire_service_state_changed_event(event)
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_services/browser.py", line 427, in _fire_service_state_changed_event
    state_change=state_change,
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_services/__init__.py", line 55, in fire
    h(**kwargs)
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_services/browser.py", line 178, in on_change
    getattr(listener, _ON_CHANGE_DISPATCH[state_change])(zeroconf, service_type, name)
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/discovery.py", line 120, in add_service
    self._add_update_service(zconf, typ, name, self._cast_listener.add_cast)
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/discovery.py", line 195, in _add_update_service
    callback(uuid, name)
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/discovery.py", line 66, in add_cast
    self._add_callback(uuid, service)
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/__init__.py", line 254, in add_callback
    timeout=timeout,
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/__init__.py", line 93, in get_chromecast_from_cast_info
    zconf=zconf,
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/__init__.py", line 311, in __init__
    dev_status = get_device_status(host, services, zconf)
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/dial.py", line 116, in get_device_status
    context,
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/dial.py", line 71, in _get_status
    host, _, _ = get_host_from_service(service, zconf)
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/dial.py", line 32, in get_host_from_service
    service_info = zconf.get_service_info("_googlecast._tcp.local.", service.data)
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_core.py", line 490, in get_service_info
    if info.request(self, timeout, question_type):
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_services/info.py", line 437, in request
    return bool(run_coro_with_timeout(self.async_request(zc, timeout, question_type), zc.loop, timeout))
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_utils/asyncio.py", line 96, in run_coro_with_timeout
    millis_to_seconds(timeout) + _LOADED_SYSTEM_TIMEOUT
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 434, in result
    raise TimeoutError()
concurrent.futures._base.TimeoutError

2021-10-10 14:11:24,107 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1c0540e860>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.011 seconds
2021-10-10 14:15:28,755 - INFO     - fhempy.lib.pkg_installer: Attempting install of fhempy
2021-10-10 14:15:41,092 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-10-10 14:15:41,098 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-10-10 14:15:50,839 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2021-10-10 14:16:02,199 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f8ad1284860>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.013 seconds
2021-10-10 14:16:02,214 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2021-10-10 14:16:02,219 - ERROR    - fhempy.lib.fhem_pythonbinding: Connection closed error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 750, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 819, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 895, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 975, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/framing.py", line 55, in read
    data = await reader(2)
  File "/usr/lib/python3.7/asyncio/streams.py", line 677, in readexactly
    raise IncompleteReadError(incomplete, n)
asyncio.streams.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

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

Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 67, in pybinding
    async for message in websocket:
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 356, in __aiter__
    yield await self.recv()
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 421, in recv
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 726, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2021-10-10 14:16:02,220 - INFO     - fhempy.lib.fhem_pythonbinding: Restart binding
2021-10-10 14:16:22,261 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-10-10 14:16:22,267 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-10-10 14:16:33,038 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2021-10-10 14:16:44,353 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff0e17e5da0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.012 seconds
2021-10-10 14:16:54,379 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff0e0f964e0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.008 seconds
Exception in thread zeroconf-ServiceBrowser-_googlecast._tcp-140672970659584:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_services/browser.py", line 541, in run
    self._fire_service_state_changed_event(event)
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_services/browser.py", line 427, in _fire_service_state_changed_event
    state_change=state_change,
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_services/__init__.py", line 55, in fire
    h(**kwargs)
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_services/browser.py", line 178, in on_change
    getattr(listener, _ON_CHANGE_DISPATCH[state_change])(zeroconf, service_type, name)
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/discovery.py", line 120, in add_service
    self._add_update_service(zconf, typ, name, self._cast_listener.add_cast)
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/discovery.py", line 195, in _add_update_service
    callback(uuid, name)
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/discovery.py", line 66, in add_cast
    self._add_callback(uuid, service)
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/__init__.py", line 254, in add_callback
    timeout=timeout,
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/__init__.py", line 93, in get_chromecast_from_cast_info
    zconf=zconf,
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/__init__.py", line 311, in __init__
    dev_status = get_device_status(host, services, zconf)
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/dial.py", line 116, in get_device_status
    context,
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/dial.py", line 71, in _get_status
    host, _, _ = get_host_from_service(service, zconf)
  File "/opt/fhem/.local/lib/python3.7/site-packages/pychromecast/dial.py", line 32, in get_host_from_service
    service_info = zconf.get_service_info("_googlecast._tcp.local.", service.data)
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_core.py", line 490, in get_service_info
    if info.request(self, timeout, question_type):
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_services/info.py", line 437, in request
    return bool(run_coro_with_timeout(self.async_request(zc, timeout, question_type), zc.loop, timeout))
  File "/opt/fhem/.local/lib/python3.7/site-packages/zeroconf/_utils/asyncio.py", line 96, in run_coro_with_timeout
    millis_to_seconds(timeout) + _LOADED_SYSTEM_TIMEOUT
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 434, in result
    raise TimeoutError()
concurrent.futures._base.TimeoutError

2021-10-10 14:17:04,394 - WARNING  - asyncio: Executing <Task finished coro=<googlecast.connect_spotipy() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py:220> exception=ConnectionError(MaxRetryError("HTTPSConnectionPool(host='accounts.spotify.com', port=443): Max retries exceeded with url: /api/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff0e0fa77f0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")) created at /usr/lib/python3.7/asyncio/tasks.py:325> took 10.013 seconds


Edit:
clientid/secret stimmen auch. Wenn also nichts im Log ersichtlich ist ...

dominik

Im Log sind ja einige Fehler mit Name Resolution. Hast du womöglich Probleme mit deinem DNS? Richte mal 8.8.8.8 direkt am FHEM Server als DNS ein und starte danach neu, poste dann bitte ein aktuelles Log.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

Das kann sein, Proplanta macht ja auch einigen Ärger mit 500er-Fehler und nicht erreichbaren Adressen.
Wie kann ich denn am Fhem-Server das DNS einstellen.

Achtung: Bei mir läuft der Fhem-Server ja in einem Docker-Container auf einem NAS.

dominik

Dann musst im Docker irgendwo den DNS setzen. Nachdem ich selbst kein Docker hab, hilft wahrscheinlich Google.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

Danke läuft wieder.
War auch für Proplanta das gleiche Problem gewesen.

thburkhart

Hallo Dominik,

inzwischen habe ich meine 94 Devices kategorisiert und wegen der Lesbarkeit auch umbenannt. Das klappe alles fehlerfrei. Das FHEM machte zwar einige Minuten dicke Backen, aber dann waren alle Devices erfolgreich updedated.

Als Strukturmerkmale verwende ich wie üblich room und groups.
Dein Modul setzt ja wunderschön den Devicenamen lt. SmartLifeApp in alias.
Anregung: bitte ebenso gleich einen Standardroom setzen wie z.B. TUYA; dann erscheinen dort die Devices schön einzeln. (Macht übrigens das MAX-Modul, LaCrosse-Modul auch so)

Herzliche Grüße

Thomas
1 RASPI4B, 1 RASPI3B, 2 CUL, 2 Jeelink, 60 Tuya-Devices (Schalter, Dimmer, Sensoren, Cameras), 30 HUE-Lampen, 5 MAX! WTs, 16 MAX! HTs, 12 MAX! FKs, 1 Bresser 5in1, 1 OilFox, 8 ALEXA Echos und Dots, FHEM, 5 Tasmota-Devices, SonOff -Bridge, PowerFox, Buderus KM200

thburkhart

und dann habe ich noch eine devicespezifische Frage:

ich habe einige sog. Powerstrips, also eine Vierfachsteckdose:
product_id
D7Hl3AxFbHDS98iO

product_name
Smart Power Strip

In der App lassen sich für die einzelnen switches Namen vergeben und sie sind einzeln schaltbar.

Hier die Device Info:

DeviceOverview
PS1 Fernseher Thomas
on
off

PS1
countdown_1
Internals
DEF
tuya_cloud tuya_cloud_connector 63667231dc4f22f32f01
DEVICEID
63667231dc4f22f32f01
FUUID
616325a2-f33f-21fb-0de3-784c7b03eb0e81fb
IODev
local_pybinding
NAME
PS1
NR
1681
PYTHONTYPE
tuya_cloud
STATE
off
TYPE
PythonModule
Readings
active_time
1556280468
2021-10-11 08:22:52
biz_type
18
2021-10-11 08:22:52
category
cz
2021-10-11 08:22:52
countdown_1
0.0
2021-10-11 18:57:00
countdown_2
0.0
2021-10-11 18:57:00
countdown_3
0.0
2021-10-11 18:57:00
countdown_4
0.0
2021-10-11 18:57:00
countdown_usb1
0.0
2021-10-11 18:57:00
create_time
1556280468
2021-10-11 08:22:52
icon
https://images.tuyaeu.com/smart/icon/1504185916_0.png
2021-10-11 08:22:52
id
63667231dc4f22f32f01
2021-10-11 08:22:52
ip
78.43.211.216
2021-10-11 08:22:52
lat
48.5584232
2021-10-11 08:22:52
local_key
565c70fe237fc932
2021-10-11 08:22:52
lon
9.202587
2021-10-11 08:22:52
model
旧PID 废除不用
2021-10-11 08:22:52
name
Fernseher Thomas
2021-10-11 08:22:52
online
on
2021-10-11 08:22:52
owner_id
3389434
2021-10-11 08:22:52
product_id
D7Hl3AxFbHDS98iO
2021-10-11 08:22:52
product_name
Smart Power Strip
2021-10-11 08:22:52
state
off
2021-10-11 18:57:00
sub
off
2021-10-11 08:22:52
switch_2
off
2021-10-11 18:57:00
switch_3
off
2021-10-11 18:57:00
switch_4
off
2021-10-11 18:57:00
switch_usb1
off
2021-10-11 18:57:00
time_zone
+01:00
2021-10-11 08:22:52
uid
eu1548823829280mLHX1
2021-10-11 08:22:52
update_time
1633861658
2021-10-11 08:22:52
uuid
63667231dc4f22f32f01
2021-10-11 08:22:52
PS1
room
TUYA,Thomas
Attributes
alias
PS1 Fernseher Thomas
deleteattr
group
Schalter Fernseher,Schalter Steckdosenleiste
deleteattr
room
TUYA,Thomas
deleteattr


Ähnliches gilt für Mehrfach-Lichtschalter wie:

product_id
shdbwbr7mjjdwu1f

product_name
2G SMART WIFI SWITCH

DeviceOverview
Licht Petra oben
on
off

SCHFF02
countdown_1
Internals
DEF
tuya_cloud tuya_cloud_connector bf3d3c043a37716331bhfb
DEVICEID
bf3d3c043a37716331bhfb
FUUID
6163d81c-f33f-21fb-1fbc-286414737efbe1a6
IODev
local_pybinding
NAME
SCHFF02
NR
1699
PYTHONTYPE
tuya_cloud
STATE
off
TYPE
PythonModule
Readings
active_time
1570793479
2021-10-11 09:15:42
biz_type
18
2021-10-11 09:15:42
category
kg
2021-10-11 09:15:42
countdown_1
0.0
2021-10-11 15:17:49
countdown_2
0.0
2021-10-11 15:17:49
create_time
1570793479
2021-10-11 09:15:42
icon
https://images.tuyaeu.com/smart/program_category_icon/kg.png
2021-10-11 09:15:42
id
bf3d3c043a37716331bhfb
2021-10-11 09:15:42
ip
134.3.57.147
2021-10-11 09:15:42
lat
48.558489
2021-10-11 09:15:42
local_key
0efd0c510b0716ac
2021-10-11 09:15:42
lon
9.2024671
2021-10-11 09:15:42
model
19年2M第二代固件
2021-10-11 09:15:42
name
Petra oben
2021-10-11 09:15:42
online
on
2021-10-11 09:15:42
owner_id
3389434
2021-10-11 09:15:42
product_id
shdbwbr7mjjdwu1f
2021-10-11 09:15:42
product_name
2G SMART WIFI SWITCH
2021-10-11 09:15:42
state
off
2021-10-11 15:17:49
sub
off
2021-10-11 09:15:42
switch_2
off
2021-10-11 15:17:49
time_zone
+02:00
2021-10-11 09:15:42
uid
eu1548823829280mLHX1
2021-10-11 09:15:42
update_time
1633906872
2021-10-11 09:15:42
uuid
e31c888da5d4765f
2021-10-11 09:15:42




Ist das ähnlich wie in der App realisierbar?
1 RASPI4B, 1 RASPI3B, 2 CUL, 2 Jeelink, 60 Tuya-Devices (Schalter, Dimmer, Sensoren, Cameras), 30 HUE-Lampen, 5 MAX! WTs, 16 MAX! HTs, 12 MAX! FKs, 1 Bresser 5in1, 1 OilFox, 8 ALEXA Echos und Dots, FHEM, 5 Tasmota-Devices, SonOff -Bridge, PowerFox, Buderus KM200