Problem with Channel Link with Profile Hysterese and Channel Type Number:Dimensionless

  • Platform information:
    • Hardware: Raspberry Pi 4/ARM/4GB RAM/64GB HDD
    • OS: Linux 5.4.51-v71+
    • Java Runtime Environment: Zulu 11.43+88-CA
    • openHAB version: 3.0.0
  • Issue of the topic:
    • I am using the HP Printer Binding to monitor my ink levels and get informed when it drops lower than a defined threshold. With openHAB 3.0 I figured out that I can use the new (?) profiles on the channel link instead of implementing it as a rule.
      The problem right now is that it does not work because of the channel type being Number:Dimensionless. Therefore I need to define the threshold in the hysterese profile with the unit ‘%’.
      This leads to a log warning (see below). As soon as the channel link is added to the item a state description pattern (see below) is added. I guess it is derived from the channel type.
      Does anyone has a similar use-case with percentage values? Is there a simple solution in conjunction with profiles?
  • Please post configurations (if applicable):
    • Switch Item LowInkLevel
    • Channel Link HpPrinter_BlackLevel (Number:Dimensionless)
      • Profile Hysterese 10 %
  • If logs where generated please post these here using code fences:
    • [WARN ] [e.internal.SseItemStatesEventBuilder] - Exception while formatting value ‘OFF’ of item LowInkLevel with format ‘%f %%’: f != java.lang.String
    • {
      “stateDescription”: {

      “pattern”: “%f %%”

I have the same error and just found a documented issue report incl. workaround here:

Thanks for the link to the open issue. The workaround described there is what I also figured out but the switch itself is then lost only state description will remain.

If there is the need to see the Switch again you have to change the “Read-Only” property to false. Thus can be set in the same location where you added the pattern (one item above - if I remember correctly).

Thanks for the hint. Will try it out when I‘m back home :ok_hand:

Worked out :ok_hand: