Quickstart#
ja2mqtt requires JA-121T bus interface, however, you can test it using the simulator if you do not have one. The Docker image comes with a sample configuration that uses the simulator. ja2mqtt also requires a running instance of MQTT broker. The below steps use the Eclipse Mosquitto MQTT broker with a sample configuration. For complete installation instructions, please refer to the installation guide.
In your working directory, create a sub-directory
mqtt-config
and add themosquitto.conf
into it.Add a
docker-compose.yaml
with the following content.version: '3.0' services: ja2mqtt: container_name: ja2mqtt image: tomvit/ja2mqtt:latest depends_on: - mqtt-broker mqtt-broker: container_name: mqtt-broker volumes: - ./mqtt-config/mosquitto.conf:/mosquitto/config/mosquitto.conf image: eclipse-mosquitto:latest
Run the
docker-compose.yaml
.$ docker-compose up -d
Inspect the logs of ja2mqtt by running the following command:
$ docker logs ja2mqtt
The simulator provides a straightforward Jablotron topology with two sections:
House
with code1
and an initial state ofARMED
, andGarage
with code2
and an initial state ofREADY
. This topology can be used to simulate changing the state or retrieving the status of the sections. The simulator also mimics peripheral state changes and Jablotron heartbeat messages by generating “OK” messages every 10 seconds.You can use the below example to publish the MQTT event to retrieve the state of sections:
$ docker exec -it ja2mqtt pub -t ja2mqtt/section/get -d pin=1234 <-- send: ja2mqtt/section/get: {"pin": "1234", "corrid": "ca8438b82f16"} --> recv: ja2mqtt/section/house: {"corrid": "ca8438b82f16", "section_code": 1, "section_name": "house", "state": "ARMED"} --> recv: ja2mqtt/section/garage: {"corrid": "ca8438b82f16", "section_code": 2, "section_name": "garage", "state": "READY"}
Please refer to the usage guide for more details on how to use ja2mqtt to query and control Jablotron sections and perihperals.
Check the log entries in the ja2mqtt log to see the events were generated.