MQTT integration with Axis devices

MQTT Me gives your Axis Device the ability to integrate with MQTT systems.  MQTT (Message Queuing Telemetry Transport) is an ISO standard machine-machine messaging protocol targeting IoT devices.

There are several applications/clients supporting MQTT such as Home Assistant (home automation) and mobile apps such as Zanzito and MQTT Dashboard.  There are also more professional systems that use MQTT extensively.

MQTT Me supports both publishing (upon Axis device events) and subscribe to topics to execute actions on the Axis device.

One of my usage is to get a speach notification in my phone when someone triggers motion detection in any of my cameras.  I have Zanzito on my phone that subscribes to a topic published by my cameras.  The MQTT payload from my cameras includes a string that Zanzito will do TTS (Text-To-Speach) to play on my phones speaker.  I will hear the message even if the phone is idle in my pocket.

Onther usage is having MQTT Dashboard on my phone.  The app is configured with a button that toggles a digital IO port on the Axis device.

Compared to integrating with VAPIX/ONFIV, MQTT enables a for more flexible and simplified integration for event/action solutions.  The Axis device does not need to have network access to the MQTT application as long as the device and client have access to the same MQTT broker.  You can close all the incoming ports on your firewall.  MQTT clients conntect to broker from the inside.

Since MQTT Me does not support TLS (encryption) you should not connect to a broker on the Internet.  A  local broker is safe OK.   Remote clients can always connect to the broker over TLS if you configured your broker with plain text (port 1883) and  TLS (port 8883) for the clients accessing from Internet e.g. mobil devices.

Read more in the MQTT Me manual [PDF]

Download the ZIP file containing ACAP (MIPS, ARM7 and ARM7hf)

Current version is 2.0.   Note: Version 2.0 is not compatible with version 1.X.  You need to uninstall 1.x before installing version 2.0.

Please, share any interesting MQTT integration solutions by using the comments.

9 comments

  1. MQTT Me Version 1.1 and 1.2 fixed some flaws and improved some features. Read the release notes in the ACAP ZIP-file. Recommeded to update previous installed versions.

    Like

  2. It doesn’t appear that Virtual Inputs are handled separately. In the log I get “Event: Device/IO/VirtualInput” when triggering any virtual input. All virtual input events are published.

    Like

    1. Yes, I can confirm your findings. Axis device events are very hard to work with and there are variations on how they are declared. Virtual Inputs events are not well declared.

      There is one work-around. If you publish a topic, triggered by a a virtual event, set the payload to *. This will extract the internal event payload and you can parse it on the subscriber side. If you trigger a virtual input with an http request
      http:///axis-cgi/virtualinput/activate.cgi?schemaversion=1&port=1

      The payload will then be the following JSON

      {
      “device” : “ACCC********”,
      “event” : “Device/IO/VirtualInput”,
      “data” : “port=1;active=1”
      }

      I am curious… Virtual events are desinged to trigger an action in the Axis device. Having an external resource triggering a virtual input in the Axis device where the action is to publish a message on MQTT to some other subscriber seems a bit strange. Why don’t you have the resource that triggered the virtual input sending a message directly to whatever resource subscribing to the MQTT message? Why go through the Axis device? It makes no sense to me. What is your use case?

      Like

      1. I’m using Milestone XProtect as my VMS and trying to integrate overlay buttons, mobile actions and analytic events with Home Assistant/Node-Red.

        I had some other methods hacked together, but I would rather use MQTT. I came across MQTTMe and stopped looking for a Milestone native solution.

        Like

          1. Are you looking to find a way to trigger some action (recording) in Milestone by an external event? If so, the Axis MQTT Subcriber ACAP (https://github.com/aintegration/subscriber) may come in handy as an event proxy. You define a subscrition topic and the ACAP will publish an ONVIF event (pulse or state) based on payload of the MQTT message. Milestone can monitor this ONVIF event that enables you to create an action. Now you can have any client publishing a message on MQTT that triggers an action in Milestone.

            Like

          2. Actually i am looking for solution that does the opposite. for example if a camera detects a motion i would like to trigger an action in node-red or HomeAssistant. but Below solution is awesome thank you for sharing.

            Like

          3. Tha Axis Publisher will do the opposite. It will publishing an MQTT message on VMD. You can also configuring the publishier to include a jpeg image

            Like

  3. Is there any Armv6 version, for an Axis M3024 camera?
    In log they show:
    CPU: ARMv6-compatible processor [4117b365] revision 5 (ARMv6TEJ), cr=00c5387f

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s