Skip to content

Configuration

Luca Mazzilli edited this page Oct 11, 2021 · 5 revisions

configuration file is located in module folder or can be passed to ialarm-mqtt via -c argument:

ialarm-mqtt -c /path/to/my/config

edit config.json and adjust "mqtt" and "server" settings according to your need.

servers

alarm web panel

host: alarm web panel ip

port: alarm web panel port

username: alarm web panel username

password: alarm web panel password

pages: optional custom pages for scraping default are ["/RemoteCtr.htm", "/Zone.htm", "/SystemLog.htm" ]

zones: number of zones to publish/handle. Can be a number (40 means all from 1 to 40) or an array of included zones: [1,2,3,4,5,6,15,19,22]

polling status: the milliseconds to poll for status change

polling status: the milliseconds to poll for events change

"server" : {
        "host": "192.168.1.x", 
        "port": "80",
        "username": "admin", 
        "password": "password", 
        "pages": [
            "/RemoteCtr.htm",
            "/Zone.htm",
            "/SystemLog.htm"
        ],
        "zones": 40,
        "polling" : {
            "status" : 30000,
            "events" : 10000
        }
    }

mqtt

host: mqtt server ip

port: mqtt server port

username: mqtt server username

password: mqtt server password

clientId: mqtt client id (unique: if already exists mqtt server will disconnect the first. To autogenerate a random client id remove the 'clientId' property)

    "mqtt" : {
        "host": "192.168.1.x",
        "port": "1883",
        "username": "admin",
        "password": "password", 
        "clientId": "ialarm-mqtt"
    }

topics

topics.availability: Last will topic for online/offline

topics.availability: errors

topics.alarm.state: current alarm status

topics.alarm.command: alarm set command

topics.alarm.event: last event string as recorded in the alarm log

topics.alarm.discovery: false=disable discovery (empty /config topics for all entities), true=enable discovery (send new /config topics for all entities)

topics.alarm.resetCache: with empty or any payload (reset the cache and send fresh sensor and alarm data)

topics.alarm.bypass: command to bypass/restore a zone

topics.sensors.topicType: 'state' for publishing only "state" topic, 'zone' for publishing only "zone" topics (alarm, active, lowBattery and fault), '' (or undefined) for both types

topics.sensors.state: array containing all zones data in one payload

topics.sensors.zone.alarm: single zone sensor for movement/alert detection (on or off)

topics.sensors.zone.active: single zone sensor representing the active (on) or bypass (off) state

topics.sensors.zone.lowBattery: single zone sensor for low battery detection (on)

topics.sensors.zone.fault: single zone sensor for fault detection (on)

    "topics" : {
        "availability": "ialarm/alarm/availability",
        "error" : "ialarm/alarm/error", 
        "alarm" : {
            "state" : "ialarm/alarm/state",
            "command" : "ialarm/alarm/set",
            "event" : "ialarm/alarm/event", 
            "discovery" : "ialarm/alarm/discovery", 
            "resetCache" : "ialarm/alarm/resetCache",
            "bypass": "ialarm/alarm/zone/${zoneId}/bypass"
        },
        "sensors" : {
            "topicType" : "state",
            "state": "ialarm/sensors/state", 
            "zone": {
                "alarm": "ialarm/sensors/${zoneId}/alarm", 
                "active": "ialarm/sensors/${zoneId}/active", 
                "lowBattery": "ialarm/sensors/${zoneId}/battery", 
                "fault": "ialarm/sensors/${zoneId}/fault" 
            }
        }
    }

payloads

payloads.alarmDecoder: decode alarmCommand received state (accepting multiple payloads)

payloads.alarm: published payload in "alarmState" command (accepting multiple payloads)

payloads.sensorOn: binary sensor on value

payloads.sensorOff: binary sensor off value

Example with home assistant default payloads

    "payloads": {
        "alarmAvailable" : "online", 
        "alarmNotvailable" : "offline",
        "alarmDecoder": {
            "armAway" : ["armAway", "armedAway", "armed_away", "arm_away", "AA", "AwayArm"],
            "armHome" : ["armHome", "armedHome", "armed_home", "arm_home", "SA", "HomeArm" ,"StayArm", "armStay", "armedStay", "arm_stay", "armed_stay"],
            "disarm" : ["disarm", "disarmed", "D"],
            "cancel" : ["cancel", "canceled", "C"],
            "trigger": [ "trigger",  "triggered", "T"]
        },
        "alarm":{
            "armAway" : "armed_away",
            "armHome" : "armed_home",
            "disarm" : "disarmed",
            "cancel" : "cancel",
            "triggered": "triggered"
        },
        "sensorOn" : "1", 
        "sensorOff" : "0" 
    },

Example with mqttthing (homebridge) default payloads

Note: cancel is not used by mqqtthing

    "payloads": {
        "alarmAvailable" : "online", 
        "alarmNotvailable" : "offline",
        "alarmDecoder": {
            "armAway" : ["AA", "AwayArm"],
            "armHome" : ["SA", "StayArm"],
            "disarm" : ["D"],
            "cancel" : ["cancel"],
            "trigger": ["T"]
        },
        "alarm":{
            "armAway" : "AA",
            "armHome" : "SA",
            "disarm" : "D",
            "cancel" : "cancel", 
            "triggered": "T"
        }
    },

specific zone config

Most of the sensors are normally closed but some water leak works as normally open contact, so to correcly report them to home assistant the sensor can configured as "contactType" : "NO" and "statusProperty" : "open" (normally we check "problem" which is related to the status code != 0 and in this case is 16)To report the sensor as a different kind (smoke, gas, door, moisture, etc) just change "device_class" to one of those supported by Home Assistant.

     "zones": {
        "39": {
            "contactType": "NO",
            "device_class": "moisture",
            "statusProperty": "fault"
        }
    }
Clone this wiki locally