Hi!
I’m trying to figure out how to make a departure timer to control a wall socket for my car heater.
I have a working system with 4 sliders to set start and stop hour and minute but the goal is to only set the desired departure time (hour and minute) and then have openremote to calculate when to switch on the socket based on outside temperature.
What I am trying to achieve is if the outside temperature is above 0°C then the heater should start one hour before the set departure time.
Between 0 and -5°C, 1,5 hours before departure time.
Between -5 and -10°C, 2 hours before dt.
Below -10°C, 3 hours before the set departure time.
This is an example how I use the temp sensor i other rules:
CustomState( source == “oregon1temp”, eval(Float.parseFloat((String)value) < -5.0 ))
``
Have any of you guys any suggestions on how I can solve this?
This is how the timer is configured at the moment:
rule “Start car heater”
when
CustomState( source == “GVMonSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “1” ) ||
CustomState( source == “GVTueSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “2” ) ||
CustomState( source == “GVWedSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “3” ) ||
CustomState( source == “GVThuSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “4” ) ||
CustomState( source == “GVFriSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “5” ) ||
CustomState( source == “GVSatSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “6” ) ||
CustomState( source == “GVSunSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “7” )
CustomState( source == “GVActivateTimer1Status”, value == “on” )
Event( source == “TimeSweHour”, $htime1:value )
Event( source == “GVStartTimeHour1”, value == $htime1 )
Event( source == “TimeSweMinute”, $mtime1:value )
Event( source == “GVStartTimeMinute1”, value == $mtime1 )
then
execute.command( “Garage Socket(ON)” );
end
rule “Stop car heater”
when
CustomState( source == “GVMonSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “1” ) ||
CustomState( source == “GVTueSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “2” ) ||
CustomState( source == “GVWedSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “3” ) ||
CustomState( source == “GVThuSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “4” ) ||
CustomState( source == “GVFriSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “5” ) ||
CustomState( source == “GVSatSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “6” ) ||
CustomState( source == “GVSunSwitchStatus”, value == “on” ) && Event( source == “Weekday”, value == “7” )
CustomState( source == “GVActivateTimer1Status”, value == “on” )
Event( source == “TimeSweHour”, $htime2:value )
Event( source == “GVStopTimeHour1”, value == $htime2 )
Event( source == “TimeSweMinute”, $mtime2:value )
Event( source == “GVStopTimeMinute1”, value == $mtime2 )
then
execute.command( “Garage Socket(OFF)” );
end
``
Cheers,
Erik