HomeBridge Plugin for ModbusTCP
npm install homebridge-modbusname, a type (that matches any HomeKit Service type), and one or more characteristics (that match HomeKit Characteristics for this Service).
subtype field if services are of the same type.
address as the coil/register type and number, and optional elements like validValues, maxValue, value to configure HomeKit, mask and/or map to map different values between modbus and homekit, readOnly to force holding registers or coils to not be written on modbus (input registers are always read-only).
json
{
"platforms": [
{
"platform": "Modbus",
"ip": "192.168.1.201",
"port": 502,
"pollFrequency": 1000,
"accessories": [
{
"name": "Bedroom ventilation",
"type": "Fan",
"On": "r1"
},
{
"name": "Bedroom light",
"type": "Switch",
"On": "c1"
},
{
"name": "Bedroom",
"type": "Thermostat",
"TargetTemperature": "r2",
"CurrentTemperature": "i1",
"CurrentHeatingCoolingState": {
"address": "r3",
"readonly": true,
"mask": "2",
"map": {"0": 0, "2": 1},
"validValues": [0, 1]
},
"TargetHeatingCoolingState": {"value": 1, "validValues": [1]}
},
{
"name": "Water Heater",
"type": "TemperatureSensor",
"subtype": "from boiler",
"CurrentTemperature": "i2"
},
{
"name": "Water Heater",
"type": "TemperatureSensor",
"subtype": "to boiler",
"CurrentTemperature": "i3"
}
]
}
]
}
``