@@ -1062,7 +1062,7 @@ static const char *eaton_input_bypass_check_range(double value)
10621062 NUT_STRARG (out_frequency_nominal_str ));
10631063
10641064 /* Disable Bypass mode switching, do not enter Bypass mode */
1065- dstate_setinfo ("input.bypass.switch.on " , "disabled " );
1065+ dstate_setinfo ("input.bypass.switch.off " , "off " );
10661066 upsdebugx (1 , "%s: Disable Bypass mode due to missing input/output variables." , __func__ );
10671067 return NULL ;
10681068 }
@@ -1131,7 +1131,7 @@ static const char *eaton_input_bypass_check_range(double value)
11311131 upsdebugx (1 , "Input Bypass frequency is outside Bypass transfer limits: %.1f Hz" , bypass_frequency );
11321132 }
11331133 /* Disable Bypass mode switching, do not enter Bypass mode */
1134- dstate_setinfo ("input.bypass.switch.on " , "disabled " );
1134+ dstate_setinfo ("input.bypass.switch.off " , "off " );
11351135 upsdebugx (1 , "%s: Disable Bypass mode due to input conditions being outside the transfer limits." , __func__ );
11361136 return NULL ;
11371137 }
@@ -1157,12 +1157,10 @@ static const char *eaton_input_eco_mode_auto_on_fun(double value)
11571157 const char * bypass_switch_on_str = NULL ;
11581158 const char * eco_switchable_str = NULL ;
11591159
1160- NUT_UNUSED_VARIABLE (value );
1161-
11621160 /* Check if input.bypass.switch.on is disabled and set it to 'on' */
11631161 bypass_switch_on_str = dstate_getinfo ("input.bypass.switch.on" );
11641162 if (!strcmp (bypass_switch_on_str , "disabled" )) {
1165- setvar ( "input.bypass.switch.on" , "on" );
1163+ bypass_switch_on_str = eaton_input_bypass_check_range ( value );
11661164 } else {
11671165 upsdebugx (1 , "Bypass switch on state is: %s , must be disabled before switching on" , bypass_switch_on_str );
11681166 return NULL ;
@@ -1171,14 +1169,14 @@ static const char *eaton_input_eco_mode_auto_on_fun(double value)
11711169 /* Check if input.eco.switchable is normal and set it to 'ECO' */
11721170 eco_switchable_str = dstate_getinfo ("input.eco.switchable" );
11731171 if (!strcmp (eco_switchable_str , "normal" )) {
1174- setvar ( "input.eco.switchable" , "ECO" );
1172+ eco_switchable_str = eaton_input_eco_mode_check_range ( value );
11751173 } else {
11761174 upsdebugx (1 , "ECO switch state is: %s , must be normal before switching to ECO" , eco_switchable_str );
11771175 return NULL ;
11781176 }
11791177
11801178 upsdebugx (1 , "%s: ECO Mode was enabled after switching to Bypass Mode" , __func__ );
1181- return NULL ;
1179+ return eco_switchable_str ;
11821180}
11831181
11841182/* Function to stop ECO(HE) Mode automatically instead of manually stoping Bypass and then Online Mode */
@@ -1202,6 +1200,7 @@ static const char *eaton_input_eco_mode_auto_off_fun(double value)
12021200 eco_switchable_str = dstate_getinfo ("input.eco.switchable" );
12031201 if (!strcmp (eco_switchable_str , "ECO" )) {
12041202 setvar ("input.eco.switchable" , "normal" );
1203+ buzzmode_set ("vendor:mge-hid:normal" );
12051204 } else {
12061205 upsdebugx (1 , "ECO switch state is: %s , must be ECO before switching to normal" , eco_switchable_str );
12071206 return NULL ;
@@ -1213,8 +1212,9 @@ static const char *eaton_input_eco_mode_auto_off_fun(double value)
12131212
12141213/* High Efficiency (aka ECO) mode for auto start/stop commands */
12151214static info_lkp_t eaton_input_eco_mode_auto_on_off_info [] = {
1216- { 1 , "dummy" , eaton_input_eco_mode_auto_on_fun , NULL },
1217- { 0 , "dummy" , eaton_input_eco_mode_auto_off_fun , NULL },
1215+ { 0 , "normal" , eaton_input_eco_mode_auto_off_fun , NULL },
1216+ { 1 , "ECO" , eaton_input_eco_mode_auto_on_fun , NULL },
1217+ { 2 , "ESS" , NULL , NULL },
12181218 { 0 , NULL , NULL , NULL }
12191219};
12201220
@@ -2043,6 +2043,10 @@ static hid_info_t mge_hid2nut[] =
20432043 /* ECO(HE), ESS Mode switch, to use when 'input.bypass.switch.on' is on */
20442044 { "input.eco.switchable" , ST_FLAG_RW | ST_FLAG_STRING , 8 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "%.0f" , HU_FLAG_SEMI_STATIC , eaton_input_eco_mode_on_off_info },
20452045
2046+ /* Needs to be Tested */
2047+ /* Command to switch ECO(HE) Mode on/off with switch to Automatic Bypass Mode on/off before */
2048+ { "experimental.ecomode.auto" , ST_FLAG_RW | ST_FLAG_STRING , 8 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "%.0f" , HU_FLAG_SEMI_STATIC , eaton_input_eco_mode_auto_on_off_info },
2049+
20462050 /* Auto Bypass Mode on/off, to use when 'input.transfer.bypass.forced' is enabled */
20472051 { "input.bypass.switch.on" , ST_FLAG_RW | ST_FLAG_STRING , 8 , "UPS.PowerConverter.Input.[2].SwitchOnControl" , NULL , "%.0f" , HU_FLAG_SEMI_STATIC , eaton_input_bypass_mode_on_info },
20482052 { "input.bypass.switch.off" , ST_FLAG_RW | ST_FLAG_STRING , 12 , "UPS.PowerConverter.Input.[2].SwitchOffControl" , NULL , "%.0f" , HU_FLAG_SEMI_STATIC , eaton_input_bypass_mode_off_info },
@@ -2155,18 +2159,19 @@ static hid_info_t mge_hid2nut[] =
21552159 { "outlet.2.load.on" , 0 , 0 , "UPS.OutletSystem.Outlet.[3].DelayBeforeStartup" , NULL , "0" , HU_TYPE_CMD , NULL },
21562160
21572161 /* Command to switch ECO(HE), ESS Mode */
2158- { "experimental.ecomode.disable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "0" , HU_TYPE_CMD , eaton_input_eco_mode_on_off_info },
2159- { "experimental.ecomode.enable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "1" , HU_TYPE_CMD , eaton_input_eco_mode_on_off_info },
2160- { "experimental.essmode.enable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "2" , HU_TYPE_CMD , eaton_input_eco_mode_on_off_info },
2161- { "experimental.essmode.disable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "0" , HU_TYPE_CMD , eaton_input_eco_mode_on_off_info },
2162- /* Command to switch ECO(HE) Mode with switch to Automatic Bypass Mode on before */
2162+ { "experimental.ecomode.disable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "0" , HU_TYPE_CMD , NULL },
2163+ { "experimental.ecomode.enable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "1" , HU_TYPE_CMD , NULL },
2164+ { "experimental.essmode.enable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "2" , HU_TYPE_CMD , NULL },
2165+ { "experimental.essmode.disable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "0" , HU_TYPE_CMD , NULL },
2166+
2167+ /* Command to switch ECO(HE) Mode with switch to Automatic Bypass Mode on before */
21632168 { "experimental.ecomode.start.auto" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "1" , HU_TYPE_CMD , eaton_input_eco_mode_auto_on_off_info },
21642169 /* Command to switch from ECO(HE) Mode with switch from Automatic Bypass Mode on before */
21652170 { "experimental.ecomode.stop.auto" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "0" , HU_TYPE_CMD , eaton_input_eco_mode_auto_on_off_info },
21662171
21672172 /* Command to switch Automatic Bypass Mode on/off */
2168- { "bypass.start" , 0 , 0 , "UPS.PowerConverter.Input.[2].SwitchOnControl" , NULL , "1" , HU_TYPE_CMD , eaton_input_bypass_mode_on_info },
2169- { "bypass.stop" , 0 , 0 , "UPS.PowerConverter.Input.[2].SwitchOffControl" , NULL , "1" , HU_TYPE_CMD , eaton_input_bypass_mode_off_info },
2173+ { "bypass.start" , 0 , 0 , "UPS.PowerConverter.Input.[2].SwitchOnControl" , NULL , "1" , HU_TYPE_CMD , NULL },
2174+ { "bypass.stop" , 0 , 0 , "UPS.PowerConverter.Input.[2].SwitchOffControl" , NULL , "1" , HU_TYPE_CMD , NULL },
21702175
21712176 /* end of structure. */
21722177 { NULL , 0 , 0 , NULL , NULL , NULL , 0 , NULL }
0 commit comments