KNX Button send command to OH3

Is it possible that my KNX switch (Zennio Flat 55 x4) send a command to OH3?

By example:

Between 8am and 6pm I like to light up 3 light groups (DALI) in my hallway. Between 6pm and 8am, I only want 1 group to light up.
In KNX this isn’t possible without buying a additional logic module. Therefor I’m wondering if it is possible to send a command (on/off) to OH3. If the command is between 8am and 6pm, OH sends an “on” to 3 groups in my DALI gateway. If it is between 6pm and 8am, the command will only be send to 1 group.

Best,
D

I would say: Yes. You can define a switch-control in the KNX binding and connect this to an item. With a rule, you can check the change of the item. Inside the rule, you have to check your time range and then send the right commands to other items, which are connected over knx binding channels to your bus.

Thanks… but how? I add my Zennio switch and the DALI gateway… but now I’m stuck.
I already can make a switch in openhab and switch the lights on/off or dimm with a dimmer… but I don’t want to do it with a “virtual” switch but with my zennio via OH so I can add some conditions to it.

You will need an additional Group Address for the switch.
like this:

Wall switch sends commands via 1/1/1 (state received via 1/1/2)
Light 1  receives commands via 1/2/1 (sends state via 1/2/2
Licht 2  receives commands via 1/3/1 (sends state via 1/3/2

this would result in three channels (OH2 notation as it’s so short…):

Type switch         : ch1 "Light 1"     [ ga="1/2/1+<1/2/2" ]
Type switch         : ch2 "Light 2"     [ ga="1/2/1+<1/2/2" ]
Type switch-control : sw1 "Wall switch" [ ga="1/1/2+1/1/1" ]

Please be aware that the state GA fro switch-command is the first GA, as openHAB will send the state to this GA.

Some Items:

Switch Light1     "Light 1 [%s]" { channel="knx:...:ch1" }
Switch Light2     "Light 2 [%s]" { knx:...:ch2 }
Switch Wallswitch "Wall switch"  { knx:...:sw1 }

Now a rule:

rule "switch lights dependent on time"
when
    Item Wallswitch received command
then
    if(receivedCommand == OFF) {
        Light1.sendCommand(OFF)
        Light2.sendCommand(OFF)
        Wallswitch.postUpdate(OFF)
    } else {
        Wallswitch.postUpdate(ON)
        Light1.sendCommand(ON)
        if(now.getHourOfDay < 7 || now.getHourOfDay > 21) {
            Light2.sendCommand(ON)
        }
    }
end

So, Light will be switched OFF regardless which time it is, but Light2 will only be switched ON if it’s between 10pm and 7am (22:00:00 to 07:00:00).

1 Like

Thanks Udo for the explanation, but I don’t get it working at the moment.

In ETS5 I made 3 group address:

  • 1 with channel A from the actuator (1/0/5)
  • 1 with channel B from the actuator (1/0/6)
  • 1 with the on/of function of the switch (1/0/4)

In OH3 i made 2 channels on the Actuator binding:

UID: knx:device:ce56c3263f:66b8094695
label: KNX Actuator
thingTypeUID: knx:device
configuration:
  pingInterval: 600
  address: 1.1.6
  readInterval: 0
  fetch: false
bridgeUID: knx:ip:ce56c3263f
channels:
  - id: Left
    channelTypeUID: knx:switch
    label: Lamp Left
    description: ""
    configuration:
      ga: 1/0/6
  - id: Right
    channelTypeUID: knx:switch
    label: Lamp Right
    description: ""
    configuration:
      ga: 1/0/5

I also made 1 channel on the switch binding:

UID: knx:device:ce56c3263f:ef888a25f4
label: KNX Flat 55 X4
thingTypeUID: knx:device
configuration:
  pingInterval: 600
  address: 1.1.7
  readInterval: 0
  fetch: false
bridgeUID: knx:ip:ce56c3263f
channels:
  - id: Zennio
    channelTypeUID: knx:switch-control
    label: Zennio
    description: ""
    configuration:
      ga: 1/0/4

And then I made a rule just to switch both lamps on (as a test):

triggers:
  - id: "1"
    configuration:
      itemName: KNXFlat55X4_Zennio
    type: core.ItemCommandTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    configuration:
      itemName: KNXActuator_LampLeft
      command: ON
    type: core.ItemCommandAction
  - inputs: {}
    id: "3"
    configuration:
      itemName: KNXActuator_LampRight
      command: ON
    type: core.ItemCommandAction

If I run the rule manually (click “run now”) both lamps switching on.
If I press the button on my switch, nothing happens.

so… somehow, I still not manged to “receive” the change of my switch.

What do I do wrong?

Thanks,
D

Do you see anything in the logs when switching?

I started the logs with log:tail in the console.
When I press a virtual button, then I see the the action in the console. When I press the switch,… nothing happens… :frowning:

No, the post is fine.
My answer was not correct. so I deleted it.
I am still on oh 2.5 and using textual rules,
I just misinterpreted your yml rule.

But since there is nothing in the logs after the physical button press, I guess the thing or the item is not correct configured.

Hope you get it fixed. Udo is the best source for KNX and openHAB.
I have zenio switches installed as well :wink:

1 Like

Hi, I still believe that yours is just a test because you just need to connect the group addresses in KNX and you don’t have to go to OH …
however I also created the channels for the thing in mainUI, some were updated and others not, and I didn’t understand the difference (they were the same).
Writing the text files instead everything works but the thing remains offline.
I’m discussing it in another post …

Hmmmm… I still have not been able to get life in OH3 due to an action on my button. :roll_eyes: :frowning:

I just installed OH2… did the same as above, and it works… so I think there is a “bug” in OH3… is there a way to mention this bug somewhere?