Is there a way to switch on 45 relay boards in one go every morning?
Translated from Türkçe by AI ·
Hello, I’m new to the IoT side, I’m actually from the IT side. There are 45 meeting rooms in the building, and in each room an ESP32 relay board cuts and restores the power to the air conditioner and the screen. The boards are connected to Hermetry over MQTT, and the command catalogue of the profile has a command called relay.set, with the parameter on.Right now the colleague who arrives in the morning opens the device pages one by one and sends the command, 45 times. I want to have this done automatically at 07:30 every working day. Also, none of them should switch on at the weekend.In addition, sometimes a few boards drop off Wi-Fi at that time, and I don’t know what happens to them, please let me know.
Merhaba, IoT tarafında yeniyim, BT tarafındayım aslında. Binada 45 tane toplantı odası var, her odada bir ESP32 röle kartı klima ile ekranın enerjisini kesip açıyor. Kartlar Hermetry’ye MQTT ile bağlı, profilin komut kataloğunda relay.set diye bir komut var, parametresi on.
Şu an sabah gelen arkadaş cihaz sayfalarını tek tek açıp komut gönderiyor, 45 kere. Bunu her iş günü 07:30’da otomatik yaptırmak istiyorum. Bir de hafta sonu hiçbiri açılmasın.
Ayrıca bazen birkaç kart o saatte Wi-Fi’den düşmüş oluyor, onlar ne olur bilmiyorum.
Translated from Türkçe by AI ·
Run a script against the API in a loop and put it in cron. That’s how I do it.
API’den bir script ile döngüde at, cron’a koy. Ben öyle yapıyorum.
Translated from Türkçe by AI ·
How will the card receive the command if the card itself is turned off? I’m curious about that.
Kartın kendisi kapalıysa komutu nasıl alacak? Onu merak ettim.
Translated from Türkçe by AI ·
The cards are always on, Cansu, only the load behind the relay is being cut.
Kartlar hep açık Cansu, sadece rölenin arkasındaki yük kesiliyor.
Translated from Türkçe by AI ·
A script would work too, but you don’t need to write any code for this, the Rules card does exactly that. We use the same thing on our office floor.In the When section, add a “Time of day” trigger: 07:30, days Monday to Friday. Then in the Then section, add a “Send command” action: instead of selecting devices one by one, select every device in the profile, command relay.set, parameter on: true. A single action goes out to up to 200 devices in the profile, so 45 is comfortably within that.For devices that drop off Wi-Fi: set the command to “persistent by default” in the catalog. Then a command sent to an offline card waits in the queue and is delivered when the card reconnects. If it’s not persistent, a command to an offline device fails immediately. If one device fails, the rule carries on with the others, and you can see which one didn’t receive it in the History.To turn them off in the evening, set up the same thing as a second rule with 19:00 and on: false. Devices that have been switched to manual mode are skipped, so keep that in mind. Details: Rules card: actions.
Script de olur ama bunun için kod yazmana gerek yok, Kurallar kartı tam bunu yapıyor. Biz aynısını ofis katında kullanıyoruz.
Ne zaman kısmına “Günün bir saati” tetikleyicisi ekle, 07:30, günler Pazartesi’den Cuma’ya. Sonra kısmına “Komut gönder” eylemi: cihaz olarak tek tek seçmek yerine profilin her cihazını seç, komut relay.set, parametre on: true. Tek eylem profildeki 200 cihaza kadar gidiyor, 45 rahat.
Wi-Fi’den düşenler için: komutu katalogda “varsayılan olarak kalıcı” yap. O zaman çevrimdışı karta giden komut kuyrukta bekliyor, kart bağlanınca iletiliyor. Kalıcı değilse çevrimdışı cihaza giden komut anında başarısız oluyor. Bir cihaz başarısız olursa kural diğerlerine devam ediyor, Geçmiş’te hangisinin olmadığını görüyorsun.
Akşam kapatmak için aynısını 19:00 ve on: false ile ikinci bir kural olarak kur. Manuel moda alınmış cihazlar atlanır, bunu bil. Ayrıntılar: Kurallar kartı: eylemler.
Translated from Türkçe by AI ·
This morning it ran by itself for the first time, 42 cards opened instantly, 3 were skipped. The reason: those three rooms had been put on maintenance for Manuel, and nobody had been informed 🙂 I also made the command permanent. Thanks Ilgaz.
Bu sabah ilk kez kendi kendine çalıştı, 42 kart anında açıldı, 3 tanesi atlandı. Sebebi: o üç oda bakım için Manuel’e alınmış, kimsenin haberi yokmuş 🙂 Komutu da kalıcı yaptım. Teşekkürler Ilgaz.
Translated from Türkçe by AI ·
OK, I think it’s time to retire my cron script.
Tamam, benim cron script’i emekliye ayırma zamanı galiba.
- You must be logged in to reply to this topic.
Join the conversation
Sign in to ask and answer, like helpful posts and mark the reply that solved your problem. Every contribution earns points and levels.

