433 MHz prizli sokette çalışan teras ısıtıcıları: Pi üzerinden kuraldan gün batımında açma
Yapay zekâ tarafından English dilinden çevrildi ·
Otelimizin terasında, ucuz 433 MHz uzaktan kumandalı prizlere bağlı dört adet ayaklı ısıtıcı var. Personel akşamları bunları açmayı, geceleri de kapatmayı unutuyor. Hermetry için teras sıcaklığını zaten bir Raspberry Pi ile ölçüyorum.”GPIO4 üzerine tek bir kablo bağlayarak Pi’yi FM/RF vericisi olarak kullanmak” hilesini okudum, önce heyecanlandım, sonra kafam karıştı. Bu nasıl çalışıyor, bir GPIO pini gerçekten radyo yayını yapabilir mi? Bunu priz kodlarını göndermek için kullanabilir miyim? Ayrıca Hermetry’nin bunu otomatik yapmasını istiyorum: gün batımında açılsın, 23:00’te kapansın. Bu bir kural mı yoksa bir akış mı?
Our hotel terrace has four patio heaters on cheap 433 MHz remote sockets. Staff forget to switch them on in the evening and forget to switch them off at night. I have a Raspberry Pi already doing the terrace temperature for Hermetry.
I read about the “Pi as an FM/RF transmitter with just a wire on GPIO4” hack and got excited, then confused. How does that even work, can a GPIO pin really transmit radio? Could I use that to send the socket codes? And then I’d like Hermetry to do it automatically: on at sunset, off at 23:00. Is that a rule or a flow?
Yapay zekâ tarafından English dilinden çevrildi ·
GPIO4 numarası, Pi’nin saat üretecini kullanır: onu onlarca MHz’de kare dalga üretebilir ve yazılım frekansı değiştirerek FM elde eder. Kare dalga harmoniklerle doludur, dolayısıyla kullanma hakkınız olmayan frekanslarda da yayın yapıyorsunuz. Bir laboratuvar gösterimi için uygun, ama bunu bir otelin terasına koymazdım.
The GPIO4 trick uses the Pi’s clock generator: it can put out a square wave at tens of MHz, and the software wiggles the frequency to make FM. A square wave is full of harmonics, so you’re also transmitting on frequencies you have no right to use. Fine for a lab demo, I wouldn’t put it on a hotel terrace.
Yapay zekâ tarafından English dilinden çevrildi ·
Prizler için 2 dolarlık bir FS1000A 433 MHz verici modülü ve rpi-rf Python paketi. Önce eşleşen alıcıyla uzaktan kumandanın kodlarını dinleyin (rpi-rf_receive), ardından bunları tekrar gönderin.
For the sockets, a 2 dollar FS1000A 433 MHz transmitter module plus the rpi-rf Python package. Sniff the remote’s codes with the matching receiver first (rpi-rf_receive), then replay them.
Yapay zekâ tarafından English dilinden çevrildi ·
tamam, verici + alıcı çiftini sipariş ettim. Pi kısmı artık netleşti, peki Hermetry’den gün batımında bunu nasıl tetikleyebilirim?
ok I ordered the transmitter + receiver pair. So the Pi part is clear, but how do I trigger it from Hermetry at sunset?
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.
Yapay zekâ tarafından English dilinden çevrildi ·
Artık bir haftadır çalışıyor! “Gün doğumu ve gün batımı için bu yerin konumu gerekli” mesajını almıştım, koordinatları ekledim ve kaydetti. Ayrıca bir de 23:05’te kapatma kuralı ekledim, çünkü bir priz kodu ara sıra kaçırıyor. Personel bir şey fark etmedi; ısıtıcılar yalnızca olması gerektiği zaman açık oluyor.
Running for a week now! “Sunrise and sunset need this place’s location” was exactly the message I got, added the coordinates and it saved. I also added a second off rule at 23:05 because one socket misses the code now and then. Staff noticed nothing except the heaters are just on when they should be.
- Bu konuyu yanıtlamak için giriş yapmış olmalısınız.
Sohbete katılın
Soru sormak ve yanıtlamak, yararlı gönderileri beğenmek ve sorununuzu çözen yanıtı işaretlemek için oturum açın. Her katkı puan ve seviye kazandırır.

