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?
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.
Because DPT 5.001 is 8 bit unsigned. 0 % → 0100 % → 255.
There is no accurate knx value for 1 %, 1 % * 255 → 2.55, round to 3, which is → 1.1764...% and that’s rounded, too.
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)
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?