taobin_project/inter/tha/hardware/exhaust_fan_schedule.ev

120 lines
3.1 KiB
Text
Raw Normal View History

2024-08-23 13:15:35 +07:00
2024-08-26 13:21:03 +07:00
;DEBUGVAR ExhaustFanTime1Enable
;DEBUGVAR ExhaustFanTime1Hour
;DEBUGVAR ExhaustFanTime1Min
;
;DEBUGVAR ExhaustFanTime2Enable
;DEBUGVAR ExhaustFanTime2Hour
;DEBUGVAR ExhaustFanTime2Min
;
;DEBUGVAR ExhaustFanTime3Enable
;DEBUGVAR ExhaustFanTime3Hour
;DEBUGVAR ExhaustFanTime3Min
2024-08-23 13:15:35 +07:00
2024-08-26 13:21:03 +07:00
DEBUGVAR ExhaustFanMode1
DEBUGVAR ExhaustFanMode2
DEBUGVAR ExhaustFanMode3
2024-08-23 13:15:35 +07:00
2024-08-27 21:42:15 +07:00
DEBUGVAR AirTemperature
DEBUGVAR AirHumidity
2025-05-22 11:48:32 +07:00
DEBUGVAR ExhaustFanTime1Hour
If ExhaustFanAuto = "2" Then
If SystemTimeHourInt = 4 Then
SAVELOG " Exhaust Fan mode 2 come back to mode auto2 "
__CMD "CLI" "set-fan-mode=Fan_Auto" "-" "-"
EndIf
2025-05-28 12:44:07 +07:00
If SystemTimeHourInt = ExhaustFanTime1Hour Then
SAVELOG " Exhaust Fan mode 2 come back to mode auto3 "
__CMD "CLI" "set-fan-mode=Fan_Auto" "-" "-"
EndIf
2025-05-22 11:48:32 +07:00
EndIf
2024-10-22 14:41:35 +07:00
If ExhaustFanAuto = "" Then
Var ExhaustFanAuto = "1"
2024-08-23 13:15:35 +07:00
EndIf
2025-05-22 11:48:32 +07:00
DEBUGVAR ExhaustFanAuto
2024-10-22 14:41:35 +07:00
If ExhaustFanAuto = "0" Then
SAVELOG "ExhaustFan Override from server"
Var PreviseTime1ToTime2 = ""
Var PreviseTime2ToTime3 = ""
2024-08-26 13:21:03 +07:00
EndIf
2024-10-22 14:41:35 +07:00
If ExhaustFanAuto = "1" Then
2024-08-26 13:21:03 +07:00
2024-10-22 14:41:35 +07:00
Var fan_mode_str = "set-fan-mode="
2024-08-26 13:21:03 +07:00
2024-10-22 14:41:35 +07:00
If ExhaustFanTime1Enable = "true" Then
If ExhaustFanTime2Enable = "true" Then
TimeRange ExhaustFanTime1Hour ExhaustFanTime1Min ExhaustFanTime2Hour ExhaustFanTime2Min SystemTimeHourInt SystemTimeMinuteInt CurrentTime1ToTime2
2024-08-26 13:21:03 +07:00
Else
2024-10-22 14:41:35 +07:00
Var CurrentTime1ToTime2 = "true"
2024-08-26 13:21:03 +07:00
EndIf
2024-10-22 14:41:35 +07:00
EndIf
2024-08-26 13:21:03 +07:00
2024-10-22 14:41:35 +07:00
DEBUGVAR CurrentTime1ToTime2
2025-05-22 11:48:32 +07:00
DEBUGVAR PreviseTime1ToTime2
2024-10-22 14:41:35 +07:00
If PreviseTime1ToTime2 = CurrentTime1ToTime2 Then
2025-05-22 11:48:32 +07:00
2024-10-22 14:41:35 +07:00
Else
Var PreviseTime1ToTime2 = CurrentTime1ToTime2
If CurrentTime1ToTime2 = "true" Then
2025-05-22 11:48:32 +07:00
Var fan_mode_str_final = fan_mode_str + ExhaustFanMode1
2024-10-22 14:41:35 +07:00
__CMD "CLI" fan_mode_str_final "-" "-"
EndIf
2024-08-26 13:21:03 +07:00
EndIf
2024-10-22 14:41:35 +07:00
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
2024-08-26 13:21:03 +07:00
EndIf
2024-10-22 14:41:35 +07:00
DEBUGVAR CurrentTime2ToTime3
2025-05-22 11:48:32 +07:00
DEBUGVAR PreviseTime2ToTime3
2024-10-22 14:41:35 +07:00
If PreviseTime2ToTime3 = CurrentTime2ToTime3 Then
2025-05-22 11:48:32 +07:00
2024-10-22 14:41:35 +07:00
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
2024-08-26 13:21:03 +07:00
EndIf
2024-08-23 13:15:35 +07:00
EndIf
2024-08-26 13:21:03 +07:00
2024-08-28 15:18:14 +07:00
DEBUGVAR LastTimeOfMainGateCloseUnitInMinute
DEBUGVAR MachineUpTimeUnitInMinute
2024-09-24 23:47:36 +07:00
If MachineStage = "close-maintenance" Then
2024-09-25 13:38:13 +07:00
Var CountDownForSetFanMode = 3
2024-09-24 23:47:36 +07:00
EndIf
If CountDownForSetFanMode = "" Then
Var CountDownForSetFanMode = 0
EndIf
If CountDownForSetFanMode > 0 Then
Var CountDownForSetFanMode = CountDownForSetFanMode - 1
DEBUGVAR CountDownForSetFanMode
EndIf
If CountDownForSetFanMode = 1 Then
Var PreviseTime2ToTime3 = ""
Var PreviseTime1ToTime2 = ""
SAVELOG "Update fan mode"
EndIf