ingria / ajax2mqtt

Bridge between Ajax uartBridge and MQTT
The Unlicense
14 stars 7 forks source link
ajax-security fireprotect homeassistant mqtt uartbridge

Ajax2MQTT

Note: this project is not affiliated with Ajax Systems.

This app takes messages from ajax security modules and sends them via MQTT, making possible to use Ajax devices in your Homeassistant or Homebridge, save telemetry to InfluxDB, etc.

It doesn’t use Ajax cloud services, doesn’t require internet connection and doesn’t expose any data outside of local network. However it requires special hardware module to interface Ajax wireless protocol (see Required Hardware section below). Setting this module up is trivial and doesn't require special skills or tools.

Supported devices

Required Hardware

Connecting everything together

Some tips:

Installation

The recommended installation method is with docker:

$ docker run \
    --name ajax2mqtt \
    --network=host \
    --restart=unless-stopped \
    --device=/dev/your-usb-ttl-adapter-address:/dev/ttyUSB0 \
    -e A2M_HASS_ENABLED=true \
    ghcr.io/ingria/ajax2mqtt

The only line you need to change is /dev/your-usb-ttl-adapter-address.

For more complex setup, copy docker-compose.example.yaml to docker-compose.yaml and change environment variables there.

Available variables:

Name Default value Description
A2M_SERIAL_PORT /dev/ttyUSB0 in docker, none in other environments Path to usb ttl, e.g. /dev/ttyUSB0
A2M_MQTT_ADDRESS mqtt://127.0.0.1 MQTT broker address
A2M_MQTT_PASSWORD none MQTT broker password
A2M_MQTT_USERNAME none MQTT broker username
A2M_MQTT_BASE_TOPIC ajax2mqtt Base topic to publish device states
A2M_HASS_ENABLED false Whether to enable homeassistant integration
A2M_HASS_BASE_TOPIC homeassistant Homeassistant base topic (used for last will and birth events)
A2M_LOG_LEVEL error Logging level

Integrations

MQTT communication is done with "integration" abstractions. Right now there are two: base and homeassistant, but it is possible to create more. Integration watches for device state and sends messages to MQTT broker. Also it listens for command topics and controls the physical devices.

Base integration

Base integration sends all state changes to ajax2mqtt/ID/state topic and subscribes to the following command topics:

You may control the device via these topics or create your own integration based on these topics (e.g. use it in HomeBridge).

Homeassistant integration

This integration adds all your Ajax devices to Home Assistant, thanks to the MQTT discovery. If you don’t need this feature, you can set A2M_HASS_ENABLED config value to false.

License

The Unlicense License. Please see License File for more information.