I would like to automatically switch off lights in a room as soon as the roller shutters have been opened.
I am wondering about the easiest solution to linking roller shutter and lights together.
This is my rule up to now:
rule "Test if roller shutter went up then switch off lights in the room"
when
Member of gShade changed
then
Thread::sleep(90000)
val delta_wert = triggeringItem.deltaSince(now.minusSeconds(120))
// Rolladen: 0: oben; 100: unten
// <0 wenn vorher 100 war und jetzt 0 (also oben) ist
if (delta_wert < -50) {
logInfo("rolladen.rules", "Delta: "+ delta_wert + "; jetzt Lampe dazu suchen...")
}
end
You are right, this does not make sense. I will just check if they are now open.
However, the bigger challenge for me is to find the right light to switch. The easiest would be to have an array of roller shutter → light connections. Would that be possible?