Dimmer: handle values between 0 and 1

Hello everyone,
I have a problem with my MDT KNX dimming actuators.
I have limited the dimming range of the light source, which causes the range to be rescaled. If I dim the channel relatively all the way down using the wall switch, I get 0.4% back as the current dimming value. This is then displayed as 0% by the switch and dimmer items, although the light is actually still on.

Is there a solution for this other than using a profile script to round the value differently?
if 0<x<=1
then x = 1

The following image shows a sequence from the KNX bus.
(Light was relatively dimmed to the lowest possible value via the wall switch)

Light is switched off
Dimmer reports inactive and 0% back

Light is switched on
Dimmer reports active and 0.4% back

In openhab, switch and dimmer slider are then off and 0%

if I set the slider to 1%, then the dimmer reports 1.2% back
Edit: I just realized, that the slider is sending out 1,2 in the line before the last line. Huh?

I look forward to help
Thanks

Which version of openHAB do you use?
What’s your channel configuration of the dimmer in openHAB?

In question of recalculation of dimmer values: This may not be correct, at least it’s not true for my dimmers. If I restrict the maximum to, let’s say 80 %, the dimmer will simply stop at 80 %. it will result in less possible steps for the dimmer, and that’s it.

Hi,

I’m on openHAB 4.3.3

This is my limit setting in ETS:

I tried to recalculate the range in excel with this formular, but no luck so far: return ((value - 5) / 95) * 100;

My thing config:

UID: knx:device:7091113870:990f3045fb
label: KNX EG Dimmaktor 1
thingTypeUID: knx:device
configuration:
  pingInterval: 600
  address: 1.1.4
  readInterval: 0
  fetch: false
bridgeUID: knx:ip:7091113870
location: Technikraum
channels:
  - id: dimmerKuecheArbeitslicht
    channelTypeUID: knx:dimmer
    label: Licht Küche Arbeitsplatte
    configuration:
      increaseDecrease: 3.007:1/2/1
      position: 5.001:1/4/1+<1/3/1
      switch: 1/0/12+<1/1/12

Edit:
The documentation from MDT says the same as you stated:

Hmm, I have to think about this :slight_smile:

Edit:

But Why is OH sending out 1.2% on 1% on the slider? Is there an issue on my KNX bus?

Because DPT 5.001 is 8 bit unsigned. 0 %0 100 %255.
There is no accurate knx value for 1 %, 1 % * 2552.55, round to 3, which is → 1.1764...% and that’s rounded, too.

All right, thanks, that makes sense.

Can I change the Slider and Switch items to float? That would be great. Or via JS script?

(function(data) {
  // Prüfen, ob der Zustand eine Zahl ist
  if (!isNaN(data)) {
    var value = parseFloat(data);
    if ((value > 0.01) && (value < 1.00)) {
      return 1.00;
    }
  }
  var retVal = data;
  return data;
})(input)

THis is not working as I would expect.

But if the percentage value is parsed to 8 bit unsigned, then the lowest value on the KNX bus cannot be mapped in openhab? Hence the question about switching to float.

OK, it now looks like the topic title is still correct, but my first post missed the (real) point.

So my dimmer (and any other KNX spec dimmer) behaves in such a way that values between 0 and 1 are sent even without the range restriction with regard to the feedback (status).

Can I somehow change the dimmer item so that it can display floats/decimals instead of integers?

Somehow I can’t find anything about this on the net, although everyone with a KNX installation should now have the problem if they dim the channel to the minimum.

I would appreciate elegant solutions to this problem.
Many thanks

I’m sorry for the double posts.
I have now debugged the ECMA script engine a bit and unfortunately the JS function is already passing an integer. is this something I should point out on github, if so where?

Edit: [knx] Binding: Dimmer Status (DPT 5.001) Incorrectly Parsed as Integer · Issue #18363 · openhab/openhab-addons · GitHub