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.
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