Von English mit KI übersetzt ·
Regelkarte. Ich betreibe Lüftungspläne im Labor auf diese Weise.Gib zuerst dem Profil des Pi einen Befehl, z. B. heaters.set mit einem Ja/Nein-Parameter on, Basic-Stufe. Auf dem Pi:
from rpi_rf import RFDevice
tx = RFDevice(17); tx.enable_tx()
CODES = {True: [5592405, 5592407, 5592411, 5592413],
False: [5592404, 5592406, 5592410, 5592412]}
def on_rpc(req_id, body):
if body.get("method") == "heaters.set":
for code in CODES[bool(body["params"]["on"])]:
tx.tx_code(code, 1, 350) # protocol 1, pulse length from the sniff
client.publish(f"v1/rpc/res/{req_id}", '{"ok": true}', qos=1)
(Deine Codes und die Pulslänge stammen aus dem Sniff, meine sind Platzhalter.)Dann auf der Regelkarte des Terrassen-Assets:
- Regel „Heaters on“: When Sunrise or sunset, Sunset, offset -15. Then Send a command
heaters.seton = yes to the Pi. - Regel „Heaters off“: When A time of day 23:00, every day. Then the same with on = no.
Für den Sonnenuntergang wird der Standort benötigt. Trage daher Breiten- und Längengrad am Terrassen-Asset ein und ordne den Pi darunter an, sonst wird die Regel nicht gespeichert. Außerdem gibt es bei 433 MHz keine Rückmeldung. Wenn du sicher gehen willst, sende den Befehl zweimal mit einer Minute Abstand. Doku: Time, sunrise/sunset, dates and holidays.
Rules card. I run lab ventilation schedules this way.
First give the Pi’s profile a command, e.g. heaters.set with a Yes/no param on, Basic tier. On the Pi:
from rpi_rf import RFDevice
tx = RFDevice(17); tx.enable_tx()
CODES = {True: [5592405, 5592407, 5592411, 5592413],
False: [5592404, 5592406, 5592410, 5592412]}
def on_rpc(req_id, body):
if body.get("method") == "heaters.set":
for code in CODES[bool(body["params"]["on"])]:
tx.tx_code(code, 1, 350) # protocol 1, pulse length from the sniff
client.publish(f"v1/rpc/res/{req_id}", '{"ok": true}', qos=1)
(Your codes and pulse length come from the sniff, mine are placeholders.)
Then on the terrace asset’s Rules card:
- Rule „Heaters on“: When Sunrise or sunset, Sunset, offset -15. Then Send a command
heaters.seton = yes to the Pi. - Rule „Heaters off“: When A time of day 23:00, every day. Then the same with on = no.
Sunset needs the place’s location, so put latitude/longitude on the terrace asset and place the Pi under it, otherwise the rule won’t save. Also, 433 MHz has no feedback, so send the command twice a minute apart if you want to be sure. Doc: Time, sunrise/sunset, dates and holidays.

