@@ -1025,6 +1025,51 @@ static info_lkp_t eaton_input_bypass_mode_off_info[] = {
10251025 { 0 , NULL , NULL , NULL }
10261026};
10271027
1028+ /* Function to start ECO(HE) Mode automatically instead of manually starting Bypass and then ECO(HE) Mode */
1029+ static const char * eaton_input_eco_mode_auto_on_fun (double value )
1030+ {
1031+ const char * bypass_switch_off_str = NULL ;
1032+ const char * bypass_switch_on_str = NULL ;
1033+ const char * eco_switchable_str = NULL ;
1034+
1035+ NUT_UNUSED_VARIABLE (value );
1036+
1037+ /* Check if input.bypass.switch.on is disabled and set it to 'on' */
1038+ bypass_switch_on_str = dstate_getinfo ("input.bypass.switch.on" );
1039+ if (!strcmp (bypass_switch_on_str , "disabled" )) {
1040+ setvar ("input.bypass.switch.on" , "on" );
1041+ } else {
1042+ upsdebugx (1 , "Bypass switch on state is: %s , must be disabled before switching on" , bypass_switch_on_str );
1043+ return NULL ;
1044+ }
1045+
1046+ /* Check if input.eco.switchable is normal and set it to 'ECO' */
1047+ eco_switchable_str = dstate_getinfo ("input.eco.switchable" );
1048+ if (!strcmp (eco_switchable_str , "normal" )) {
1049+ setvar ("input.eco.switchable" , "ECO" );
1050+ } else {
1051+ upsdebugx (1 , "ECO switch state is: %s , must be normal before switching to ECO" , eco_switchable_str );
1052+ return NULL ;
1053+ }
1054+
1055+ /* Check if input.bypass.switch.off is disabled and set it to 'off' */
1056+ bypass_switch_off_str = dstate_getinfo ("input.bypass.switch.off" );
1057+ if (!strcmp (bypass_switch_off_str , "disabled" )) {
1058+ setvar ("input.bypass.switch.off" , "off" );
1059+ } else {
1060+ upsdebugx (1 , "Bypass switch off state is: %s , must be disabled before switching off" , bypass_switch_off_str );
1061+ return NULL ;
1062+ }
1063+ upsdebugx (1 , "%s: ECO Mode was enabled after switching to Bypass Mode" , __func__ );
1064+ return NULL ;
1065+ }
1066+
1067+ /* High Efficiency (aka ECO) mode for auto start command */
1068+ static info_lkp_t eaton_input_eco_mode_auto_on_info [] = {
1069+ { 1 , "dummy" , eaton_input_eco_mode_auto_on_fun , NULL },
1070+ { 0 , NULL , NULL , NULL }
1071+ };
1072+
10281073/* Determine country using UPS.PowerSummary.Country.
10291074 * If not present:
10301075 * if PowerConverter.Output.Voltage >= 200 => "Europe"
@@ -1957,6 +2002,8 @@ static hid_info_t mge_hid2nut[] =
19572002 { "ecomode.enable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "1" , HU_TYPE_CMD , eaton_input_mode_info },
19582003 { "essmode.enable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "2" , HU_TYPE_CMD , NULL },
19592004 { "essmode.disable" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "0" , HU_TYPE_CMD , NULL },
2005+ /* Command to switch ECO(HE) Mode with switch to Automatic Bypass Mode on befor */
2006+ { "ecomode.start.auto" , 0 , 0 , "UPS.PowerConverter.Input.[5].Switchable" , NULL , "1" , HU_TYPE_CMD , eaton_input_eco_mode_auto_on_info },
19602007
19612008 /* Command to switch Automatic Bypass Mode On/Off */
19622009 { "bypass.start" , 0 , 0 , "UPS.PowerConverter.Input.[2].SwitchOnControl" , NULL , "1" , HU_TYPE_CMD , eaton_input_bypass_mode_on_info },
0 commit comments