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.

