Neues Modul: EQ3 Bluetooth Thermostat (10_EQ3BT)

Begonnen von dominik, 12 November 2016, 11:45:15

Vorheriges Thema - Nächstes Thema

dominik

Ich habe den Fehler gefunden.

Bitte aus dem Ordner fhem_pythonbinding starten und NICHT aus fhem_pythonbinding/FHEM
python3 FHEM/bindings/python/pythonbinding.py

Dann klappt es auch mit den Installationen.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

mele

Guten Morgen,

habs heute Morgen nochmal probiert - leider mit Fehler/Absturz Hauptsystem.

Kann es sein, das da ein Berechtigungsproblem besteht? Auf dem Remote gibt es keinen user fhem.

Log der Remote-Konsole:
pi@raspberrypi:~/fhem_pythonbinding $ python3 FHEM/bindings/python/pythonbinding.py
2020-10-13 06:22:38,603 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-10-13 06:22:44,081 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 192.168.178.232
2020-10-13 06:23:39,377 - ERROR    - lib.fhem_pythonbinding: Connection closed error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 41, in pybinding
    async for message in websocket:
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 439, in __aiter__
    yield await self.recv()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 509, in recv
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2020-10-13 06:23:39,383 - INFO     - lib.fhem_pythonbinding: Waiting for new FHEM connection...
2020-10-13 06:23:43,547 - ERROR    - lib.fhem: Connection closed, can't send message.
^CTraceback (most recent call last):
  File "FHEM/bindings/python/pythonbinding.py", line 5, in <module>
    fpb.run()
  File "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 259, in run
    asyncio.get_event_loop().run_forever()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
    self._run_once()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/lib/python3.7/selectors.py", line 468, in select
    fd_event_list = self._selector.poll(timeout, max_ev)


Trotz "globaler" verbose 5 kann ich leider nichts im Log finden. Vielleicht habe ich das auch an der falschen Stelle gesetzt?!?
FHEM auf NUC/Proxmox (Rpi 2 / Rpi Zero W mit FHEM2FHEM, RFHEM)
Homematic/LaCrosse/PCA301/Shelly, Rollladen, Batterieaktor + Relais zur Schaltung Garagentor (Promatic 2), Xiaomi FlowerSens, Bewässerungssteuerung Garten und Gewächshaus, Weatherman und Landroid

dominik

Hi,
starte bitte fhem_pythonbinding am Remote einfach nochmals neu.

Dieser Fehler fuehrt leider noch dazu, dass danach keine Kommunikation mit FHEM mehr moeglich ist. Ich muss den Ursprung des Fehlers noch finden.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Master_Nick

Hey dominik,

ich hab beim update nun immer das hier mit drin:

New entries in the CHANGED file:
404: Not Found

Fehlt da bei dir im Repo ne Datei, die FHEM erwartet? :-)
Rancher K8s Cluster mit nanoCUL (a-culfw) | IObroker | IT(V1&V3), IT-PIR, THGR122NX |Co² | alexa-fhem | WOL | NFC | Harmony UltimateHub | Anwesenheitserkennnung | Roomba | 10" Touch mit Node-Red | SonOff S20 | SonOff Touch | SonOff Dual | Rolladen | Und ganz viel anderes tolles Gerödel.... ;-)

Teonyr

Hallo,

den Fehler von Master_Nick habe ich auch im Log beim Update, aber scheint erstmal (zumindest bei mir) nichts weiter kaputtgemacht zu haben.
Im Gegenteil:
Meine Heizungen, die seit dem letzten Update auf "offline / update" standen (laut log konnte wohl keine Verbindung aufgebaut werden), funktionieren wieder und haben sogar ein tolles Icon bekommen. :D

mele

Hallo zusammen,

ich habe es jetzt noch zweimal probiert - Ergebnis:

pi@raspberrypi:~ $ cd fhem_pythonbinding
pi@raspberrypi:~/fhem_pythonbinding $ python3 FHEM/bindings/python/pythonbinding                                                                                                                                                             .py
2020-10-14 16:09:06,542 - INFO     - lib.fhem_pythonbinding: Starting pythonbind                                                                                                                                                             ing...
2020-10-14 16:09:15,538 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 192.168.178.232
2020-10-14 16:10:22,371 - ERROR    - dbus.proxies: Introspect error on :1.3:/: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.13711" (uid=1000 pid=32404 comm="python3 FHEM/bindings/python/pythonbinding.py ") interface="org.freedesktop.DBus.Introspectable" member="Introspect" error name="(unset)" requested_reply="0" destination=":1.3" (uid=0 pid=7232 comm="/usr/lib/bluetooth/bluetoothd ")
2020-10-14 16:10:22,373 - ERROR    - eq3device_WC: Please add following configuration to /etc/dbus-1/system.d/bluetooth.conf:
                         <policy user="fhem">
                             <allow own="org.bluez"/>
                             <allow send_destination="org.bluez"/>
                             <allow send_interface="org.bluez.GattCharacteristic1"/>
                             <allow send_interface="org.bluez.GattDescriptor1"/>
                             <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
                             <allow send_interface="org.freedesktop.DBus.Properties"/>
                         </policy>
                         Restart dbus afterwards: sudo systemctl restart dbus
2020-10-14 16:10:32,131 - ERROR    - lib.fhem_pythonbinding: Connection closed error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 41, in pybinding
    async for message in websocket:
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 439, in __aiter__
    yield await self.recv()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 509, in recv
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2020-10-14 16:10:32,141 - INFO     - lib.fhem_pythonbinding: Waiting for new FHEM connection...
^CTraceback (most recent call last):
  File "FHEM/bindings/python/pythonbinding.py", line 5, in <module>
    fpb.run()
  File "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 259, in run
    asyncio.get_event_loop().run_forever()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
    self._run_once()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/lib/python3.7/selectors.py", line 468, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt
pi@raspberrypi:~/fhem_pythonbinding $ sudo nano /etc/dbus-1/system.d/bluetooth.conf
pi@raspberrypi:~/fhem_pythonbinding $ sudo nano /etc/dbus-1/system.d/bluetooth.conf
pi@raspberrypi:~/fhem_pythonbinding $ sudo nano /etc/dbus-1/system.d/bluetooth.conf
pi@raspberrypi:~/fhem_pythonbinding $ sudo systemctl restart dbus
pi@raspberrypi:~/fhem_pythonbinding $ python3 FHEM/bindings/python/pythonbinding.py
2020-10-14 16:13:35,935 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-10-14 16:13:36,054 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 192.168.178.232
2020-10-14 16:15:35,124 - ERROR    - eq3device_WC: Please add following configuration to /etc/dbus-1/system.d/bluetooth.conf:
                         <policy user="fhem">
                             <allow own="org.bluez"/>
                             <allow send_destination="org.bluez"/>
                             <allow send_interface="org.bluez.GattCharacteristic1"/>
                             <allow send_interface="org.bluez.GattDescriptor1"/>
                             <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
                             <allow send_interface="org.freedesktop.DBus.Properties"/>
                         </policy>
                         Restart dbus afterwards: sudo systemctl restart dbus
2020-10-14 16:15:35,140 - ERROR    - lib.fhem_pythonbinding: Failed to handle message:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 249, in onMessage
    await self.sendBackReturn(hash, ret)
  File "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 68, in sendBackReturn
    await self.wsconnection.send(msg)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 555, in send
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2020-10-14 16:15:35,143 - ERROR    - lib.fhem: Connection closed, can't send message.
2020-10-14 16:15:35,145 - ERROR    - lib.fhem_pythonbinding: Connection closed error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 41, in pybinding
    async for message in websocket:
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 439, in __aiter__
    yield await self.recv()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 509, in recv
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2020-10-14 16:15:35,147 - INFO     - lib.fhem_pythonbinding: Waiting for new FHEM connection...
2020-10-14 16:15:35,149 - ERROR    - lib.fhem_pythonbinding: Failed to handle message:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 249, in onMessage
    await self.sendBackReturn(hash, ret)
  File "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 68, in sendBackReturn
    await self.wsconnection.send(msg)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 555, in send
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2020-10-14 16:15:35,152 - ERROR    - lib.fhem_pythonbinding: Failed to handle message:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 249, in onMessage
    await self.sendBackReturn(hash, ret)
  File "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 68, in sendBackReturn
    await self.wsconnection.send(msg)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 555, in send
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2020-10-14 16:15:50,152 - ERROR    - lib.fhem: Timeout - NO RESPONSE for command: readingsSingleUpdate($defs{'eq3device_WC'},'state','Failed to execute function Set: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 228, in onMessage
    await self.updateHash(hash)
  File "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 88, in updateHash
    await self.wsconnection.send(msg)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 555, in send
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
',1)


Vor dem zweiten Versuche habe ich die /etc/dbus-1/system.d/bluetooth.conf nochmal angepasst und die BT-Berechtigung für root auskommentiert:

<!-- This configuration file specifies the required security policies
     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

<!--  <policy user="root">
    <allow own="org.bluez"/>
    <allow send_destination="org.bluez"/>
    <allow send_interface="org.bluez.Agent1"/>
    <allow send_interface="org.bluez.MediaEndpoint1"/>
    <allow send_interface="org.bluez.MediaPlayer1"/>
    <allow send_interface="org.bluez.Profile1"/>
    <allow send_interface="org.bluez.GattCharacteristic1"/>
    <allow send_interface="org.bluez.GattDescriptor1"/>
    <allow send_interface="org.bluez.LEAdvertisement1"/>
    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
    <allow send_interface="org.freedesktop.DBus.Properties"/>
  </policy>
-->
                        <policy user="fhem">
                            <allow own="org.bluez"/>
                            <allow send_destination="org.bluez"/>
                            <allow send_interface="org.bluez.GattCharacteristic1"/>
                            <allow send_interface="org.bluez.GattDescriptor1"/>
                            <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
                            <allow send_interface="org.freedesktop.DBus.Properties"/>
                        </policy>

  <!-- allow users of bluetooth group to communicate -->
  <policy group="bluetooth">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy at_console="true">
    <allow send_destination="org.bluez"/>
  </policy>

  <!-- allow users of lp group (printing subsystem) to
       communicate with bluetoothd -->
  <policy group="lp">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy context="default">
    <deny send_destination="org.bluez"/>
  </policy>

</busconfig>


Nochmal das Thema Rechte: Auf dem Remote gibt es keinen User fhem - natürlich auch kein FHEM installiert, aber vielleicht benötigt es einen entsprechenden User?

Danke und Gruß

Manuel :-\
FHEM auf NUC/Proxmox (Rpi 2 / Rpi Zero W mit FHEM2FHEM, RFHEM)
Homematic/LaCrosse/PCA301/Shelly, Rollladen, Batterieaktor + Relais zur Schaltung Garagentor (Promatic 2), Xiaomi FlowerSens, Bewässerungssteuerung Garten und Gewächshaus, Weatherman und Landroid

dominik

Der Fehler beim Update ist nicht weiter tragisch. Ich habe noch kein CHANGED File angelegt wo Changes dokumentiert werden, daher kommt die 404 Fehlermeldung. Das hat aber keine Auswirkung.

@mele, ja, du hast Recht, das hatte ich uebersehen. Bitte die Bluetooth Berechtigung von "fhem" auf "pi" aendern. Es muss der User drin stehen der fhem_pythonbinding ausfuehrt.
Danach einfach fhem_pythonbinding von der Konsole nochmals starten.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

mele

Hat leider nichts gebracht:

pi@raspberrypi:~/fhem_pythonbinding $ sudo nano /etc/dbus-1/system.d/bluetooth.conf
pi@raspberrypi:~/fhem_pythonbinding $ sudo systemctl restart dbus
pi@raspberrypi:~/fhem_pythonbinding $ python3 FHEM/bindings/python/pythonbinding.py
2020-10-14 17:12:22,271 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-10-14 17:12:24,170 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 192.168.178.232
2020-10-14 17:13:31,482 - ERROR    - eq3device_WC: Please add following configuration to /etc/dbus-1/system.d/bluetooth.conf:
                         <policy user="fhem">
                             <allow own="org.bluez"/>
                             <allow send_destination="org.bluez"/>
                             <allow send_interface="org.bluez.GattCharacteristic1"/>
                             <allow send_interface="org.bluez.GattDescriptor1"/>
                             <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
                             <allow send_interface="org.freedesktop.DBus.Properties"/>
                         </policy>
                         Restart dbus afterwards: sudo systemctl restart dbus
2020-10-14 17:13:31,489 - ERROR    - lib.fhem_pythonbinding: Connection closed error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 41, in pybinding
    async for message in websocket:
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 439, in __aiter__
    yield await self.recv()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 509, in recv
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2020-10-14 17:13:31,498 - INFO     - lib.fhem_pythonbinding: Waiting for new FHEM connection...
2020-10-14 17:13:31,500 - ERROR    - lib.fhem_pythonbinding: Failed to handle message:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 249, in onMessage
    await self.sendBackReturn(hash, ret)
  File "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 68, in sendBackReturn
    await self.wsconnection.send(msg)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 555, in send
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2020-10-14 17:13:31,503 - ERROR    - lib.fhem_pythonbinding: Failed to handle message:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 249, in onMessage
    await self.sendBackReturn(hash, ret)
  File "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 68, in sendBackReturn
    await self.wsconnection.send(msg)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 555, in send
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2020-10-14 17:13:31,506 - ERROR    - lib.fhem_pythonbinding: Failed to handle message:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 249, in onMessage
    await self.sendBackReturn(hash, ret)
  File "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 68, in sendBackReturn
    await self.wsconnection.send(msg)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 555, in send
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason


/etc/dbus-1/system.d/bluetooth.conf:

<!-- This configuration file specifies the required security policies
     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

<!--  <policy user="root">
    <allow own="org.bluez"/>
    <allow send_destination="org.bluez"/>
    <allow send_interface="org.bluez.Agent1"/>
    <allow send_interface="org.bluez.MediaEndpoint1"/>
    <allow send_interface="org.bluez.MediaPlayer1"/>
    <allow send_interface="org.bluez.Profile1"/>
    <allow send_interface="org.bluez.GattCharacteristic1"/>
    <allow send_interface="org.bluez.GattDescriptor1"/>
    <allow send_interface="org.bluez.LEAdvertisement1"/>
    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
    <allow send_interface="org.freedesktop.DBus.Properties"/>
  </policy>
-->
                        <policy user="pi">
                            <allow own="org.bluez"/>
                            <allow send_destination="org.bluez"/>
                            <allow send_interface="org.bluez.GattCharacteristic1"/>
                            <allow send_interface="org.bluez.GattDescriptor1"/>
                            <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
                            <allow send_interface="org.freedesktop.DBus.Properties"/>
                        </policy>

  <!-- allow users of bluetooth group to communicate -->
  <policy group="bluetooth">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy at_console="true">
    <allow send_destination="org.bluez"/>
  </policy>

  <!-- allow users of lp group (printing subsystem) to
       communicate with bluetoothd -->
  <policy group="lp">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy context="default">
    <deny send_destination="org.bluez"/>
  </policy>

</busconfig>
FHEM auf NUC/Proxmox (Rpi 2 / Rpi Zero W mit FHEM2FHEM, RFHEM)
Homematic/LaCrosse/PCA301/Shelly, Rollladen, Batterieaktor + Relais zur Schaltung Garagentor (Promatic 2), Xiaomi FlowerSens, Bewässerungssteuerung Garten und Gewächshaus, Weatherman und Landroid

dominik

Aktiviere bitte wieder den "root" Teil in der bluetooth.conf, ich denke root braucht auch Zugriff. Rest sieht alles gut aus, ist exakt gleich wie bei mir.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

mele

Geht immer noch nicht, aber es kam ein anderer Fehler. Man sieht auch, dass der definierte Name übertragen wird.

FHEM ist wieder nicht erreichbar und hat von alleine neu gestartet.

Ganz unten ist eine Fehlermeldung hierzu erkennbar:
readingsSingleUpdate($defs{'eq3device_WC'},'presence','offline',1)

Ist eq3device_WC (Devicename) richtig, ober müsste da die MAC rein?

pi@raspberrypi:~/fhem_pythonbinding $ sudo nano /etc/dbus-1/system.d/bluetooth.conf
pi@raspberrypi:~/fhem_pythonbinding $ sudo systemctl restart dbus
pi@raspberrypi:~/fhem_pythonbinding $ python3 FHEM/bindings/python/pythonbinding.py
2020-10-14 18:16:00,321 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-10-14 18:16:10,084 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 192.168.178.232
2020-10-14 18:16:53,381 - ERROR    - lib.fhem_pythonbinding: Connection closed error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 41, in pybinding
    async for message in websocket:
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 439, in __aiter__
    yield await self.recv()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 509, in recv
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2020-10-14 18:16:53,401 - INFO     - lib.fhem_pythonbinding: Waiting for new FHEM connection...
2020-10-14 18:18:15,647 - ERROR    - lib.fhem: Connection closed, can't send message.
2020-10-14 18:18:30,662 - ERROR    - lib.fhem: Timeout - NO RESPONSE for command: readingsSingleUpdate($defs{'eq3device_WC'},'presence','offline',1)
2020-10-14 18:18:30,664 - ERROR    - lib.fhem: Connection closed, can't send message.
2020-10-14 18:18:45,680 - ERROR    - lib.fhem: Timeout - NO RESPONSE for command: readingsSingleUpdate($defs{'eq3device_WC'},'state','update',1)
2020-10-14 18:18:50,839 - ERROR    - lib.fhem: Connection closed, can't send message.
2020-10-14 18:19:05,855 - ERROR    - lib.fhem: Timeout - NO RESPONSE for command: readingsBeginUpdate($defs{'eq3device_WC'});;
2020-10-14 18:19:05,857 - ERROR    - lib.fhem: Connection closed, can't send message.


/etc/dbus-1/system.d/bluetooth.conf:

<!-- This configuration file specifies the required security policies
     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

  <policy user="root">
    <allow own="org.bluez"/>
    <allow send_destination="org.bluez"/>
    <allow send_interface="org.bluez.Agent1"/>
    <allow send_interface="org.bluez.MediaEndpoint1"/>
    <allow send_interface="org.bluez.MediaPlayer1"/>
    <allow send_interface="org.bluez.Profile1"/>
    <allow send_interface="org.bluez.GattCharacteristic1"/>
    <allow send_interface="org.bluez.GattDescriptor1"/>
    <allow send_interface="org.bluez.LEAdvertisement1"/>
    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
    <allow send_interface="org.freedesktop.DBus.Properties"/>
  </policy>

                        <policy user="pi">
                            <allow own="org.bluez"/>
                            <allow send_destination="org.bluez"/>
                            <allow send_interface="org.bluez.GattCharacteristic1"/>
                            <allow send_interface="org.bluez.GattDescriptor1"/>
                            <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
                            <allow send_interface="org.freedesktop.DBus.Properties"/>
                        </policy>

  <!-- allow users of bluetooth group to communicate -->
  <policy group="bluetooth">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy at_console="true">
    <allow send_destination="org.bluez"/>
  </policy>

  <!-- allow users of lp group (printing subsystem) to
       communicate with bluetoothd -->
  <policy group="lp">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy context="default">
    <deny send_destination="org.bluez"/>
  </policy>

</busconfig>
FHEM auf NUC/Proxmox (Rpi 2 / Rpi Zero W mit FHEM2FHEM, RFHEM)
Homematic/LaCrosse/PCA301/Shelly, Rollladen, Batterieaktor + Relais zur Schaltung Garagentor (Promatic 2), Xiaomi FlowerSens, Bewässerungssteuerung Garten und Gewächshaus, Weatherman und Landroid

dominik

Sieht nun zumindest besser aus. Hast du vielleicht noch irgendeine Firewall oder iptables Einstellungen die eine Kommunikation zwischen den beiden RPis verhindert?

Der Fehler liegt am "Connection closed error", das ist mir im Moment nicht klar wieso die Verbindung geschlossen wird. Aktualisiere sicherheitshalber auch nochmals mit "git pull" am Remote in fhem_pythonbinding Verzeichnis die Module, daran liegt es aber glaube ich nicht.

Ändere danach bitte in FHEM/bindings/python/lib/fhem_pythonbinding.py das Logging:
logging.basicConfig(format='%(asctime)s - %(levelname)-8s - %(name)s: %(message)s', level=logging.INFO)
ändern auf
logging.basicConfig(format='%(asctime)s - %(levelname)-8s - %(name)s: %(message)s', level=logging.DEBUG)
Bitte poste dann nochmals das Log.
Danke dir für deine Tests!
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

mele

Hi,

die Einstellingen wie iptables oder so sind mir nicht bewusst. Remote und Haupt-FHEM sind per ssh verbunden und die Verbindung klappt. Hier das Log nach Änderung des logging Eintrags:

pi@raspberrypi:~/fhem_pythonbinding $ sudo nano FHEM/bindings/python/lib/fhem_pythonbinding.py
pi@raspberrypi:~/fhem_pythonbinding $ python3 FHEM/bindings/python/pythonbinding.py
2020-10-14 19:47:45,050 - DEBUG    - asyncio: Using selector: EpollSelector
2020-10-14 19:47:45,052 - INFO     - lib.fhem_pythonbinding: Starting pythonbinding...
2020-10-14 19:47:53,172 - DEBUG    - websockets.protocol: server - state = CONNECTING
2020-10-14 19:47:53,173 - DEBUG    - websockets.protocol: server - event = connection_made(<_SelectorSocketTransport fd=7 read=idle write=<idle, bufsize=0>>)
2020-10-14 19:47:53,174 - DEBUG    - websockets.protocol: server - event = data_received(<209 bytes>)
2020-10-14 19:47:53,175 - DEBUG    - websockets.server: server < GET / HTTP/1.1
2020-10-14 19:47:53,175 - DEBUG    - websockets.server: server < Headers([('Host', '192.168.178.156:15733'), ('User-Agent', 'fhem'), ('Accept-Encoding', 'gzip,deflate'), ('Sec-WebSocket-Key', 'oQBFP/kuQkFttqww9II/TQ=='), ('Connection', 'Upgrade'), ('Upgrade', 'websocket'), ('Sec-WebSocket-Version', '13')])
2020-10-14 19:47:53,177 - DEBUG    - websockets.server: server > HTTP/1.1 101 Switching Protocols
2020-10-14 19:47:53,178 - DEBUG    - websockets.server: server > Headers([('Upgrade', 'websocket'), ('Connection', 'Upgrade'), ('Sec-WebSocket-Accept', 'txm2yG1+1gDlZxDqYxqSFsHEzuk='), ('Date', 'Wed, 14 Oct 2020 18:47:53 GMT'), ('Server', 'Python/3.7 websockets/8.1')])
2020-10-14 19:47:53,178 - DEBUG    - websockets.protocol: server - state = OPEN
2020-10-14 19:47:53,179 - INFO     - lib.fhem_pythonbinding: FHEM connection started: 192.168.178.232
2020-10-14 19:48:09,070 - DEBUG    - websockets.protocol: server - event = data_received(<246 bytes>)
2020-10-14 19:48:09,072 - DEBUG    - websockets.protocol: server < Frame(fin=True, opcode=1, data=b'{"PYTHONTYPE":"eq3bt","argsh":{},"args":["set","eq3device_WC","room","test"],"function":"Attr","defargs":["eq3device_WC","PythonModule","eq3bt","00:1A:22:0C:79:CF"],"msgtype":"function","id":"28359558","defargsh":{},"NAME":"eq3device_WC"}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:09,073 - DEBUG    - lib.fhem_pythonbinding: >>> WS: {"PYTHONTYPE":"eq3bt","argsh":{},"args":["set","eq3device_WC","room","test"],"function":"Attr","defargs":["eq3device_WC","PythonModule","eq3bt","00:1A:22:0C:79:CF"],"msgtype":"function","id":"28359558","defargsh":{},"NAME":"eq3device_WC"}
2020-10-14 19:48:09,074 - DEBUG    - lib.fhem_pythonbinding: <<< WS: {"PYTHONTYPE": "eq3bt", "argsh": {}, "args": ["set", "eq3device_WC", "room", "test"], "function": "Attr", "defargs": ["eq3device_WC", "PythonModule", "eq3bt", "00:1A:22:0C:79:CF"], "msgtype": "function", "id": "28359558", "defargsh": {}, "NAME": "eq3device_WC", "finished": 1, "returnval": ""}
2020-10-14 19:48:09,075 - DEBUG    - websockets.protocol: server > Frame(fin=True, opcode=1, data=b'{"PYTHONTYPE": "eq3bt", "argsh": {}, "args": ["set", "eq3device_WC", "room", "test"], "function": "Attr", "defargs": ["eq3device_WC", "PythonModule", "eq3bt", "00:1A:22:0C:79:CF"], "msgtype": "function", "id": "28359558", "defargsh": {}, "NAME": "eq3device_WC", "finished": 1, "returnval": ""}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:09,325 - DEBUG    - websockets.protocol: server > Frame(fin=True, opcode=1, data=b'{"awaitId": 21558164, "NAME": "eq3device_WC", "msgtype": "command", "command": "AttrVal(\'eq3device_WC\', \'verbose\', \'3\')"}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:09,327 - DEBUG    - websockets.protocol: server - event = data_received(<49 bytes>)
2020-10-14 19:48:09,328 - DEBUG    - websockets.protocol: server < Frame(fin=True, opcode=1, data=b'{"error":0,"result":"3","awaitId":21558164}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:09,329 - DEBUG    - lib.fhem_pythonbinding: >>> WS: {"error":0,"result":"3","awaitId":21558164}
2020-10-14 19:48:09,330 - DEBUG    - websockets.protocol: server > Frame(fin=True, opcode=1, data=b'{"awaitId": 59372465, "NAME": "eq3device_WC", "msgtype": "command", "command": "AttrVal(\'eq3device_WC\', \'icon\', \'\')"}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:09,332 - DEBUG    - websockets.protocol: server - event = data_received(<48 bytes>)
2020-10-14 19:48:09,333 - DEBUG    - websockets.protocol: server < Frame(fin=True, opcode=1, data=b'{"awaitId":59372465,"error":0,"result":""}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:09,334 - DEBUG    - lib.fhem_pythonbinding: >>> WS: {"awaitId":59372465,"error":0,"result":""}
2020-10-14 19:48:09,335 - DEBUG    - websockets.protocol: server > Frame(fin=True, opcode=1, data=b'{"awaitId": 32367077, "NAME": "eq3device_WC", "msgtype": "command", "command": "CommandAttr(undef, \\"icon sani_heating_temp\\")"}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:09,337 - DEBUG    - websockets.protocol: server - event = data_received(<103 bytes>)
2020-10-14 19:48:09,337 - DEBUG    - websockets.protocol: server < Frame(fin=True, opcode=1, data=b'{"awaitId":32367077,"error":0,"result":"attr icon sani_heating_temp: attribute value is missing"}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:09,338 - DEBUG    - lib.fhem_pythonbinding: >>> WS: {"awaitId":32367077,"error":0,"result":"attr icon sani_heating_temp: attribute value is missing"}
2020-10-14 19:48:09,340 - DEBUG    - websockets.protocol: server > Frame(fin=True, opcode=1, data=b'{"awaitId": 64538320, "NAME": "eq3device_WC", "msgtype": "command", "command": "readingsSingleUpdate($defs{\'eq3device_WC\'},\'presence\',\'offline\',1)"}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:09,343 - DEBUG    - websockets.protocol: server - event = data_received(<65 bytes>)
2020-10-14 19:48:09,344 - DEBUG    - websockets.protocol: server < Frame(fin=True, opcode=1, data=b'{"awaitId":64538320,"result":"presence: offline","error":0}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:09,345 - DEBUG    - lib.fhem_pythonbinding: >>> WS: {"awaitId":64538320,"result":"presence: offline","error":0}
2020-10-14 19:48:09,346 - DEBUG    - websockets.protocol: server > Frame(fin=True, opcode=1, data=b'{"awaitId": 63294273, "NAME": "eq3device_WC", "msgtype": "command", "command": "readingsSingleUpdate($defs{\'eq3device_WC\'},\'state\',\'connecting\',1)"}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:09,349 - DEBUG    - websockets.protocol: server - event = data_received(<58 bytes>)
2020-10-14 19:48:09,350 - DEBUG    - websockets.protocol: server < Frame(fin=True, opcode=1, data=b'{"error":0,"result":"connecting","awaitId":63294273}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:09,351 - DEBUG    - lib.fhem_pythonbinding: >>> WS: {"error":0,"result":"connecting","awaitId":63294273}
2020-10-14 19:48:13,772 - DEBUG    - websockets.protocol: server - event = data_received(<229 bytes>)
2020-10-14 19:48:13,773 - DEBUG    - websockets.protocol: server < Frame(fin=True, opcode=1, data=b'{"NAME":"eq3device_WC","defargsh":{},"msgtype":"function","defargs":["eq3device_WC","PythonModule","eq3bt","00:1A:22:0C:79:CF"],"id":"39798918","function":"Set","PYTHONTYPE":"eq3bt","args":["eq3device_WC","?"],"argsh":{}}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:13,775 - DEBUG    - lib.fhem_pythonbinding: >>> WS: {"NAME":"eq3device_WC","defargsh":{},"msgtype":"function","defargs":["eq3device_WC","PythonModule","eq3bt","00:1A:22:0C:79:CF"],"id":"39798918","function":"Set","PYTHONTYPE":"eq3bt","args":["eq3device_WC","?"],"argsh":{}}
2020-10-14 19:48:13,776 - DEBUG    - lib.fhem_pythonbinding: Start function eq3device_WC:Set
2020-10-14 19:48:13,777 - DEBUG    - lib.fhem_pythonbinding: End function eq3device_WC:Set
2020-10-14 19:48:13,778 - DEBUG    - lib.fhem_pythonbinding: <<< WS: {"NAME": "eq3device_WC", "defargsh": {}, "msgtype": "function", "defargs": ["eq3device_WC", "PythonModule", "eq3bt", "00:1A:22:0C:79:CF"], "id": "39798918", "function": "Set", "PYTHONTYPE": "eq3bt", "args": ["eq3device_WC", "?"], "argsh": {}, "finished": 1, "returnval": "Unknown argument ?, choose one of on:noArg off:noArg desiredTemperature:slider,4.5,0.5,29.5,1 updateStatus:noArg boost:on,off mode:manual,automatic eco:noArg comfort:noArg childlock:on,off"}
2020-10-14 19:48:13,779 - DEBUG    - websockets.protocol: server > Frame(fin=True, opcode=1, data=b'{"NAME": "eq3device_WC", "defargsh": {}, "msgtype": "function", "defargs": ["eq3device_WC", "PythonModule", "eq3bt", "00:1A:22:0C:79:CF"], "id": "39798918", "function": "Set", "PYTHONTYPE": "eq3bt", "args": ["eq3device_WC", "?"], "argsh": {}, "finished": 1, "returnval": "Unknown argument ?, choose one of on:noArg off:noArg desiredTemperature:slider,4.5,0.5,29.5,1 updateStatus:noArg boost:on,off mode:manual,automatic eco:noArg comfort:noArg childlock:on,off"}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:15,333 - DEBUG    - websockets.protocol: server - event = data_received(<229 bytes>)
2020-10-14 19:48:15,334 - DEBUG    - websockets.protocol: server < Frame(fin=True, opcode=1, data=b'{"NAME":"eq3device_WC","defargsh":{},"id":"28732100","defargs":["eq3device_WC","PythonModule","eq3bt","00:1A:22:0C:79:CF"],"msgtype":"function","function":"Set","PYTHONTYPE":"eq3bt","args":["eq3device_WC","?"],"argsh":{}}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:15,336 - DEBUG    - lib.fhem_pythonbinding: >>> WS: {"NAME":"eq3device_WC","defargsh":{},"id":"28732100","defargs":["eq3device_WC","PythonModule","eq3bt","00:1A:22:0C:79:CF"],"msgtype":"function","function":"Set","PYTHONTYPE":"eq3bt","args":["eq3device_WC","?"],"argsh":{}}
2020-10-14 19:48:15,337 - DEBUG    - lib.fhem_pythonbinding: Start function eq3device_WC:Set
2020-10-14 19:48:15,338 - DEBUG    - lib.fhem_pythonbinding: End function eq3device_WC:Set
2020-10-14 19:48:15,339 - DEBUG    - lib.fhem_pythonbinding: <<< WS: {"NAME": "eq3device_WC", "defargsh": {}, "id": "28732100", "defargs": ["eq3device_WC", "PythonModule", "eq3bt", "00:1A:22:0C:79:CF"], "msgtype": "function", "function": "Set", "PYTHONTYPE": "eq3bt", "args": ["eq3device_WC", "?"], "argsh": {}, "finished": 1, "returnval": "Unknown argument ?, choose one of on:noArg off:noArg desiredTemperature:slider,4.5,0.5,29.5,1 updateStatus:noArg boost:on,off mode:manual,automatic eco:noArg comfort:noArg childlock:on,off"}
2020-10-14 19:48:15,339 - DEBUG    - websockets.protocol: server > Frame(fin=True, opcode=1, data=b'{"NAME": "eq3device_WC", "defargsh": {}, "id": "28732100", "defargs": ["eq3device_WC", "PythonModule", "eq3bt", "00:1A:22:0C:79:CF"], "msgtype": "function", "function": "Set", "PYTHONTYPE": "eq3bt", "args": ["eq3device_WC", "?"], "argsh": {}, "finished": 1, "returnval": "Unknown argument ?, choose one of on:noArg off:noArg desiredTemperature:slider,4.5,0.5,29.5,1 updateStatus:noArg boost:on,off mode:manual,automatic eco:noArg comfort:noArg childlock:on,off"}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:15,342 - DEBUG    - websockets.protocol: server - event = data_received(<229 bytes>)
2020-10-14 19:48:15,343 - DEBUG    - websockets.protocol: server < Frame(fin=True, opcode=1, data=b'{"NAME":"eq3device_WC","defargsh":{},"defargs":["eq3device_WC","PythonModule","eq3bt","00:1A:22:0C:79:CF"],"msgtype":"function","id":"11234299","function":"Set","PYTHONTYPE":"eq3bt","args":["eq3device_WC","?"],"argsh":{}}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:15,345 - DEBUG    - lib.fhem_pythonbinding: >>> WS: {"NAME":"eq3device_WC","defargsh":{},"defargs":["eq3device_WC","PythonModule","eq3bt","00:1A:22:0C:79:CF"],"msgtype":"function","id":"11234299","function":"Set","PYTHONTYPE":"eq3bt","args":["eq3device_WC","?"],"argsh":{}}
2020-10-14 19:48:15,346 - DEBUG    - lib.fhem_pythonbinding: Start function eq3device_WC:Set
2020-10-14 19:48:15,347 - DEBUG    - lib.fhem_pythonbinding: End function eq3device_WC:Set
2020-10-14 19:48:15,348 - DEBUG    - lib.fhem_pythonbinding: <<< WS: {"NAME": "eq3device_WC", "defargsh": {}, "defargs": ["eq3device_WC", "PythonModule", "eq3bt", "00:1A:22:0C:79:CF"], "msgtype": "function", "id": "11234299", "function": "Set", "PYTHONTYPE": "eq3bt", "args": ["eq3device_WC", "?"], "argsh": {}, "finished": 1, "returnval": "Unknown argument ?, choose one of on:noArg off:noArg desiredTemperature:slider,4.5,0.5,29.5,1 updateStatus:noArg boost:on,off mode:manual,automatic eco:noArg comfort:noArg childlock:on,off"}
2020-10-14 19:48:15,348 - DEBUG    - websockets.protocol: server > Frame(fin=True, opcode=1, data=b'{"NAME": "eq3device_WC", "defargsh": {}, "defargs": ["eq3device_WC", "PythonModule", "eq3bt", "00:1A:22:0C:79:CF"], "msgtype": "function", "id": "11234299", "function": "Set", "PYTHONTYPE": "eq3bt", "args": ["eq3device_WC", "?"], "argsh": {}, "finished": 1, "returnval": "Unknown argument ?, choose one of on:noArg off:noArg desiredTemperature:slider,4.5,0.5,29.5,1 updateStatus:noArg boost:on,off mode:manual,automatic eco:noArg comfort:noArg childlock:on,off"}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:15,351 - DEBUG    - websockets.protocol: server - event = data_received(<229 bytes>)
2020-10-14 19:48:15,352 - DEBUG    - websockets.protocol: server < Frame(fin=True, opcode=1, data=b'{"defargsh":{},"NAME":"eq3device_WC","function":"Get","PYTHONTYPE":"eq3bt","argsh":{},"args":["eq3device_WC","?"],"msgtype":"function","defargs":["eq3device_WC","PythonModule","eq3bt","00:1A:22:0C:79:CF"],"id":"92821015"}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:15,354 - DEBUG    - lib.fhem_pythonbinding: >>> WS: {"defargsh":{},"NAME":"eq3device_WC","function":"Get","PYTHONTYPE":"eq3bt","argsh":{},"args":["eq3device_WC","?"],"msgtype":"function","defargs":["eq3device_WC","PythonModule","eq3bt","00:1A:22:0C:79:CF"],"id":"92821015"}
2020-10-14 19:48:15,355 - DEBUG    - lib.fhem_pythonbinding: <<< WS: {"defargsh": {}, "NAME": "eq3device_WC", "function": "Get", "PYTHONTYPE": "eq3bt", "argsh": {}, "args": ["eq3device_WC", "?"], "msgtype": "function", "defargs": ["eq3device_WC", "PythonModule", "eq3bt", "00:1A:22:0C:79:CF"], "id": "92821015", "finished": 1, "returnval": ""}
2020-10-14 19:48:15,355 - DEBUG    - websockets.protocol: server > Frame(fin=True, opcode=1, data=b'{"defargsh": {}, "NAME": "eq3device_WC", "function": "Get", "PYTHONTYPE": "eq3bt", "argsh": {}, "args": ["eq3device_WC", "?"], "msgtype": "function", "defargs": ["eq3device_WC", "PythonModule", "eq3bt", "00:1A:22:0C:79:CF"], "id": "92821015", "finished": 1, "returnval": ""}', rsv1=False, rsv2=False, rsv3=False)
2020-10-14 19:48:19,370 - DEBUG    - websockets.protocol: server - event = eof_received()
2020-10-14 19:48:19,372 - DEBUG    - websockets.protocol: server ! failing OPEN WebSocket connection with code 1006
2020-10-14 19:48:19,373 - DEBUG    - websockets.protocol: server - event = connection_lost(None)
2020-10-14 19:48:19,373 - DEBUG    - websockets.protocol: server - state = CLOSED
2020-10-14 19:48:19,374 - DEBUG    - websockets.protocol: server x code = 1006, reason = [no reason]
2020-10-14 19:48:19,375 - DEBUG    - websockets.protocol: server x half-closing TCP connection
2020-10-14 19:48:19,376 - ERROR    - lib.fhem_pythonbinding: Connection closed error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/usr/local/lib/python3.7/dist-packages/websockets/framing.py", line 105, 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 "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 42, in pybinding
    async for message in websocket:
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 439, in __aiter__
    yield await self.recv()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 509, in recv
    await self.ensure_open()
  File "/usr/local/lib/python3.7/dist-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
2020-10-14 19:48:19,385 - INFO     - lib.fhem_pythonbinding: Waiting for new FHEM connection...
^CTraceback (most recent call last):
  File "FHEM/bindings/python/pythonbinding.py", line 5, in <module>
    fpb.run()
  File "/home/pi/fhem_pythonbinding/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 260, in run
    asyncio.get_event_loop().run_forever()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
    self._run_once()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/lib/python3.7/selectors.py", line 468, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt
FHEM auf NUC/Proxmox (Rpi 2 / Rpi Zero W mit FHEM2FHEM, RFHEM)
Homematic/LaCrosse/PCA301/Shelly, Rollladen, Batterieaktor + Relais zur Schaltung Garagentor (Promatic 2), Xiaomi FlowerSens, Bewässerungssteuerung Garten und Gewächshaus, Weatherman und Landroid

dominik

Hmm...das ist interessant. Eigentlich ist die Verbindung schon aktiv, wird dann aber beendet.

Kannst du bitte mal im FHEM Log schauen ob du da was findest?

//Edit: Stell beim bindingsio Device mal verbose=5 und teste es dann nochmals. Dann sollte man im FHEM Log was finden.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Master_Nick

Ich versuche gerade mal auf meinem Touchpanel Pi den "remote" Teil zu installieren - es wirkt gerade auf mich als müsse ich da nun noch ein FHEM installieren?

Denn in der Datei die ich anpassen soll nach meinem System steht
ExecStart=/usr/bin/python3 FHEM/bindings/python/pythonbinding.py

Ist das nur verwirrend gerade für mich?
Zitatchange fhem_pythonbinding/fhem_pythonbinding.service acording to your system
Rancher K8s Cluster mit nanoCUL (a-culfw) | IObroker | IT(V1&V3), IT-PIR, THGR122NX |Co² | alexa-fhem | WOL | NFC | Harmony UltimateHub | Anwesenheitserkennnung | Roomba | 10" Touch mit Node-Red | SonOff S20 | SonOff Touch | SonOff Dual | Rolladen | Und ganz viel anderes tolles Gerödel.... ;-)

dominik

Nein, FHEM muss keines installiert werden. Das ist nur irritierend, da der Pfad FHEM heisst. Sobald du ueber github ein clone machst, hast du diese Dateien vorliegen.

Mit der Info:
Zitatchange fhem_pythonbinding/fhem_pythonbinding.service acording to your system
meine ich nur die Anpassung von User (falls man nicht pi nutzt) bzw. der WorkingDirectory wenn man es nicht im /home/pi/... nutzen will.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik