I ordered the LinknLink eMotion Human Radar sensor and and it can be query
using the ModBus TCP protocal. I set it up to work with OpenHAb as follows:
-
Install the Modbus Binding from the Add-on Store
-
create modbus.things or add to existing things file after editing host IP address :
```csv
Bridge modbus:tcp:remotehost [ host="192.168.x.xxx", port=502, id=1 ]
{
Bridge poller holding [ start=802, length=1, refresh=5000, type="holding", maxTries=5]
{
Thing data hold802 [ readStart="802", readValueType="int16" ]
}
}
3) Create modbus.item or add to existing item file:
```csv
Number eMotion "eMotion3 [%d]" { channel="modbus:tcp:remotehost:holding:hold802:number" }
- Sample rule:
rule "eMotion3 changed Rule"
when
Item eMotion changed
then
logInfo("INFO","sensor-> eMotion {}", eMotion.state)
if (eMotion.state == 1)
{
Upstairs_Light.sendCommand(ON) // Turn on light
}
else
if (eMotion.state == 0)
{
Upstairs_Light.sendCommand(OFF) // Turn off light
}
end