Easy question: how to compare value in a condition with number:angle

My item is defined as:

Number:Angle    Sun_Azimuth         "Azimuth Sonne"   <sun> (gStatus, gAstro, gSun) { channel="astro:sun:local:position#azimuth" }

My condition within my rule is like follows:

if (Sun_Azimuth.state  > 100.0)  {

Even Sun.Azimuth is far above 100 (if I send Sun_Azimuth.state to telegram I see for example 314.4855…°) the condition is not evaluated to true.
What is going wrong?

In example rules I saw a lot of type conversions but for Azimuth .state it should be possible to compare easily to a number like 100.0.

See -

You’ve already worked that out though really, you just need to give units to your 100

if (Sun_Azimuth.state  > 100.0 | "°" )  {

or radians or whatever

It works! Thanks a lot.

I didn’t saw this notation before. I look in so many examples.

Is there any source there this is documented? I’ve frequently problems with type conversions and type in general.

Thanks a lot for your endavour!


Thank you!
I know the Wiki, but this I overlooked apaprently.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.