Connect GonoPBX with Home Assistant – call status as sensors, real-time MQTT events, and trigger calls directly from your HA dashboard.
The GonoPBX Home Assistant integration connects your Asterisk PBX to your smart home. You get real-time status of extensions and trunks, call statistics as sensors, and can trigger automations based on call events.
Every 30 seconds: extension status, active calls, call stats, and voicemail.
Real-time events for call start, answer, and end. Immediate status updates.
Binary sensors for extensions & trunks, plus sensors for calls and voicemail.
Start calls from HA and toggle call forwarding from automations or dashboards.
First, configure an API key and optionally MQTT in your GonoPBX installation.
Edit the .env file in the GonoPBX directory:
# API key for Home Assistant
HA_API_KEY=your-secure-api-key-here
# Optional: MQTT for real-time events
MQTT_BROKER=192.168.1.100 # IP of your Mosquitto broker
MQTT_PORT=1883
MQTT_USER=ha_user
MQTT_PASSWORD=ha_password openssl rand -hex 32 Then restart GonoPBX:
cd /root/gonopbx
docker compose up -d --build backend https://github.com/ankaios76/gonopbx-homeassistant as an Integrationgit clone https://github.com/ankaios76/gonopbx-homeassistant.git custom_components/gonopbx/ to/config/custom_components/gonopbx/ in your HA installation
HA_API_KEY from your .envbinary_sensor.gonopbx_system – Overall PBX statusbinary_sensor.gonopbx_ext_1001 – Per-extension statusbinary_sensor.gonopbx_trunk_plusnet – Per-trunk statussensor.gonopbx_active_calls – Active callssensor.gonopbx_calls_today – Calls todaysensor.gonopbx_calls_missed – Missed callssensor.gonopbx_voicemail_unread – Unread voicemailsgonopbx.make_call – Start a call from an extensiongonopbx.toggle_forwarding – Enable/disable call forwardingIf MQTT is enabled, Home Assistant receives real-time events for every call. You can use these events directly as automation triggers:
gonopbx_call_started – Call started (includes caller, destination)gonopbx_call_answered – Call answeredgonopbx_call_ended – Call ended (includes duration, disposition)Sends a push notification to your phone if a call is not answered.
# automations.yaml
automation:
- alias: "Missed call notification"
trigger:
- platform: event
event_type: gonopbx_call_ended
condition:
- condition: template
value_template: >
{{ trigger.event.data.disposition == 'NO ANSWER' }}
action:
- service: notify.mobile_app
data:
title: "Missed call"
message: >
Call from {{ trigger.event.data.caller }} Automatically mutes the TV when a call comes in.
automation:
- alias: "Mute TV on call"
trigger:
- platform: event
event_type: gonopbx_call_started
action:
- service: media_player.volume_mute
target:
entity_id: media_player.living_room_tv
data:
is_volume_muted: true Add a button to your HA dashboard that triggers a call.
# In Automations or Developer Tools → Services:
service: gonopbx.make_call
data:
extension: "1001"
number: "004930123456" Enable forwarding when you leave the house (e.g., via presence detection).
automation:
- alias: "Forwarding when away"
trigger:
- platform: state
entity_id: person.me
to: "not_home"
action:
- service: gonopbx.toggle_forwarding
data:
forward_id: 1
enabled: true GonoPBX publishes the following MQTT topics:
| Topic | Payload | Retained |
|---|---|---|
gonopbx/status | online / offline | Yes |
gonopbx/call/started | {caller, destination, direction, timestamp} | No |
gonopbx/call/answered | {caller, destination, timestamp} | No |
gonopbx/call/ended | {caller, destination, duration, disposition} | No |
gonopbx/extension/{ext}/status | online / offline | Yes |
gonopbx/trunk/{name}/status | registered / unregistered | Yes |
If you have questions or issues, open an issue on GitHub: