This commit is contained in:
wanlop run 2024-10-22 14:41:35 +07:00
parent 82e8d1fd01
commit 33147a9041
10 changed files with 2298 additions and 91 deletions

View file

@ -18,55 +18,69 @@ DEBUGVAR ExhaustFanMode3
DEBUGVAR AirTemperature
DEBUGVAR AirHumidity
Var fan_mode_str = "set-fan-mode="
If ExhaustFanTime1Enable = "true" Then
If ExhaustFanTime2Enable = "true" Then
TimeRange ExhaustFanTime1Hour ExhaustFanTime1Min ExhaustFanTime2Hour ExhaustFanTime2Min SystemTimeHourInt SystemTimeMinuteInt CurrentTime1ToTime2
Else
Var CurrentTime1ToTime2 = "true"
EndIf
If ExhaustFanAuto = "" Then
Var ExhaustFanAuto = "1"
EndIf
DEBUGVAR CurrentTime1ToTime2
DEBUGVAR PreviseTime1ToTime2
If PreviseTime1ToTime2 = CurrentTime1ToTime2 Then
Else
Var PreviseTime1ToTime2 = CurrentTime1ToTime2
If CurrentTime1ToTime2 = "true" Then
Var fan_mode_str_final = fan_mode_str + ExhaustFanMode1
__CMD "CLI" fan_mode_str_final "-" "-"
EndIf
DEBUGVAR ExhaustFanAuto
If ExhaustFanAuto = "0" Then
SAVELOG "ExhaustFan Override from server"
Var PreviseTime1ToTime2 = ""
Var PreviseTime2ToTime3 = ""
EndIf
If ExhaustFanAuto = "1" Then
Var fan_mode_str = "set-fan-mode="
If CurrentTime1ToTime2 = "false" Then
If ExhaustFanTime2Enable = "true" Then
If ExhaustFanTime3Enable = "true" Then
TimeRange ExhaustFanTime2Hour ExhaustFanTime2Min ExhaustFanTime3Hour ExhaustFanTime3Min SystemTimeHourInt SystemTimeMinuteInt CurrentTime2ToTime3
If ExhaustFanTime1Enable = "true" Then
If ExhaustFanTime2Enable = "true" Then
TimeRange ExhaustFanTime1Hour ExhaustFanTime1Min ExhaustFanTime2Hour ExhaustFanTime2Min SystemTimeHourInt SystemTimeMinuteInt CurrentTime1ToTime2
Else
Var CurrentTime2ToTime3 = "true"
Var CurrentTime1ToTime2 = "true"
EndIf
EndIf
DEBUGVAR CurrentTime2ToTime3
DEBUGVAR PreviseTime2ToTime3
If PreviseTime2ToTime3 = CurrentTime2ToTime3 Then
DEBUGVAR CurrentTime1ToTime2
DEBUGVAR PreviseTime1ToTime2
If PreviseTime1ToTime2 = CurrentTime1ToTime2 Then
Else
Var PreviseTime2ToTime3 = CurrentTime2ToTime3
If CurrentTime2ToTime3 = "true" Then
Var fan_mode_str_final = fan_mode_str + ExhaustFanMode2
__CMD "CLI" fan_mode_str_final "-" "-"
Var PreviseTime1ToTime2 = CurrentTime1ToTime2
If CurrentTime1ToTime2 = "true" Then
Var fan_mode_str_final = fan_mode_str + ExhaustFanMode1
__CMD "CLI" fan_mode_str_final "-" "-"
EndIf
EndIf
If CurrentTime1ToTime2 = "false" Then
If ExhaustFanTime2Enable = "true" Then
If ExhaustFanTime3Enable = "true" Then
TimeRange ExhaustFanTime2Hour ExhaustFanTime2Min ExhaustFanTime3Hour ExhaustFanTime3Min SystemTimeHourInt SystemTimeMinuteInt CurrentTime2ToTime3
Else
Var CurrentTime2ToTime3 = "true"
EndIf
EndIf
DEBUGVAR CurrentTime2ToTime3
DEBUGVAR PreviseTime2ToTime3
If PreviseTime2ToTime3 = CurrentTime2ToTime3 Then
Else
Var PreviseTime2ToTime3 = CurrentTime2ToTime3
If CurrentTime2ToTime3 = "true" Then
Var fan_mode_str_final = fan_mode_str + ExhaustFanMode2
__CMD "CLI" fan_mode_str_final "-" "-"
EndIf
EndIf
EndIf
EndIf
DEBUGVAR LastTimeOfMainGateCloseUnitInMinute