OH2 Rollershutters close command in relation to sun azimuth

Hi all

I have following super basic script that I would like to refine… Any help is appreciated.

rule "Rollladen Schliessen (Sonne)"
when
Item Azimuth changed

then
        if (Azimuth.state > 230){
                sendCommand(FF_LivingDining_Blind_Es, DOWN)
                sendCommand(FF_LivingDining_Blind_Wo, DOWN)
        }
end

I would like to expand the script to only run the command ONCE when the azimuth exceeded 230 degrees AND the inside temperature (FF_LivingDining_Temperature) is greater than 25 degrees. Thus I would close them when it is getting to warm inside but NOT during winter time when the sun is appreciated to help heating.

rule "Rollladen Schliessen (Sonne)"
when
    Item Azimuth changed or
    Item FF_LivingDining_Temperature changed
then
    if (Azimuth.state > 230 && FF_LivingDining_Temperature.state > 25) {
        if (FF_LivingDining_Blind_Es.state != DOWN) {sendCommand(FF_LivingDining_Blind_Es, DOWN)}
        if (FF_LivingDining_Blind_Wo.state != DOWN) {sendCommand(FF_LivingDining_Blind_Wo, DOWN)}
    }
end

I have a proxy item that gets set to ON when the azimuth is between certain values and use that to trigger my blinds, or to check if the sun is on the backside when other items trigger them:

rule "Is the sun on the backside"
	when
		Item Sun_Position_Azimuth changed
	then
		Thread.sleep(500)
		if (Sun_Position_Azimuth.state > 32.5 && Sun_Position_Azimuth.state < 212.5 && Sun_Position_Elevation.state > 10) {
			Sun_On_Backside.postUpdate(ON)
		} else {
			Sun_On_Backside.postUpdate(OFF)			
		}
end

rule "Blinds Auto down"
	when
		Item Sun_On_Backside changed from OFF to ON or
		Item WeatherWarnings changed from ON to OFF or
		Item SMHI_Hour0_CloudCover changed
	then
		if (WeatherWarnings.state == OFF &&
			SMHI_Hour0_CloudCover_Total.state < 3 &&
			Presence_Group.state == ON &&
			Heatpump_Status_MeanOutdoorTemp.state > 13 &&
			Sun_On_Backside.state == ON) {
				SunBlinds_Windows.sendCommand(STOP)
				logInfo("SunblindsAutoDown", "Pulling down")
		}
end
2 Likes

Hej Anders

Thanks for your example. Could you also reveal how you did the proxy item? Sorry, new kid on the block here… But it gets better daily :smiley:

hello hr_2

Thank you! I will try this too. Appreciate it.

Hej Anders
I just realized that my question was stupid. It’s there…