"OR" in a Rule

Hello!

I want, that my blinds move up in the morning, but not, when it is raining. If the tempreture outside is below 1 °C and it is raining - in this case i think it is snowing - the blinds should go up.

I´m using the following rule:

rule "Morgens hoch"
	when
		Channel
			'astro:sun:30ae654b:civilDawn#event' triggered START
	then
		Esszimmer_Raffstore_4_Level2.sendCommand(100)
		Wohnzimmer_Ost_Raffstore_4_Level2.sendCommand(100)
		Kueche_Raffstore_4_Level2.sendCommand(100)
		timerRaffstoreAuf=createTimer(now.plusSeconds(15))[|
		Wohnzimmer_Raffstore_Terasse_Fenster_1_Level.sendCommand(UP)
		Wohnzimmer_Raffstore_Terrasse_TRe_1_Level.sendCommand(UP)]
		if ((Garten_Regensensor_1_State.state == 0) || (Aussenmodul_Temperature.state < 1))  {
			KChe_Raffstore_4_Level.sendCommand(100) // Raffstore ist ganz geöffnet
			Wohnzimmer_Ost_Raffstore_4_Level.sendCommand(100)
			Esszimmer_Raffstore_4_Level.sendCommand(100)}

Problem is, that rule works fine, when the tempreture is below 1 °, but not, when the temperature is over 1°. Somewhere i read, that “||” means OR - is that correct? When not, how can i realize my rule??

BR Jürgen

Yes || is for OR. Try

if (((Garten_Regensensor_1_State.state as Number)  == 0) || ((Aussenmodul_Temperature.state as Number) < 1))

From that I would say you want the blinds to go up always if it is below 1°C or when the temperature is higher and it is not raining.
Try to make an if out of that.

You mean something like that:

if (Aussenmodul_Temperature.state < 1)  {
			KChe_Raffstore_4_Level.sendCommand(100) // Raffstore ist ganz geöffnet
			Wohnzimmer_Ost_Raffstore_4_Level.sendCommand(100)
			Esszimmer_Raffstore_4_Level.sendCommand(100)}
		if (Aussenmodul_Temperature.state > 1)  {
			if (Garten_Regensensor_1_State.state == 0) [
			KChe_Raffstore_4_Level.sendCommand(100) // Raffstore ist ganz geöffnet
			Wohnzimmer_Ost_Raffstore_4_Level.sendCommand(100)
			Esszimmer_Raffstore_4_Level.sendCommand(100)]}

BR Jürgen

More like (pseudo code)

If ( (temperature <1) or ( (temerature>1 ) and ( regensensor…state=0)) )

1 Like

Ok, i will try that.

&& stands for AND?

:+1: