Ami2mqtt - Asterisk Manager Interface to MQTT bridge

I’m using the asterisk PBX at home now for over 20 years. Recently I have been looking for ways to integrate my home asterisk with Home Assistant. What I came up was a bridge that listens to Asterisk Manager Interface events and publishes MQTT messages accordingly. So far, it’s listening to DeviceStateChange and ExtensionStatus events and publishes them under pbx/devstate and pbx/exten accordingly. I have a working version up on Github which includes container images for AMD64 and ARM64.

Here’s an example dashboard which shows the status of my home system:

At the moment, relevant MQTT sensors have to be configured manually, e.g.

  - name: Office
    object_id: pbx_device_sccp_6000
    unique_id: pbx_device_sccp_6000
    state_topic: "pbx/devstate/sccp/6000"
    force_update: true
    icon: mdi:phone-classic

My next step is to understand MQTT autodiscovery and implement respective MQTT messages to create the sensors automatically. After that, I’ll look into how to create add-ons for Home Assistant OS to create an addon.

1 Like

Home Assistant autodiscovery works now. Custom devstates are registered as switches and can actually be switched from HA. Everything else is registered as sensor.

Wow! This looks awesome! Looking forward to trying this.

I just installed and get this error please help me thank you very much

Looks like it can’t connect to your Asterisk Management Interface.

Thank you for responding . Do you have instructions to fix that error? Where do I fix that?

I don’t know your setup. Some ideas:

  • Do you have AMI configured on your asterisk?
  • Do you have configured the correct IP/username/password for the AMI2MQTT bridge?
  • Can the AMI2MQTT bridge reach the asterisk? Are they in the same network, subnet, VLAN?
1 Like

do you use discord? I have configured mqtt to run stably and the network to run on docker

I rarely use discord. I also don’t really have the time to do personal support.
You also haven’t commented on my questions.

The error message means that the AMI2MQTT bridge cannot connect to the AMI service on your asterisk server. You have to configure that correctly.