[SOLVED] Rule with Azimuth or Elevation threshold

Hello,

I am new here and was wondering, why the following (simple) rule is not working.
I found two similair topics where I based this rule on, but in my case it ain’t work.

Any ideas?

Thank you for helping me out!

Item definitions:

 Number:Angle Azimuth "Zonpositie (horizontaal)" {channel= "astro:sun:local:position#azimuth"}
 Number:Angle Elevation "Zonpositie (verticaal)" {channel= "astro:sun:local:position#elevation"}
 Rollershutter  Sunblinds     "Zonnescherm"       {channel="shelly:shelly25-roller:c4d27b:roller#control"}    


rule "Sunblinds up when azimuth or elevation exceeds treshold (whatever comes first)"

when

Item Azimuth changed or

Item Elevation changed

then 

if (Azimuth.state > 220 || Elevation.state < 12) {

    if (Sunblinds.state != UP) {sendCommand(Sunblinds, UP)}

    logInfo("Sunblinds", "Sunblinds up when azimuth or elevation exceeds treshold (whatever comes first" ) 
 } 
 end

you forgot to post your Item definitions.

Do your Items ever change? Look in your events.log to find out.
Do your Items have simple numeric values, or do they have units of measurement? Look at the way you defined your Items, look in your events.log to see what values they take on.

Sorry, I just added them!

Thanks for your reply! They have a unit of measurement (degrees).

Okay, then you cannot compare with say < 12. 12 what? Radians? Degrees? Revolutions?

Thank your for your quick reply, this is what I needed! Learning with small steps :wink:

1 Like