KNX Dimmers

Hi,

How should I write a dimmervalue to a KNX-dimmer from rules-script?

I have tried this, but it does not work:

Item:
Dimmer Loft_living_spot “Loftliving light” (gLoftliving, gLightsSecondFloor) [ “Lighting” ] { knx=“1.001:1/0/2+1/0/16, 5.001:1/0/3+1/0/9” }

Rule:
rule "Test"
when
Item Loft_living_spot received command ON
then
var Number LightIntensity1

LightIntensity1=90
while(LightIntensity1 > 0) {
	LightIntensity1=LightIntensity1-5
	sendCommand(Loft_living_spot, LightIntensity1)
	Thread::sleep(1000)
}

end

I can trigger the rule, but the spot does not dim…

Please use method instead of action:

rule "Test"
when
    Item Loft_living_spot received command ON
then
    var Number LightIntensity1
    LightIntensity1=90
    while(LightIntensity1 > 0) {
        LightIntensity1=LightIntensity1-5
        Loft_living_spot.sendCommand(LightIntensity1)
        Thread::sleep(1000)
    }
end

Thanks!

It still does not dim my spot…

I get this in my log, but the spots are not dimming, just turning off and on when i slide the switch in Basic UI:

2017-08-21 22:54:14.286 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 80

2017-08-21 22:54:15.297 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 75

2017-08-21 22:54:16.306 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 70

2017-08-21 22:54:17.321 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 65

2017-08-21 22:54:18.335 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 60

2017-08-21 22:54:19.350 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 55

2017-08-21 22:54:20.358 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 50

2017-08-21 22:54:21.367 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 45

2017-08-21 22:54:22.393 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 40

2017-08-21 22:54:23.407 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 35

2017-08-21 22:54:24.425 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 30

2017-08-21 22:54:25.432 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 25

2017-08-21 22:54:26.450 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 20

2017-08-21 22:54:27.451 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 15

2017-08-21 22:54:28.466 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 10

2017-08-21 22:54:29.475 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 5

2017-08-21 22:54:30.488 [ItemCommandEvent ] - Item ‘Loft_living_spot’ received command 0

Sorry…I found the Problem…wrong KNX-adr. for that one Item…I had used the Dim-adr…

Now it works.

Thanks :slight_smile:

:slight_smile: