The valve level of the HM-CC-RT-DN thermocontroller is being displayed in percent. The valve level of the HmIP-eTRV-2 is a fraction of 1, i. e. percent divided by 100.
Is there any easy way to instruct Openhab in the items file to show the value with a factor of 100, so that it is percent again ?
Number Salon_Hzg2_VALVE
"Salon Hzg2 Ventil [%d %%]"
<heating>
(gSalon_Hzg2)
{channel="homematic:HmIP-eTRV-2:xxxxxxxxx:yyyyyyyyyyyyy:1#LEVEL"}
The generic way to represent a ratio in openHAB would be a Number:Dimensionless type Item.
(Dimmer types too, but thatâs special purpose and not really a good fit here.)
You can (a binding channel can) update a Number:Dimensionless Item state with a numeric with no units, that is assumed to be a ratio âX-to-1â. Which sounds like you are describing the Homematic input as?
The Items state can then be displayed in any âratioâ units you like - %, dB, ppm, etc., using the Itemâs properties.
so, 0.1 auto-converts to 10%
A transformation profile on the link between binding channel and Item can massage the update value (e.g. multiply by 100 and add a % unit) but I donât think that is required here.
Hmmm, Dimmer works correctly except that I donât want the slider to show up. Any way to get rid of that ?
If I set Number:Dimensionless I see the same as before (0%).
My item files are not only used for basic definition but also for display in an admin sitemap. The admin sitemap only defines groups of items, so I cannot modify the individual item control here (a 45 x 10 items sitemap just for my heating controllers is too much effort).
As I said, Dimmer isnât really suitable here. If you want to display it in a different widget, then do so; exactly how depends on the UI in use.
It wonât change until the next update from the device. The auto-convert takes place at the update.
You would need to be getting a plain number from your channel, in a form like â0.1â
And you would need to set the Itemâs default unit to percent, which it looks like you may have already done.
if your Item is defined from xxx.items file (GUI defined Items would need to use metadata, but I think the old fashioned way works in the file case)
I have got a HmIP-eTRV-C2 which probably works similar. I have defined everything in Main UI. The item is defined as Number:Dimensionless. With this definition I had the same problem and instead of 95 % the displayed value was 0,95 % (I think the reason for this problem is that the CCU returns differently for HM an HMIP devices).
I found a solution for this problem by defining a profile for the channel with âMultiply by 1â:
Guessing this is some subtle effect of linking a number type channel to a Quantity type Item. The ânull-transformâ actually converts a pure numeric into a quantity value, number-with-unit, even when the unit remains null.
In the special case of Dimensionless a null unit is a valid unit (ratio).
But plain number direct from the channel is not quite the same as quantity type with no unit from the quantity-aware profile, and a different conversion path is followed.
Reflecting on what is âsupposedâ to happen, it makes sense. If we were to link a channel with numeric update say 0.7 to a Number:Power with kWh units, weâd get 0.7kWH. Linking the same channel to another Number:Power with W units, weâd get 0.7W. i.e. No conversion taks place, no starting units.
Ah, sitemaps in use then.
The Group widget in sitemaps is quite limited; if you let it show the Group members subpage by default you get each member with its default widget by type e.g. Dimmer Item displays with slider.
No choices; neither can you change colours or even the display order of members.
Thatâs great for a quick test, but not much use for a finished user-facing page, so most people move on to configuring the manual way
Group item=myGroup {
Text item=myDimmer
Switch item = mySwitch
}
Now you have full control, but you have to specify every widget. At least you can order them, exclude some members, even show non-members; but no auto member action.
Thatâs quite some effort which I do for the user display (= sitemap). My admin display (sitemap) shows all items for all things grouped by room / floor or building. Since this admin display is quite populated I prefer to define all items in the item files. My admin sitemap simply defines the order of rooms to be displayed. When everything is defined correctly in the item files the effort for the sitemap is very small. Thatâs why I want to concentrate on the items - not on the sitemap.
Iâm not convinced this text defined Item ends up with an effective default unit.
For experiment, create a new Item (different name of course). Assign % unit in metadata state presentation stuff. Link to homematic channel (it is okay to link multiple Items to any channel).
Thanks for your input. I stay with the dimmer setting for the time being, as proposed by the binding. It shows the stupid slider but everything else is as I want it.