[SOLVED] Rule for Convert and send dimmervalue

Hello,

i’m trying to come up with a rule for dimmer.
In KNX the percentage range for the dimmer goes from 1-100, but the lamp itself is already fully lit at 30%.
So I would like to convert the value that is set for dimming accordingly.
Say: If Openhab sends 50%, then calculate (30/100)*50=15%.
This value should then actually be set as the dimming value.
Of course it is important that I do not get into a loop :wink:
Does anyone have a hot tip for me?

Use a proxy item and a rule

Thanks!
That little hint helped me a lot :wink:

That’s the idea!

Please post your solution for future users, thanks
And tick the solution post.

I’m happy to do that!
First I had a dimmer actuator under things and linked it to the item “Esstisch Dimmer”
But as the lights were already fully lit at 10%, the handling was too complicated.

So I removed the linking between the two and created a new item “EG_Dimmeraktor_Esstisch” and linked it with the Thing dimmeraktor.

For this I wrote a simple rule, which sends a value to “EG_Dimmeraktor_Esstisch” when changing “Esstisch Dimmer”.

rule "Esstischdimmer"
when 
Item Esstisch_Dimmer received command 
then
if((Esstisch_Dimmer.state as DecimalType) <= 10)
{
    EGDimmeraktorEsstisch.sendCommand(1)
}
else if((Esstisch_Dimmer.state as DecimalType) <= 20)
{
    EGDimmeraktorEsstisch.sendCommand(2)
}
else if((Esstisch_Dimmer.state as DecimalType) <= 30)
{
    EGDimmeraktorEsstisch.sendCommand(3)
}
else if((Esstisch_Dimmer.state as DecimalType) <= 40)
{
    EGDimmeraktorEsstisch.sendCommand(4)
}
else if((Esstisch_Dimmer.state as DecimalType) <= 50)
{
    EGDimmeraktorEsstisch.sendCommand(5)
}
else if((Esstisch_Dimmer.state as DecimalType) <= 60)
{
    EGDimmeraktorEsstisch.sendCommand(6)
}
else if((Esstisch_Dimmer.state as DecimalType) <= 70)
{
    EGDimmeraktorEsstisch.sendCommand(7)
}
else if((Esstisch_Dimmer.state as DecimalType) <= 80)
{
    EGDimmeraktorEsstisch.sendCommand(8)
}
else if((Esstisch_Dimmer.state as DecimalType) <= 90)
{
    EGDimmeraktorEsstisch.sendCommand(9)
}
else if((Esstisch_Dimmer.state as DecimalType) > 90)
{
    EGDimmeraktorEsstisch.sendCommand(10)
}
end