I’m having some troubles with writing rules for curtains automation. I have an outdoor sensors and an item showing me the level of illuminance.
I want curtains to close everytime the illuminance is under 10 lx.
Here’s my code:
if ((OutLum.state < 10) {
if (Curt_N.state == 0) {
Curt_Open.sendCommand(OFF)
Curt_Close.sendCommand(ON)
}
}
I believe the issue is with comparison of luminocity, but I’ve tried a lot of diffrent options. such as “(gOutLum.state as QuantityType).toBigDecimal > 20)” for example and it didn’t work.
I’m not good at coding at all and that is my very first project, I couldn’t have fined enything like that on the forum, so I hope someone faced such problem ir at least know how to solve it.