I am building a room automation system which has just lights and rollershutters.
I started with only lights for now but I am unable to configure OpenHAB.
I am able to read and write the bus which means my KNXD is working.
But I am unable to configure openHAB.
My openhab.cfg file on /etc/openhab/configurations path is as follows:
org.eclipse.smarthome.core.persistence
org.eclipse.smarthome.core.library.types
org.eclipse.smarthome.core.library.items
org.eclipse.smarthome.model.script.actions
rule "Switch ON Left Lights 1"
when
Item Left_Lights changed [from OFF] [to ON]
then
Left_Lights.sendCommand(ON)
end
rule "Switch ON Right Lights 2"
when
Item Right_Lights changed [from OFF] [to ON]
then
Right_Lights.sendCommand(ON)
end
rule "Switch ON Centre Lights"
when
Item Centre_Lights changed [from OFF] [to ON]
then
Centre_Lights.sendCommand(ON)
end
rule "Switch ON Other Lights"
when
Item Other_Lights changed [from OFF] [to ON]
then
Other_Lights.sendCommand(ON)
end
rule "Switch OFF Left Lights 1"
when
Item Left_Lights changed [from ON] [to OFF]
then
Left_Lights.sendCommand(OFF)
end
rule "Switch OFF Left Lights 2"
when
Item Right_Lights changed [from ON] [to OFF]
then
Right_Lights.sendCommand(OFF)
end
rule "Switch OFF Centre Lights"
when
Item Centre_Lights changed [from ON] [to OFF]
then
Centre_Lights.sendCommand(OFF)
end
rule "Switch OFF Other Lights"
when
Item Other_Lights changed [from ON] [to OFF]
then
Other_Lights.sendCommand(OFF)
end
Also, I have another doubt... My etc directory has 2 sub-directories openhab and openhab2. Is it normal?
No. Most likely you have installed in parallel OH1 & OH2
Get rid of the OH1 installation and use OH2 config files (for example: openhab.cfg is used in OH1)
For OH2, you should use /etc/openhab2/...) (e.g. /etc/openhab2/services/knx.cfg)
import org.eclipse.smarthome.core.items
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
2018-07-26 09:33:19.958 [me.event.ThingUpdatedEvent] - Thing 'knx:serial:bridge' has been updated.
2018-07-26 09:33:19.961 [hingStatusInfoChangedEvent] - 'knx:serial:bridge' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): failed to open serial port /dev/knx1
This is the error I am getting.
KNXD works fine as I am able to read and write the bus using vbusmonitor1 and groupswrite