[networkupstools] New UPS status in version 3.2.0

After the upgrade OH3 to final 3.2.0 release version Network UPS Tools binding does not work as expected.
I know that new status has been added.
Now when UPS is online it show in MainUI and in classic site map “CHRG LB = Online, charging, low battery
Which is not true. It is in OL state.
upsc shows ups.status: OL

What is more weird is that in Karaf console it shows status of the item as OL

To be honest I never saw such state as CHRG LB = Online, charging, low battery for my APC Smart-UPS 1500.

1 Like

To acquire new properties (the text options) you will need I think to delet your old Thing and create new. If you use the same UID it should link up to existing Items.

But new options from what? My UPS does not have such statuses.

Here it is stated that:

APC UPS returns status “OL CHRG” while charging. openHAB only recognizes the “0L”.

As mentioned in first post it is not true in my case.

It’s where the message comes from

Examine your Item using API explorer and look for ‘state options’, these are passed in from the binding Thing.

I have something like this:

{
  "link": "http://192.168.0.131:8080/rest/items/ups_status",
  "state": "OL",
  "stateDescription": {
    "pattern": "%s",
    "readOnly": true,
    "options": [
      {
        "value": "OFF",
        "label": "Off"
      },
      {
        "value": "OL",
        "label": "CHRG LB = Online, charging, low battery"
      },
      {
        "value": "OB",
        "label": "On battery"
      },
      {
        "value": "LB",
        "label": "Low battery"
      },
      {
        "value": "CHRG",
        "label": "Charging"
      },
      {
        "value": "OL CHRG",
        "label": "Online, charging"
      },
      {
        "value": "OL LB",
        "label": "Online, low battery"
      },
      {
        "value": "OL CHRG LB",
        "label": "Online, charging, low battery"
      },
      {
        "value": "RB",
        "label": "Replace battery"
      },
      {
        "value": "OVER",
        "label": "Overload"
      },
      {
        "value": "TRIM",
        "label": "Voltage trim"
      },
      {
        "value": "BOOST",
        "label": "Voltage boost"
      },
      {
        "value": "CAL",
        "label": "Calibration"
      },
      {
        "value": "BYPASS",
        "label": "Bypass"
      },
      {
        "value": "NULL",
        "label": "Null"
      }
    ]
  },
  "commandDescription": {
    "commandOptions": [
      {
        "command": "OFF",
        "label": "Off"
      },
      {
        "command": "OL",
        "label": "CHRG LB = Online, charging, low battery"
      },
      {
        "command": "OB",
        "label": "On battery"
      },
      {
        "command": "LB",
        "label": "Low battery"
      },
      {
        "command": "CHRG",
        "label": "Charging"
      },
      {
        "command": "OL CHRG",
        "label": "Online, charging"
      },
      {
        "command": "OL LB",
        "label": "Online, low battery"
      },
      {
        "command": "OL CHRG LB",
        "label": "Online, charging, low battery"
      },
      {
        "command": "RB",
        "label": "Replace battery"
      },
      {
        "command": "OVER",
        "label": "Overload"
      },
      {
        "command": "TRIM",
        "label": "Voltage trim"
      },
      {
        "command": "BOOST",
        "label": "Voltage boost"
      },
      {
        "command": "CAL",
        "label": "Calibration"
      },
      {
        "command": "BYPASS",
        "label": "Bypass"
      },
      {
        "command": "NULL",
        "label": "Null"
      }
    ]
  },
  "editable": false,
  "type": "String",
  "name": "ups_status",
  "label": "Alarm",
  "tags": [],
  "groupNames": []
}

Well, there is the source of your unwanted message.

Because your Thing and Item pre-date the changes, I do not know if your Item has some kind of old+new mashup. The “OL” option does not correspond with what is seen here -

This is cause by what is a bug in the generated properties file. See [i18:generate-default-translations] keys in options list with spaces are incorrectly generated · Issue #2636 · openhab/openhab-core · GitHub and also see [networkupstools] correct state description for states Online, etc by holgerfriedrich · Pull Request #11828 · openhab/openhab-addons · GitHub

If I understand correctly, the fix will be available in openHAB3.3 milestone and there won’t be a 3.2.1 version. Is this correct?

Is there any local fix of this problem?

@Lionello_Marrelli probably yes as you can see here

Yes, you can manually install a patched version of the binding:

(For example from the latest SNAPSHOT build of 3.3.0:) https://ci.openhab.org/job/openHAB-Addons/lastSuccessfulBuild/artifact/bundles/org.openhab.binding.networkupstools/target/org.openhab.binding.networkupstools-3.3.0-SNAPSHOT.jar

Just put the jar in the addons folder of openHAB and wait until openHAB loads the jar.