Yapay zekâ tarafından English dilinden çevrildi ·
Kurallar kartı. Laboratuvar havalandırma programlarımı bu şekilde yürütüyorum.Önce Pi’nin profiline bir komut ekleyin, ör. heaters.set ile Evet/Hayır tipinde on parametresi, Basic seviyesi. Pi üzerinde:
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)
(Kodlarınız ve darbe uzunluğu sniff’ten gelir, benimkiler yer tutucudur.)Ardından teras varlığının Kurallar kartında:
- Kural “Heaters on”: When Sunrise or sunset, Sunset, offset -15. Then Send a command
heaters.seton = yes to the Pi. - Kural “Heaters off”: When A time of day 23:00, every day. Then the same with on = no.
Gün batımı için yerin konumu gerekir, bu yüzden teras varlığına enlem/boylam girin ve Pi’yi bunun altına yerleştirin; aksi halde kural kaydedilmez. Ayrıca 433 MHz’de geri bildirim yoktur, bu yüzden emin olmak istiyorsanız komutu birbirinden bir dakika ara ile iki kez gönderin. Doküman: 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.

