Does the current behaviour make sense? I get that unit/dimension is stripped when sending to plain Number item (also noted in release notes).
But I do find it unexpected that the same is done with items having Number:DIM, depending on channel type. Essentially this means that the command handling depends also on channel type, not just item type.
Downside is concretely demonstrated here: profiles are more limited with commands, they cannot mutate/change with the dimension/unit.
I have not received any feedback or comments to the above query from core maintainers. As the profile is one of its kind (dealing with UoM two directions), it might remain a niche use case
As such, gain offset profile is broken with recent openHAB versions.
One can workaround the issue by using eg 2 different javascript functions to scale to/from item
Stripping off the UoM works two-way, I have posted my configuration here (funny enough the reason why I was looking into the profile is due to another issue with JS transformer introduced in OH 4.0)
I came across the same issue today. Would it be a solution if the Modbus binding ignored the unit when doing the conversion from command to thing? Since it doesnât receive a unit from core anyways, there is nothing else possible than to apply the gain to the plain number.
Or would the Modbus channel need another configuration to set itâs type?
For now I will go with a plain number item, but that is unsatisfactory.