OH3 Profile Offset does not work

I have an Temperature Item i want to offset -1 degrees.

Number:Temperature    Outdoor_Sensor_Temperature        "Garden Temperature [%.1f °C]"          <temperature>    (geOutdoor_Sensor, gpC)                              ["Measurement", "Temperature"]    {channel="rfxcom:temperaturehumidity:usb0:35585:temperature" [profile="offset", profile-parameterID="-1 °C"]}

i have also tried

Number:Temperature    Outdoor_Sensor_Temperature        "Garden Temperature [%.1f °C]"          <temperature>    (geOutdoor_Sensor, gpC)                              ["Measurement", "Temperature"]    {channel="rfxcom:temperaturehumidity:usb0:35585:temperature" [profile="offset", profile-parameterID="-1"]}

According to the docs it can handle UoM. Maybe it needs to use the same syntax as in rules.

"-1 |°C"

I’m sure I’ve seen somewhere that the | is purely for rules, not needed here.

But is the rfxcom channel really a Quantity type? I don’t think you can offset a simple number with a quantity with units and expect it to work.

If that is the problem,you should be able to do this with a JS transform profile instead - do the numeric offset and add " °C" to return string,mating number channel to Number:Temperature Item.

But is this not what the offset profile is intended for.
If it does not work we should remove it.

So far as I can see, the profile is intended to provide an offset.
2345 + 1
22km + 100m
Like for like.
Not intended to add units to a number.
23 + 1 °C
would make no sense - 23 what? °K °F

I might be wrong that your channel is a plain number, and there is a profile bug. Would you check?

But the number is Number:Temperature so what i want to do is 23°C + 1°C.

What I’m asking about is the binding channel type that you have linked your Item to. These have types, just like Items, The RFXCOM binding docs are not super clear on this, but it looks like plain number channel.

RFXcom binding is not using Units

<?xml version="1.0" encoding="UTF-8"?>

-<thing:thing-descriptions xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bindingId="rfxcom">


-<thing-type id="temperaturehumidity">


-<supported-bridge-type-refs>

<bridge-type-ref id="bridge"/>

<bridge-type-ref id="tcpbridge"/>

<bridge-type-ref id="RFXtrx433"/>

<bridge-type-ref id="RFXrec433"/>

</supported-bridge-type-refs>

<label>RFXCOM Temperature-Humidity Sensor</label>

<description>A Temperature-Humidity device.</description>


-<channels>

<channel id="temperature" typeId="temperature"/>

<channel id="humidity" typeId="humidity"/>

<channel id="humidityStatus" typeId="humiditystatus"/>

<channel id="signalLevel" typeId="system.signal-strength"/>

<channel id="batteryLevel" typeId="system.battery-level"/>

<channel id="lowBattery" typeId="system.low-battery"/>

</channels>


-<config-description>


-<parameter required="true" type="text" name="deviceId">

<label>Device Id</label>

<description>Sensor Id. Example 56923</description>

</parameter>


-<parameter required="true" type="text" name="subType">

<label>Sub Type</label>

<description>Specifies device sub type.</description>


-<options>

<option value="TH1">THGN122/123, THGN132, THGR122/228/238/268</option>

<option value="TH2">THGR810, THGN800</option>

<option value="TH3">RTGR328</option>

<option value="TH4">THGR328</option>

<option value="TH5">WTGR800</option>

<option value="TH6">THGR918/928, THGRN228, THGN500</option>

<option value="TH7">TFA TS34C, Cresta</option>

<option value="TH8">WT260,WT260H,WT440H,WT450,WT450H</option>

<option value="TH9">Viking 02035,02038 (02035 has no humidity), Proove TSS320, 311501</option>

<option value="TH10">Rubicson</option>

<option value="TH11">EW109</option>

<option value="TH12">Imagintronix/Opus XT300 Soil sensor</option>

<option value="TH13">Alecto WS1700 and compatibles</option>

</options>

</parameter>

</config-description>

</thing-type>

</thing:thing-descriptions>

so the binding need to use units to use profile offset?

The binding Channel dictates what type of Item needs to be linked to that Channel. Therefore the Binding Channel will dictate whether or not to use a Number or a Number:Temperature. If the binding doesn’t say Number:Temperature, you can’t use a Number:Temperature.

The profile only works when it uses the same units as the Item. If it’s a Number Item, you can’t use units in the offset profile. If it’s a Number:Temperature, you must use a temperature unit in the offset profile.

tl;dr: It has to match up from end to end. If the binding doesn’t require Number:Temperature, you can’t use units anywhere along the line. If the binding does require Number:Temperature, you must use units everywhere along the line.

Even if the RFXCOM binding is Number i have used Number:Temperature and the only thing i have had problem with is Profile offset.
Then maybe i do a PR to add Units to the rfxcom binding.
I will try the offset on another binding that i know is using Units for the Items.(I have built it :slight_smile: )

Yep, the “in” and the “out” of the profile don’t match.

You can make your Item into a Number type and apply offset profile without units.

Or you can, as previously suggested, use a transform profile with script to both offset and add units to the plain number channel, and match it to the Number:Temperature Item.

Don’t see why not.
But it’s only sensible if the end device either consistently only supplies data in one unit form (e.g no C/F option), or supplies units info along with the data.

When i try it on a Temperature channel it works ok.

Well that’s good news then.