Rule to Change the value and the whole group address on knx

Hi guys ,

i need a rule to Change a Group address into another Group address.

I want to start a Scene on knx and in the same way an Effekt on my dali Gateway.

So after the Group address 10/0/0 with the value 1 was sent, my OH should convert this Group address into 10/0/2 with the value 128 to start the effect in Dali.

To end the Scene the goup address 10/0/0 with the vaule 2 is sent.
So OH Needs to convert that into 10/0/2 with value 0.

So far so good, but my Gateway doesn´t check the EVG Status after Effekt stop. So there must be another Group address to turn off all EVG´s after Effect stop.

It should work like this: 10/0/0 value 1 => 10/0/2 value 128
10/0/0 value 2 => 10/0/2 value 0 + 10/0/3 (Group address to turn off the effect EVG´s)

Is that possible, or anyone has experience with KNX Scenes with a ipas e64 effect?

Thanks for Support
Vaillan

If I got it right, you want openHAB to send a command when another command is received. You will need one Item per GroupAddress:

Number MySwitch {knx="10/0/0"}
Number Dali {knx="10/0/2"}
Switch EVG {knx="10/0/3"}

Further you need a rule to handle address translation:

rule "Dali"
when
    Item MySwitch received command
then
    if ((receivedCommand as Number).intValue == 1) }
        EVG.sendCommand(ON)  //I guess EVG has to be turned on
        Dali.sendCommand(128)
    }
    else if ((receivedCommand as Number).intValue == 2) {
        Dali.sendCommand(0)
        EVG.sendCommand(OFF)
    }
end

MySwitch will receive the command from knx. If a command is received, the rule will trigger. Depending on the received command the rule will either start or stop the effect.

Thanks for your intructions and the whole script.

This is much more i have expected.

I gonna try it and give Feedback if it works.

Thanks
Vaillan

It does not work.

My item programming Looks like this:

/Szene Bad 1.OG/

Number Szene_Bad_OG_start {knx=“10/0/3”}
Number Dali_Effekt_1 {knx=“10/0/1”}
Switch EVG_BAD_OG_RGBW_AUS {knx=“10/0/2”}

And the rule is made like this:

rule "Dali Effekt Bad 1.OG"
when
Item Szene_Bad_OG_start received command
then
if ((receivedCommand as Number).intValue == 1) {
Dali_Effekt_1.sendCommand(128)
}
else if ((receivedCommand as Number).intValue == 2) {
Dali_Effekt_1.sendCommand(0)
createTimer(now.plusSeconds(2))[
EVG_BAD_OG_RGBW_AUS.sendCommand(OFF)
]
}
end

But OH does not recognizes the Group address 10/0/3 and so the rule does not work.
I don´t have any log entry.

Is it possible that OH expects a Number but KNX sends a 17.001 Scene Number?

I hope you can help me.

Best regards
Vailan

If using a Scene Group address, you have to set the correct DPT:

Number Szene_Bad_OG_start {knx="17.001:10/0/3"}

Please be aware that your whole posting contains smart quotes. Maybe this is due to the fact, that you quoted your code without code fences (top of the forum editor)
```

your code goes here

```
But maybe you used the wrong quotes within your code, please ensure not to use smart quotes at all.

Simple but awesome.

So OH is able to read each KNX data type if it´s followed by colon and the Group address?
This is nice to know for other rules.

Now i am using my OH only to show states, and for switching and dimming.
It´s not that smart, as it could be - but it will be smater.

Thanks for Support.
I´ll give Feedback if it works.

Vaillan

openHAB knx binding will use default DPT for various Items, e.g. DPT1.xxx for Switch and Contact. In Question of Numbers, there are different types of Numbers, and often you have to define the DPT.
If omitting a GA, you have to define the DPT to help openHAB to sort out which GA is used for which detail of Item, e.g.

Dimmer MyDimmer {knx="1/1/1,5.001:1/1/2+<5.001:1/1/3"}

GA 1/1/1 will be used as ON/OFF,
GA 1/1/2 will be used to set percent state to knx and
GA 1/1/3 will be used to get percent state from knx.
INCREASE/DECREASE (usually the second GA) will not be used with knx at all.

It works great thank you.

Important to say - OH Scenes beginn with the Scene Number 0 (0-63).
So if you have a knx device (which i have) that starts with the Scene Number 1 (1-64) you have to set the Scene Number in OH to 0 (always one less).

Best regards
Vaillan

1 Like