KNX-Switch to switch zigbee light bulb (II)

I want to switch a zigbee light bulb with an knx switch.
It is basically the same, as discussed hier: KNX-Switch to dim of zigbee light bulb

I don’t get it working: when i switch the light per Main UI, the knx switch does not show the correct status. (on/off visualized with a led in the switch).

My configuration looks like this:

  • i’ve created a thing and an item for the zigbee device
  • i’ve created a thing and an item for the knx channel
  • there is no link between the knx item with the zigbee-thing!
  • i’ve created a rule, to switch the light on, when using the knx switch
  • i’ve createted a secound rule, wich updates the status of the knx switch per “postUpdate”. This is not working.

KNX: thing an item

 - id: knxNoahLichtDecke
    channelTypeUID: knx:switch-control
    label: KNX Noah Licht Decke
    description: ""
    configuration:
      ga: 1/2/50+1/1/50
 

zigbee: thing an item

The rule for the status update:

var itemNoahDeckenlicht = items.getItem("lichtNoahDecke").state;
var itemKnxNoahDeckenlicht = items.getItem("lichtNoahDeckeKnx");
if( itemNoahDeckenlicht == "ON") {
  itemKnxNoahDeckenlicht.postUpdate("ON");
} else {
  itemKnxNoahDeckenlicht.postUpdate("OFF");
}

There is no message sent to the knx bus (diagnose in ets).

What is wrong? I don’t see the the mistake :see_no_evil:

Which GA is for status? (should be 1/2/50)
You don’t need a rule at all, instead, use an additional link to the Item lichtNoahDecke.

That was correct.

I deactivated the rules now and created an additinal link. Now it is working! Thanks @Udo_Hartmann

I think, that i don’t need the rule, because i do not use the knx switch do dim the light?!
No idea, wy the solution with the rule isn’t working here, but it doesn’t matter now.

Well, a switch-control channel will give commands, not updates, and you’re trying to get the state of the item, but you’ll need the command.
Anyway, you don’t need the rule for this job :slight_smile:

yes, that’s right. But i woud be nice, to understand the problem :upside_down_face:

It is the other way around: the item changes to “ON” or “OFF” and i want to get the status led of the kxn switch on or off.

I’m tiggering a status change:
image
If/else is working correctly, but no change on the knx switch an no messages in knx monitor.

I don’t think so :wink: but maybe my explanation was unclear.

knx switch channel: a received data telegram will result in a status update of the linked Switch Item. A command sent to the linked Item will result in a data telegram from openHAB to knx with the first GA set in the parameter ga.
knx switch-control channel: a received data telegram will result in a command to the linked Switch Item. A status update of the Item will result in a data telegram from openHAB to knx with the first GA set in the parameter ga.
So a rule with trigger Item xyz changed will never get executed by a received data telegram for switch-control channels.
If this Channel is linked to the Switch Item lichtNoahDeckeKnx

- id: knxNoahLichtDecke
    channelTypeUID: knx:switch-control
    label: KNX Noah Licht Decke
    description: ""
    configuration:
      ga: 1/2/50+1/1/50

a received telegram on either 1/2/50 or 1/1/50 will result in a command to Item lichtNoahDeckeKnx ON or OFF, depending on the received telegram.
On the other hand, if the Item lichtNoahDeckeKnx gets an update ON or OFF, this will result in a data telegram GA 1/2/50 1 or 0 to knx.
And the rule is obsolete (as well as the extra Item), because a received command will be forwarded to all other linked channels at the same Item, as well as the status update of the Item will result in a message sent to knx.

At least this should work (and it certainly does for me).

Thanks for your detailed explanation!

Everything is good at the moment. I’m thinking, because this becomes relevant, when i want to use the knx switch as dimmer, too.