[SOLVED] Room(lights, dimmer, rollershutters) Automation using OpenHAB2

Hello everyone,

I am building a room automation having roller shutters, lights and dimmers. I was able to successfully configure the lights. Now I have a few doubts regarding the dimmers and roller shutters.

  1. I have only two values on the bus while dimming. When I press the dimmer switch once it gives me 09 and when I press it again it gives me 08 (Basically it changes from 09 to 08 when dimming). How do I map it in the items file?
  2. My roller shutter switches have a different local source address. Do I have to create separate things file for it? My current things file is below:
Bridge knx:ip:bridge [
    ipAddress="127.0.0.1",
    portNumber=3671,
    localIp="192.168.1.22", 
    type="TUNNEL",
    ignorelocalevents=true,
    readingPause=50, 
    responseTimeout=10, 
    readRetriesLimit=3, 
    autoReconnectPeriod=1,
    localSourceAddr="1.1.9"
   ] {
      Thing knx:device:bridge:generic {
       Type switch-control        : controlSwitch1        "Control Switch Left1"        [ ga="<0/0/51" ]
       Type switch-control        : controlSwitch2        "Control Switch Left2"        [ ga="<0/0/52" ]
       Type switch-control        : controlSwitch3        "Control Switch Left3"        [ ga="<0/0/53" ]
       Type switch-control        : controlSwitch4        "Control Switch Centre"        [ ga="<0/0/54" ]
       Type switch-control        : controlSwitch5        "Control Switch Others"        [ ga="<0/0/55" ]
             }
       }


Thanks in advance!

I could solve my second problem on my own. A different local source address worked in the same things file.
I am still looking for solutions for my mappings problem.

Mark as solved please.

@hr3 I am still looking for the solution of my second problem. I need to map the values received on the bus when using the rollershutters

My problem is I just have two ga for each roller
For example: 0/0/47 00 Starts opening the blinds
0/0/42 00 Stops
0/0/47 01 Closes the blinds
Can someone help me?
I have tried this but doesn’t work
Things file:

Type rollershutter     : shutterSwitch1               "Rolladen 1"       [ knx="0/0/47+<0/0/42, <0/0/42, <0/0/47"]
Type rollershutter     : shutterSwitch2               "Rolladen 2"       [ knx="0/0/49+<0/0/44, <0/0/44, <0/0/49" ]
Type rollershutter     : shutterSwitch3               "Rolladen 3"       [ knx="0/0/46+<0/0/39, <0/0/39, <0/0/46" ] 

@Dim I would appreciate your help.
Thanks in advance!

You mean PA (physical address) ?

Which Rollershutter actuator are you using?

I believe that this is a wrong syntax for KNX2

This is a working example of a Rollershutter :

Thing device GW90857_11 "Shutter Actuator 11" @ "KNX" [ address="1.1.11", fetch=false, pingInterval=600, readInterval=0 ]
{
	Type	rollershutter :	Ch_111		"Channel 11.1"		[ upDown="2/1/8", stopMove="2/1/9", position="2/3/18+<2/2/18" ]
	Type	rollershutter :	Ch_112		"Channel 11.2"		[ upDown="2/0/0", stopMove="2/0/1", position="2/3/0+<2/2/0" ]
	Type	rollershutter :	Ch_113		"Channel 11.3"		[ upDown="2/0/2", stopMove="2/0/3", position="2/3/2+<2/2/2" ]
	Type	rollershutter :	Ch_114		"Channel 11.4"		[ upDown="2/0/4", stopMove="2/0/5", position="2/3/4+<2/2/4" ]
}

Yes… I did figure it out on my own.

I’ll try the example you told and will update you soon.

Thank you for your help :slight_smile:

1 Like

I was making some changes to make the rollershutters work but something went wrong and even the lights aren’t working now.

Items File

Switch demoSwitch1 "Left_Lights1" <Lights> {channel="knx:device:bridge:generic:controlSwitch1" }
Switch demoSwitch2 "Left_Lights2" <Lights> {channel="knx:device:bridge:generic:controlSwitch2" }
Switch demoSwitch3 "Left_Lights3" <Lights> {channel="knx:device:bridge:generic:controlSwitch3" }
Switch demoSwitch4 "Center_Lights" <Lights> {channel="knx:device:bridge:generic:controlSwitch4" }
Switch demoSwitch5 "Other_Lights" <Lights> {channel="knx:device:bridge:generic:controlSwitch5" }

import org.eclipse.smarthome.core.items
import org.eclipse.smarthome.core.things
import org.eclipse.smarthome.core.persistence
import org.eclipse.smarthome.core.library.types
import org.eclipse.smarthome.core.library.items
import org.eclipse.smarthome.model.script.actions

rule "Switch_ON_LeftLights1"
when
     Item demoSwitch1 changed from OFF to ON
then
     demoSwitch1.sendCommand(ON)
end

rule "Switch_ON_LeftLights2"
when
     Item demoSwitch2 changed from OFF to ON
then
    demoSwitch2.sendCommand(ON)
end

rule "Switch_ON_LeftLights3"
when
     Item demoSwitch3 changed from OFF to ON
then
     demoSwitch3.sendCommand(ON)
end

rule "Switch_ON_CentreLights"
when
     Item demoSwitch4 changed from OFF to ON
then
     demoSwitch4.sendCommand(ON)
end

rule "Switch_ON_OtherLights"
when
     Item demoSwitch5 changed from OFF to ON
then
    demoSwitch5.sendCommand(ON)
end

rule "Switch_OFF_LeftLights1"
when
     Item demoSwitch1 changed from ON to OFF
then
     demoSwitch1.sendCommand(OFF)
end

rule "Switch_OFF_LeftLights2"
when
     Item demoSwitch2 changed from ON to OFF
then
     demoSwitch2.sendCommand(OFF)
end

rule "Switch_OFF_LeftLights3"
when 
     Item demoSwitch3 changed from ON to OFF
then 
     demoSwitch3.sendCommand(OFF)
end

rule "Switch_OFF_CentreLights"
when
     Item demoSwitch4 changed from ON to OFF
then
     demoSwitch4.sendCommand(OFF)
end

rule "Switch_OFF_OtherLights"
when
     Item demoSwitch5 changed from ON to OFF
then
     demoSwitch5.sendCommand(OFF)
end

rule "Switch_On_AllLights"
when
    Item demoSwitch6 changed from OFF to ON
then 
    demoSwitch1.sendCommand(ON)
    demoSwitch2.sendCommand(ON)
    demoSwitch3.sendCommand(ON)
    demoSwitch4.sendCommand(ON)
    demoSwitch5.sendCommand(ON)
end

rule "Switch_Off_AllLights"
when
    Item demoSwitch6 changed from ON to OFF
then
    demoSwitch1.sendCommand(OFF)
    demoSwitch2.sendCommand(OFF)
    demoSwitch3.sendCommand(OFF)
    demoSwitch4.sendCommand(OFF)
    demoSwitch5.sendCommand(OFF)
end 

sitemap default label="F1.406"
{
 Frame label="Lights" {
    Switch item=demoSwitch1 label="Left Lights 1" icon=light  
    Switch item=demoSwitch2 label="Left Lights 2" icon=light 
    Switch item=demoSwitch3 label="Left Lights 3" icon=light 
    Switch item=demoSwitch4 label="Other Lights" icon=light 
    Switch item=demoSwitch5 label="Centre Lights" icon=light 
    Switch item=demoSwitch6 label="All lights" icon=light 
   }
}

Things File:

Bridge knx:ip:bridge [
    ipAddress="127.0.0.1",
    portNumber=3671,
    localIp="192.168.1.22",
    type="TUNNEL",
    ignorelocalevents=true,
    readingPause=50, 
    responseTimeout=10, 
    readRetriesLimit=3, 
    autoReconnectPeriod=1,
    localSourceAddr="1.1.9"
   ] {
      Thing knx:device:bridge:generic {
       Type switch-control        : controlSwitch1        "Control Switch Left1"        [ ga="<0/0/51" ]
       Type switch-control        : controlSwitch2        "Control Switch Left2"        [ ga="<0/0/52" ]
       Type switch-control        : controlSwitch3        "Control Switch Left3"        [ ga="<0/0/53" ]
       Type switch-control        : controlSwitch4        "Control Switch Others"        [ ga="<0/0/54" ]
       Type switch-control        : controlSwitch5        "Control Switch Centre"        [ ga="<0/0/55" ]
 }
}

Logs:

2018-08-30 12:38:14.327 [vent.ItemStateChangedEvent] - demoSwitch4 changed from ON to OFF
2018-08-30 12:38:14.329 [ome.event.ItemCommandEvent] - Item 'demoSwitch4' received command OFF
2018-08-30 12:38:15.432 [ome.event.ItemCommandEvent] - Item 'demoSwitch6' received command ON
2018-08-30 12:38:15.452 [vent.ItemStateChangedEvent] - demoSwitch6 changed from OFF to ON
2018-08-30 12:38:15.455 [ome.event.ItemCommandEvent] - Item 'demoSwitch1' received command ON
2018-08-30 12:38:15.462 [ome.event.ItemCommandEvent] - Item 'demoSwitch2' received command ON
2018-08-30 12:38:15.469 [ome.event.ItemCommandEvent] - Item 'demoSwitch3' received command ON
2018-08-30 12:38:15.475 [ome.event.ItemCommandEvent] - Item 'demoSwitch4' received command ON
2018-08-30 12:38:15.478 [ome.event.ItemCommandEvent] - Item 'demoSwitch5' received command ON
2018-08-30 12:38:15.503 [ome.event.ItemCommandEvent] - Item 'demoSwitch1' received command ON
2018-08-30 12:38:15.508 [vent.ItemStateChangedEvent] - demoSwitch1 changed from OFF to ON
2018-08-30 12:38:15.510 [vent.ItemStateChangedEvent] - demoSwitch2 changed from OFF to ON
2018-08-30 12:38:15.512 [vent.ItemStateChangedEvent] - demoSwitch3 changed from OFF to ON
2018-08-30 12:38:15.515 [ome.event.ItemCommandEvent] - Item 'demoSwitch3' received command ON
2018-08-30 12:38:15.517 [ome.event.ItemCommandEvent] - Item 'demoSwitch2' received command ON
2018-08-30 12:38:15.522 [ome.event.ItemCommandEvent] - Item 'demoSwitch4' received command ON
2018-08-30 12:38:15.526 [vent.ItemStateChangedEvent] - demoSwitch4 changed from OFF to ON
2018-08-30 12:38:15.529 [vent.ItemStateChangedEvent] - demoSwitch5 changed from OFF to ON
2018-08-30 12:38:15.531 [ome.event.ItemCommandEvent] - Item 'demoSwitch5' received command ON


Could someone please help me on this?
@Dim Could you please look into this.
Thanks in advance! :slight_smile:

<Lights> is your group? If yes, it should be in parenthesis: (Lights)
If you want the icon, use: <light>

why would you do this?
You don’t need that. You are sending another ON command after the switch has been already changed to ON.

looks ok
I have more data in my example:

Thing device GW90741_1 "Switch Actuator 1" @ "KNX" [ address="1.1.1", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	switch	:	Ch_11		"Channel 1.1"		[ ga="1/0/8+<1/2/8" ]
			Type	switch	:	Ch_12		"Channel 1.2"		[ ga="1/0/9+<1/2/9" ]
			Type	switch	:	Ch_13		"Channel 1.3"		[ ga="1/0/10+<1/2/12" ]
			Type	switch	:	Ch_14		"Channel 1.4"		[ ga="1/0/11+<1/2/11" ]
		}

What if I don’t know which actuator is being used?
A bus was available which was receiving and sending signals when buttons were pressed.
First, I installed KNXD to read the bus (I have used TP UART to connect the bus to the Raspberry Pi). Then I used openHAB for automation (using KNX binding).
When I was able to switch lights on/off using OpenHAB basic UI, vbusmonitor command was not able to monitor the bus. Now when the openHAB is not able to send signals to the bus I am able to read the bus using vbusmonitor. Do you know why is there such a problem?
My understanding is that OpenHAB is communicating with KNXD to read/write the bus. Am I missing something here?

most possibly because you have configured knxd to allow only one tunneling connection?
Try to switch knxd to act as a router and use router type in your knx binding to see if this helps.

Thank you so much for the help.
It is working now.
All I had to do was to do the needful changes and reboot my Raspberry Pi :slight_smile:

If I change to ROUTER configuration it is throwing as exception.
Anyways, now with the same TUNNEL configuration I am able to monitor the bus using vbusmonitor as well. So no issues