Hello,
I’m Randi and I’m new to OpenHAB. I need help with my project.
I’m trying to make a Home Automation Full Simulation using some program as I mentioned above. I’m using modbus binding from @ssalonen in Modbus openHAB2 binding available for alpha testing. PLC that I will be using is modicon M221.
Here is my TwidoSuite Program Report :
doc2.pdf (1019.3 KB)
Here for the openHAB stuff :
modtest.things
Bridge modbus:tcp:localhostTCP [ host="192.168.0.105", port=502, id=1 ]{
Bridge poller coils [ start=0, length=2, refresh=1000, type="coil" ]
{
Thing data internalrelay [ readStart="0", readValueType="uint16" ]
Thing data light1on [ readStart="1", readValueType="bit" ]
}
Bridge poller coils [start=2, length=1, refresh=1000, type="coil" ]
{
Thing data terminalroom1on [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
}
Bridge poller coils [start=3, length=2, refresh=1000, type="coil" ]
{
Thing data bathroom1on [ readStart="3", readValueType="bit" ]
Thing data light2on [ readStart="4", readValueType="bit" ]
}
Bridge poller coils [start=5, length=1, refresh=1000, type="coil" ]
{
Thing data terminalroom2on [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
}
Bridge poller coils [start=6, length=2, refresh=1000, type="coil" ]
{
Thing data bathroom2on [ readStart="6", readValueType="bit" ]
Thing data light3on [ readStart="7", readValueType="bit" ]
}
Bridge poller coils [start=8, length=1, refresh=1000, type="coil" ]
{
Thing data terminalroom3on [ readStart="8", readValueType="bit", writeStart="8", writeValueType="bit", writeType="coil" ]
}
Bridge poller coils [start=9, length=1, refresh=1000, type="coil" ]
{
Thing data bathroom3on [ readStart="9", readValueType="bit" ]
}
Bridge poller holding [ start=0000, length=1, refresh=1000, type="holding" ]
{
Thing data uilight1 [ readStart="0000", readValueType="uint16", writeStart="0000", writeValueType="uint16", writeType="holding" ]
}
Bridge poller holding [ start=0002, length=1, refresh=1000, type="holding" ]
{
Thing data uibathroom1 [ readStart="0002", readValueType="uint16", writeStart="0002", writeValueType="uint16", writeType="holding" ]
}
Bridge poller holding [ start=0004, length=1, refresh=1000, type="holding" ]
{
Thing data uilight2 [ readStart="0004", readValueType="uint16", writeStart="0004", writeValueType="uint16", writeType="holding" ]
}
Bridge poller holding [ start=0006, length=1, refresh=1000, type="holding" ]
{
Thing data uibathroom2 [ readStart="0006", readValueType="uint16", writeStart="0006", writeValueType="uint16", writeType="holding" ]
}
Bridge poller holding [ start=0008, length=1, refresh=1000, type="holding" ]
{
Thing data uilight3 [ readStart="0008", readValueType="uint16", writeStart="0008", writeValueType="uint16", writeType="holding" ]
}
Bridge poller holding [ start=0010, length=1, refresh=1000, type="holding" ]
{
Thing data uibathroom3 [ readStart="0010", readValueType="uint16", writeStart="0010", writeValueType="uint16", writeType="holding" ]
}
Bridge poller holding [ start=0000, length=1, refresh=1000, type="holding" ]
{
Thing data uilight1lo [ readStart="0000.0", readValueType="uint8" ]
Thing data uilight1hi [ readStart="0000.1", readValueType="uint8" ]
}
Bridge poller holding [ start=0002, length=1, refresh=1000, type="holding" ]
{
Thing data uibathroom1lo [ readStart="0002.0", readValueType="uint8" ]
Thing data uibathroom1hi [ readStart="0002.1", readValueType="uint8" ]
}
Bridge poller holding [ start=0004, length=1, refresh=1000, type="holding" ]
{
Thing data uilight2lo [ readStart="0004.0", readValueType="uint8" ]
Thing data uilight2hi [ readStart="0004.1", readValueType="uint8" ]
}
Bridge poller holding [ start=0006, length=1, refresh=1000, type="holding" ]
{
Thing data uibathroom2lo [ readStart="0006.0", readValueType="uint8" ]
Thing data uibathroom2hi [ readStart="0006.1", readValueType="uint8" ]
}
Bridge poller holding [ start=0008, length=1, refresh=1000, type="holding" ]
{
Thing data uilight3lo [ readStart="0008.0", readValueType="uint8" ]
Thing data uilight3hi [ readStart="0008.1", readValueType="uint8" ]
}
Bridge poller holding [ start=0010, length=1, refresh=1000, type="holding" ]
{
Thing data uibathroom3lo [ readStart="0010.0", readValueType="uint8" ]
Thing data uibathroom3hi [ readStart="0010.1", readValueType="uint8" ]
}
}
modtest.items
Group Room1
Group Room2
Group Room3
Switch internalrelay "Internal Relay [%d]" <energy> { channel="modbus:data:localhostTCP:coils:internalrelay:switch" }
Switch terminalroom1on "Terminal Room 1 [%d]" (Room1) { channel="modbus:data:localhostTCP:coils:terminalroom1on:switch" }
Switch terminalroom2on "Terminal Room 2 [%d]" (Room2) { channel="modbus:data:localhostTCP:coils:terminalroom2on:switch" }
Switch terminalroom3on "Terminal Room 3 [%d]" (Room3) { channel="modbus:data:localhostTCP:coils:terminalroom3on:switch" }
Switch uilight1 "Light Room 1 [%d]" <light> (Room1) { channel="modbus:data:localhostTCP:holding:uilight1:switch" }
Switch uibathroom1 "Light Bathroom 1 [%d]" <bath> (Room1) { channel="modbus:data:localhostTCP:holding:uibathroom1:switch" }
Switch uilight2 "Light Room 2 [%d]" <light> (Room2) { channel="modbus:data:localhostTCP:holding:uilight2:switch" }
Switch uibathroom2 "Light Bathroom 2[%d]" <bath> (Room2) { channel="modbus:data:localhostTCP:holding:uibathroom2:switch" }
Switch uilight3 "Light Room 3 [%d]" <light> (Room3) { channel="modbus:data:localhostTCP:holding:uilight3:switch" }
Switch uibathroom3 "Light Bathroom 3 [%d]" <bath> (Room3) { channel="modbus:data:localhostTCP:holding:uibathroom3:switch" }
modtest.sitemap
sitemap modtest label="modtest"
{
Frame {
Switch item=internalrelay
Group item=Room1 label="Room 1" icon="bedroom"
Group item=Room2 label="Room 2" icon="bedroom"
Group item=Room3 label="Room 3" icon="bedroom"
}
}
Here for TeslaScada UI (sorry I can’t attach my TeslaScada files bcs it’s not supported
) :
In this project, OpenHAB will act as Interface for the Cloud Control and TeslaScada as the Manual Switch Interface to replace the house miniature.
There is some question I want ask :
- About my addressing for coils and holding register in the things coding, is there any mistake ?
- Can anybody give me some clue about configuration in the modbus.cfg ? I don’t really get about that

- Is there another bindings I should use for this project ?
Sorry for my bad english and grammar. I hope you can understand what I mean ![]()
Thank you so much

