Von English mit KI übersetzt ·
Genau das habe ich vor zwei Jahren bei den Dachlichtern über unserer Kantine in der Lackiererei gemacht. Du brauchst die KLF 200 Schnittstelle des Fensterherstellers (das io-homecontrol-Gateway mit LAN-Anschluss). Du koppelst jedes Fenster daran, so wie du eine neue Tastatur anlernen würdest, danach stellt sie dir eine lokale API im LAN zur Verfügung. Auf dem Pi gibt es eine Python-Bibliothek, pyvlx, die damit spricht. Aktualisiere die KLF 200 zuerst auf die aktuelle Firmware, die alte hat keine API, und verbinde sie per Kabel, nicht über ihr eigenes WLAN.Die Regenlogik sollte dann der Pi lokal ausführen. Ich würde „bei Regen schließen“ nicht über die Cloud laufen lassen, es muss auch funktionieren, wenn das Internet ausfällt:
if rain_contact_closed() and any_open():
await pyvlx.nodes[n].close(wait_for_completion=False)
# every 30 s, and after each move:
payload = {f"win{n:02d}.pos": node.position.position_percent for n, node in enumerate(nodes)}
mqtt.publish("v1/telemetry", json.dumps(payload), qos=1)
Die Positionen kommen von den Fenstern zurück, du bekommst also echte Rückmeldung, 0 = geschlossen. Für die Öffnen-/Schließen-Tasten im Dashboard füge dem Gerspäteprofil des Pi Befehle wie win.close mit einem Parameter für die Fensternummer hinzu, verarbeite sie auf v1/rpc/req/+ und antworte mit derselben ID. Board-Steuerelemente können nur Befehle der Basic-Stufe aus dem Katalog des Profils senden, was für diesen Zweck ausreicht. Siehe Control cards.Die KLF 200 nimmt nur ein paar API-Verbindungen gleichzeitig an, halte deshalb in deinem Skript eine dauerhaft offene Verbindung.
Did exactly this on the roof lights over our paint shop canteen two years ago. What you want is the window maker’s KLF 200 interface (the io-homecontrol gateway with a LAN port). You pair each window into it like you would a new keypad, then it gives you a local API on the LAN. On the Pi there’s a Python library, pyvlx, that talks to it. Update the KLF 200 to the current firmware first, the old one has no API, and connect it by cable, not its own Wi-Fi.
Then the Pi does the rain logic locally, I would not run „close on rain“ through the cloud, it has to work when the internet is down:
if rain_contact_closed() and any_open():
await pyvlx.nodes[n].close(wait_for_completion=False)
# every 30 s, and after each move:
payload = {f"win{n:02d}.pos": node.position.position_percent for n, node in enumerate(nodes)}
mqtt.publish("v1/telemetry", json.dumps(payload), qos=1)
Positions come back from the windows so you get real feedback, 0 = closed. For the open/close buttons on the dashboard, add commands like win.close with a window number parameter to the Pi’s device profile, handle them on v1/rpc/req/+ and answer on the same id. Board controls can only send Basic tier commands from the profile’s catalogue, which is fine for this. See Control cards.
The KLF 200 only takes a couple of API connections at a time, so keep one long-lived connection in your script.

