@@ -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 }
@@ -1151,73 +1151,6 @@ static info_lkp_t eaton_input_bypass_mode_off_info[] = {
11511151 { 0 , NULL , NULL , NULL }
11521152};
11531153
1154- /* Function to start ECO(HE) Mode automatically instead of manually starting Bypass and then ECO(HE) Mode */
1155- static const char * eaton_input_eco_mode_auto_on_fun (double value )
1156- {
1157- const char * bypass_switch_on_str = NULL ;
1158- const char * eco_switchable_str = NULL ;
1159-
1160- NUT_UNUSED_VARIABLE (value );
1161-
1162- /* Check if input.bypass.switch.on is disabled and set it to 'on' */
1163- bypass_switch_on_str = dstate_getinfo ("input.bypass.switch.on" );
1164- if (!strcmp (bypass_switch_on_str , "disabled" )) {
1165- setvar ("input.bypass.switch.on" , "on" );
1166- } else {
1167- upsdebugx (1 , "Bypass switch on state is: %s , must be disabled before switching on" , bypass_switch_on_str );
1168- return NULL ;
1169- }
1170-
1171- /* Check if input.eco.switchable is normal and set it to 'ECO' */
1172- eco_switchable_str = dstate_getinfo ("input.eco.switchable" );
1173- if (!strcmp (eco_switchable_str , "normal" )) {
1174- setvar ("input.eco.switchable" , "ECO" );
1175- } else {
1176- upsdebugx (1 , "ECO switch state is: %s , must be normal before switching to ECO" , eco_switchable_str );
1177- return NULL ;
1178- }
1179-
1180- upsdebugx (1 , "%s: ECO Mode was enabled after switching to Bypass Mode" , __func__ );
1181- return NULL ;
1182- }
1183-
1184- /* Function to stop ECO(HE) Mode automatically instead of manually stoping Bypass and then Online Mode */
1185- static const char * eaton_input_eco_mode_auto_off_fun (double value )
1186- {
1187- const char * bypass_switch_off_str = NULL ;
1188- const char * eco_switchable_str = NULL ;
1189-
1190- NUT_UNUSED_VARIABLE (value );
1191-
1192- /* Check if input.bypass.switch.off is disabled and set it to 'off' */
1193- bypass_switch_off_str = dstate_getinfo ("input.bypass.switch.off" );
1194- if (!strcmp (bypass_switch_off_str , "disabled" )) {
1195- setvar ("input.bypass.switch.off" , "off" );
1196- } else {
1197- upsdebugx (1 , "Bypass switch off state is: %s , must be disabled before switching off" , bypass_switch_off_str );
1198- return NULL ;
1199- }
1200-
1201- /* Check if input.eco.switchable is 'ECO' and set it to normal */
1202- eco_switchable_str = dstate_getinfo ("input.eco.switchable" );
1203- if (!strcmp (eco_switchable_str , "ECO" )) {
1204- setvar ("input.eco.switchable" , "normal" );
1205- } else {
1206- upsdebugx (1 , "ECO switch state is: %s , must be ECO before switching to normal" , eco_switchable_str );
1207- return NULL ;
1208- }
1209-
1210- upsdebugx (1 , "%s: ECO Mode was disabled after switching from Bypass Mode" , __func__ );
1211- return NULL ;
1212- }
1213-
1214- /* High Efficiency (aka ECO) mode for auto start/stop commands */
1215- static 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 },
1218- { 0 , NULL , NULL , NULL }
1219- };
1220-
12211154/* Determine country using UPS.PowerSummary.Country.
12221155 * If not present:
12231156 * if PowerConverter.Output.Voltage >= 200 => "Europe"
@@ -2155,18 +2088,14 @@ static hid_info_t mge_hid2nut[] =
21552088 { "outlet.2.load.on" , 0 , 0 , "UPS.OutletSystem.Outlet.[3].DelayBeforeStartup" , NULL , "0" , HU_TYPE_CMD , NULL },
21562089
21572090 /* 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 */
2163- { "experimental.ecomode.start.auto" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "1" , HU_TYPE_CMD , eaton_input_eco_mode_auto_on_off_info },
2164- /* Command to switch from ECO(HE) Mode with switch from Automatic Bypass Mode on before */
2165- { "experimental.ecomode.stop.auto" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "0" , HU_TYPE_CMD , eaton_input_eco_mode_auto_on_off_info },
2091+ { "experimental.ecomode.disable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "0" , HU_TYPE_CMD , NULL },
2092+ { "experimental.ecomode.enable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "1" , HU_TYPE_CMD , NULL },
2093+ { "experimental.essmode.enable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "2" , HU_TYPE_CMD , NULL },
2094+ { "experimental.essmode.disable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "0" , HU_TYPE_CMD , NULL },
21662095
21672096 /* 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 },
2097+ { "bypass.start" , 0 , 0 , "UPS.PowerConverter.Input.[2].SwitchOnControl" , NULL , "1" , HU_TYPE_CMD , NULL },
2098+ { "bypass.stop" , 0 , 0 , "UPS.PowerConverter.Input.[2].SwitchOffControl" , NULL , "1" , HU_TYPE_CMD , NULL },
21702099
21712100 /* end of structure. */
21722101 { NULL , 0 , 0 , NULL , NULL , NULL , 0 , NULL }
0 commit comments