MQTT Homie Dimmer item value scale

I know it has been a while but I am encountering this issue as well. Homie 3 spec is detecting everything as intended / i see the type set as integer and the range set as 1:100 in mqtt but openhab is sending decimals. IE 50% as .5 - this obviously doesnt work - how can we work around this? I can make the item a ‘number’ format and that kindof works as it doesn’t translate the 50 to .5 before sending but that also messes with other things like alexa control as its no longer a dimmer. I have 50+ bulbs so preferably anything I can do within the items file is preferred vs attempting to edit each channel in paper UI. even better - is there a way to force openhab to actually follow the homie spec as advertised rather than ignore it? I’m running 2.5.2 release build.

Thank you!

No, this problem keeps coming up and has been discussed but not formally addressed. I use .items files that look like below. What devices are you using?

Dimmer  MF_PantryLight_Dimmmer                      "Pantry Light"                          <light>     (gMF_Pantry,gLightSwitch,gOccupancyItem)                ["Lighting"]                            {alexa="disable",channel="mqtt:homie300:Queen:dimmer-19d01a1:dimmer#dimmer", OccupancyEvent = "OnOff"}                                                          
                                                        

Looks relevant

Mine is similar - however that fails me because openhab outputs a .25 for 25%. I’m using this with a hubitat hub so luckily I’ve been able to custom mod the code on the hub side to multiply this back out and make it into an integer. I honestly feel this is a no brainer that openhab should be following the specification defined in the homie 3 discovery (publishes a format of 0:100). I’m only doing this because the built in zigbee is useless to me now that there is no way to tell if a bulb is on or its dimmer state when it is in CT mode.

Dimmer Light_GuestShower_DM {channel=“mqtt:homie300:7d0ef5b3:hubitat:guest_2Dshower#dim”}

I’m confused by the wording of that - it says if there is a % character found within the unit value then it will send percentage - else it will do ‘the old way’. Isn’t ‘the old way’ how it is now where it is sending a percentage already? Why do we need extra attributes when you already have a defined range? we can map that with the fact a dimmer is always 0-100 and map it out. IE homie publishes range of 0-50. OH should then know 100% on a dimmer is 50 and 50% dimmer is a 25. This seems incredibly simple to me. Is there something I’m missing? …

Don’t ask me. So far as I can see, there are doubts about what the homie spec is, a % or a fraction of 1.

FYI, this has been fixed in 2.5.4. If a property has the % as the unit type, it is not longer converted to a fraction. The Homie4 python package has been changed to reflect this.