Gain-Offset Correction don't work with Numer:Time channel

  • Platform information:
    • Hardware: CPUArchitecture/RAM/storage
    • OS: Raspbian GNU/Linux 10 (buster)
    • Java Runtime Environment: 11.0.12
    • openHAB version: 3.2.0
  • Issue of the topic:
    I like to use a channel from the fritzbox tr064 plugin what show the wan connection time. This channel is from Type Number:Time. Connecting it to an Intem of type Number:Time shows me something like 65432 s. I like to convert this numer to hours to make it more readable, so i tried to configure a Gain-Offset Correction. But do with any Gain value it just shows the value UNDEF in the Item. How can I do configure this?

Not sure what you think that will do. Are you trying to divide by 3600 or something? xx seconds divided by 3600 is just zz seconds, there will be no magic conversion to hours.

To display in hours, add a unit ā€œhā€ to your Itemā€™s state description ā€˜patternā€™ metadata.

1 Like

I would follow advice from rossko57.

In addition, if you refer to gain-offset profile offered by modbus binding (See section in docs), that is not meant for converting quantity-aware numbers from the binding, only plain/raw numbers ā€“ it will not work and probably error is logged:

In addition, the profile allows attaching units to the raw numbers, as well as converting the quantity-aware numbers to bare numbers on write.

Thanks for your hint. :+1: I was not aware of the metadata. After recreating my configuration during migration from OH2 to OH3 via the UI I missed where to add such details.

After your hint I know what to search for and I found the following entry what help me to fix my issue.

1 Like