Safety: this is a production security system. Get written permission from the site owner and your Gallagher integrator. Never test destructive calls on a live site. Doors and alarms must still work with the integration disabled.
Step 1: prepare Command Centre
Gallagher's docs say to search the Configuration Client's online help for "REST" to set up the server. The Home Assistant integration's README describes this flow (menu names may differ by version):
- Server Properties > Web Services: enable the REST API and note the server base port.
- Create a cardholder named something obvious such as "Home Assistant REST", and give it access to only the groups you need. The README recommends a dedicated access group.
- Create an operator group, add that cardholder as an operator, and give it the minimum operator privileges.
- Under Services and Workstations add a REST Client, note its API key, set the cardholder as the REST client operator, and on the IP Filtering tab enable filtering and enter the Home Assistant server's IP.
Step 2: look at the API with curl
The reference says the API is self-describing, so you start at /api and follow the href links rather than hard-coding URLs. The doc examples use port 8904 on localhost; use the base port from your server properties. Do not use curl -k. Instead, give curl the server's CA file.
Code: Select all
export CC_KEY='paste-your-key-here'
curl --cacert cc-server-ca.pem \
-H "Authorization: GGL-API-KEY $CC_KEY" \
-H "Accept: application/json" \
https://cc-server.example.lan:8904/apiStep 3: connect Home Assistant
Install the integration with HACS as a custom repository, restart, then add "Gallagher Command Centre". Enter the base URL in the form https://[command centre ip]:[rest port]/ and the API key, and select the options you want. The README notes that it imports all items of each selected type (no way to filter them), and only the first 1,000 of each type.
Step 4: choose read-only first
Per the README, doors appear as cover entities, alarm zones as alarm control panels, access zones as locks, fence zones as numeric sensors, inputs as binary sensors, and outputs as switches. Start with inputs, doors and fence voltage as monitoring. Keep the operator privileges low enough that Home Assistant cannot do things you have not approved, even if someone clicks the wrong button.
Step 5: protect the key
- Store the key in a password manager, not in a shared note.
- Keep IP filtering on, and give Home Assistant a static IP, as the README suggests.
- Rotate the key when anyone who knew it leaves.
- Do not automate door opening from presence sensors or voice assistants.
The README says that if Command Centre is rebooted or offline for a long time, the integration may not re-establish its subscription. Build a simple check that tells you when door or input states have not changed for an unusual time, and know how to reload the integration.
Discussion: which Command Centre version are you on, and do you use client certificates? What licences did the site need before the integration worked?