Update of item via central knx group address

Hi All,

I have a switch item that is used to lock my knx lightswitches on a floor. It is also possible to lock a single light switch with a knx gorup address. However, I don’t figure out how to update the status of the group addresses of the switchs.

Here are my item file. I have two switches in the office and in the sauna and the last one to lock all switches on this floor.

Switch Schalter_KG_Office (KG_Office, gMyOpenHAB) {knx="1.001:8/3/12"} 
Switch Schalter_KG_Sauna (KG_Sauna, gMyOpenHAB) {knx="1.001:8/3/13"}

Switch Schalter_KG_All (gKG, gMyOpenHAB) {knx="1.001:0/4/2"}

In the sitemap I use the two button to lock and unlock. This works in reallfe, but the switch in the sitemap for the office and sauna is not updated.

			Switch item=Schalter_KG_All label="Switches KG"  mappings=[ON="lock"]
			Switch item=Schalter_KG_All label="Switches KG"  mappings=[OFF="unlock"]

If I trigger a manual read of the two items the change is updated. I don’t want to use a rule or any workaround to do this.

Any advice how to this?

Thx in advance.

BR Marcel

That’s strange… The Item State of the individual Switches is updated in openHAB2 event bus but the sitemap does not display the new state of the individual items?
Or… what do you mean by “trigger a manual read” ?

What openHAB2 build are you using? (2.0, 2.1, 2.2S?)

You could try to use a Group (without a KNX GA assignment) and make the 2 switches members of that Group:

Group:Switch:OR(ON, OFF)	gSchalter_KG_All "Switches KG [(%d)]"		<light>		(gKG, gMyOpenHAB)

Switch Schalter_KG_Office (KG_Office, gSchalter_KG_All, gMyOpenHAB) {knx="1.001:8/3/12"} 
Switch Schalter_KG_Sauna (KG_Sauna, gSchalter_KG_All, gMyOpenHAB) {knx="1.001:8/3/13"}

Then, in your sitemap:

			Switch item=gSchalter_KG_All mappings=[ON="lock"]
			Switch item=gSchalter_KG_All mappings=[OFF="unlock"]

What do you mean by “locking” the switches?

And what do you mean with a manual read? openHAB is not capable to do manual read requests (and if configured correctly, there is no need to do this either).

If I got it right, you have additional GA in your actuators which superpose the normally used. So you have to define Group Addresses bound to the state objects of the actuators. Typically, an actuator channel has at minimum two objects:

  • Switch (e.g. 0/0/1): A command to this object will switch ON/OFF the channel
  • Switch State (e.g. 0/0/2): The actuator will send it’s state through this object every time its switched; in addition the actuator will answer a read request at this object.

Your item then should look like this (using the example GAs):

Switch MySwitch "My Switch is [%s]" {knx="0/0/1+<0/0/2"}

openHAB will send a read request to 0/0/2 at startup (because of the <) and will set the item’s state according to each received command, regardless if received from 0/0/1 or 0/0/2. When doing a sendCommand (through rules or by switching in UI), openHAB will send this command only to GA 0/0/1. As Switch is by default DPT 1.001, there is no need to define it explicitly.

For the lock Switch, one item would suffice either :slight_smile: :

Switch item=Schalter_KG_All label="Switches KG"  mappings=[ON="lock",OFF="unlock"]

Hi Udo,

thanks for your reply. Let me try to explain in detail what I want to do. My little daughter is now in an age she starts to push on all the buttons on the wall (light switch, roller shutter, etc.). Of course she doesn’t listen to mom and dad, therefore I configured these knx sensors (switches/buttons at the wall) so that they can be deactivated. Each knx sensor can be deactivated so that my daughter can push the button but nothing will happen. :slight_smile:

However, I don’t want to deactivate every single switch on a floor therefore I have a GA for every floor, e.g. I’m with her in the groudfloor I can deactivate every knx switch with a single central switch item via openhab on my mobile. However, I want that this will be reflected in the visualisation and for instance my wife can activate the switch in the kitchen and the rest of the floor is deactivated. Unfortunately, the switch has no communication object that indicates if the switch is locked or not like in the actuator. I added the Read flag so that I can read the status over the knx bus. I’m still running another piece of software in parallel from the manufacturer of my knx sensors and switches that is also offering a visualisation in this software I can trigger a manual read.

I hope you understand my problem now. Of course I can create a rule if the central GA will be changed resp. updated I will send commands to all GA of the floor, but this will be additional traffic on the knx - that I thought I can prevent.

Any other idea?

Thanks in advance.

BR Marcel

Ah, that makes sense :slightly_smiling_face:

If the locking GA is set to the Lock item, openHAB should receive all commands to that group address anyway.

What’s your openHAB version? Maybe you have to set the lock item like this:

Switch Schalter_KG_All (gKG, gMyOpenHAB) {knx="0/4/2",autoupdate="true"}

I use openHAB 2.1 stable release. I have tried the autoupdate, but it doesn’t work. I have checked the binding documentation and I could use

Switch Schalter_KG_Office (KG_Office, gSchalter_KG_All, gMyOpenHAB) {knx="1.001:<(1)8/3/12"} 

in order to update the visualisation, but then every second openHAB reads the GA from KNX. I think this is not a pretty good solution. Maybe I have to go for a rule.

BR Marcel

No, if you want the state of the knx actuator, you have to use an additional group address (as I wrote in my first posting). This additional address has to be set in the actuator to the state object of the channel. This object has to have the R flag set (R for readable). In Germany the flag is the L flag (Lesbar)

You have to setup your knx system properly.

Hi Udo,

it’s not an actuator and therefore I don’t have another communication object in the ETS available like in an switch actuator.
I have already set the read flag for this object so that the autorefresh after every second works. I will try the group switch next. Thanks so far for your help.

BR Marcel

Hi Dim Angelos,

this works as I would have expected. Thanks for your help. I also use it to lock my rollershutters. However, having a button for a rollershutters the Basic UI is updated immediately that 11 Rollershutters are locked. With the switches I have to refresh the site.

My items for locking the rollershutters.

// Kindersicherung Jalousie
Group:Switch:OR(ON, OFF) gJalousienSperren_Alle (gMyOpenHAB)
Switch Sperren_KG_Office (KG_Office, gJalousienSperren_Alle, gMyOpenHAB) { knx="<(300)1.001:2/7/1" }
Switch Sperren_EG_Gast (EG_Gast, gJalousienSperren_Alle, gMyOpenHAB) { knx="<(300)1.001:2/7/3" }
Switch Sperren_EG_Essen (EG_Essen, gJalousienSperren_Alle, gMyOpenHAB) { knx="<(300)1.001:2/7/4" }
Switch Sperren_EG_Wohnen_Loggia <door> (EG_Wohnen, gJalousienSperren_Alle, gMyOpenHAB) { knx="<(300)1.001:2/7/5" }
Switch Sperren_EG_Wohnen_Mitte (EG_Wohnen, gJalousienSperren_Alle, gMyOpenHAB) { knx="<(300)1.001:2/7/6" }
Switch Sperren_EG_Wohnen_Aussen (EG_Wohnen, gJalousienSperren_Alle, gMyOpenHAB) { knx="<(300)1.001:2/7/7" }
Switch Sperren_EG_Kueche (EG_Kueche, gJalousienSperren_Alle, gMyOpenHAB) { knx="<(300)1.001:2/7/8" }
Switch Sperren_OG_Schlafen (OG_Schlafen, gJalousienSperren_Alle, gMyOpenHAB) { knx="<(300)1.001:2/7/11" }
Switch Sperren_OG_Kind_Mitte (OG_Kind_Mitte, gJalousienSperren_Alle, gMyOpenHAB) { knx="<(300)1.001:2/7/12" }
Switch Sperren_OG_Kind (OG_Kind, gJalousienSperren_Alle, gMyOpenHAB) { knx="<(300)1.001:2/7/13" }
Switch Sperren_OG_Loggia (OG_Loggia, gJalousienSperren_Alle, gMyOpenHAB) { knx="<(300)1.001:2/7/14" }

My items for locking the switches.

Group:Switch:OR(ON, OFF) gSchalter_KG (gKG, gMyOpenHAB)
Group:Switch:OR(ON, OFF) gSchalter_EG (gEG, gMyOpenHAB)
Group:Switch:OR(ON, OFF) gSchalter_OG (gOG, gMyOpenHAB)

// Schalter sperren
Switch Schalter_EG_Wohnen_kleine_Terrasse (EG_Wohnen, gSchalter_EG, gMyOpenHAB) {knx="<(300)1.001:8/3/1"} 
Switch Schalter_EG_Wohnen_Terrasse (EG_Wohnen, gSchalter_EG, gMyOpenHAB) {knx="<(300)1.001:8/3/2"}
Switch Schalter_EG_Essen (EG_Essen, gSchalter_EG, gMyOpenHAB) {knx="<(300)1.001:8/3/3"}
Switch Schalter_EG_Kueche (EG_Kueche, gSchalter_EG, gMyOpenHAB) {knx="<(300)1.001:8/3/4"}
Switch Schalter_EG_Flur_bei_Garage (EG_Flur, gSchalter_EG, gMyOpenHAB) {knx="<(300)1.001:8/3/5"}
Switch Schalter_EG_Flur_bei_Treppe (EG_Flur, gSchalter_EG, gMyOpenHAB) {knx="<(300)1.001:8/3/6"}
Switch Schalter_EG_Bad (EG_Bad, gSchalter_EG, gMyOpenHAB) {knx="<(300)1.001:8/3/7"}
Switch Schalter_EG_Gast_Raumcontroller (EG_Gast, gSchalter_EG, gMyOpenHAB) {knx="<(300)1.001:8/3/8"}
Switch Schalter_EG_Gast_Terrasse (EG_Gast, gSchalter_EG, gMyOpenHAB) {knx="<(300)1.001:8/3/9"}
Switch Schalter_EG_Gast_links (EG_Gast, gSchalter_EG, gMyOpenHAB) {knx="<(300)1.001:8/3/10"}
Switch Schalter_EG_Gast_rechts (EG_Gast, gSchalter_EG, gMyOpenHAB) {knx="<(300)1.001:8/3/11"}
Switch Schalter_KG_Office (KG_Office, gMyOpenHAB, gSchalter_KG) {knx="<(300)1.001:8/3/12"} 
Switch Schalter_KG_Sauna (KG_Sauna, gMyOpenHAB, gSchalter_KG) {knx="<(300)1.001:8/3/13"}
Switch Schalter_OG_Ankleide (OG_Ankleide, gSchalter_OG, gMyOpenHAB) {knx="<(300)1.001:8/3/14"}
Switch Schalter_OG_Bad (OG_Bad, gSchalter_OG, gMyOpenHAB) {knx="<(300)1.001:8/3/15"}
Switch Schalter_OG_Flur_bei_Bad (OG_Flur, gSchalter_OG, gMyOpenHAB) {knx="<(300)1.001:8/3/16"}
Switch Schalter_OG_Flur_bei_Loggia (OG_Flur, gSchalter_OG, gMyOpenHAB) {knx="<(300)1.001:8/3/17"}
Switch Schalter_OG_Kind_Aussen (OG_Kind, gSchalter_OG, gMyOpenHAB) {knx="<(300)1.001:8/3/18"}
Switch Schalter_OG_Kind_Mitte (OG_Kind_Mitte, gSchalter_OG, gMyOpenHAB) {knx="<(300)1.001:8/3/19"}
Switch Schalter_OG_Schlafen_bei_Ankleide (OG_Schlafen, gSchalter_OG, gMyOpenHAB) {knx="<(300)1.001:8/3/20"}
Switch Schalter_OG_Schlafen_Bett_rechts (OG_Schlafen, gSchalter_OG, gMyOpenHAB) {knx="<(300)1.001:8/3/21"}
Switch Schalter_OG_Schlafen_Bett_links (OG_Schlafen, gSchalter_OG, gMyOpenHAB) {knx="<(300)1.001:8/3/22"}
Switch Schalter_OG_Schlafen_Raumcontroller (OG_Schlafen, gSchalter_OG, gMyOpenHAB) {knx="<(300)1.001:8/3/23"}

Do you have any idea why there is a different behaviour of the Basic UI?

Thanks in advance.