Skip to content

Configuration

danecreekphotography edited this page May 28, 2020 · 19 revisions

Enabling & configuring MQTT

MQTT is enabled by uncommenting the - mqtt line in the docker-compose.yml file. See the comment above the line in the file to be sure the right line is changed.

MQTT is configured using the mqtt.conf file. The following properties are supported:

Property Description Example
uri Required. The address of the MQTT server. "mqtt://192.168.1.100:1883"
username Optional. The username to log into the server with. "mqttuser"
password Optional. The password to log into the server with. "mqttpass"
rejectUnauthorized Optional. Default true. Controls whether connections to mqtts:// servers should allow self-signed certificates. Set to false if your MQTT certificates are self-signed and are getting connection errors. false

The only authentication method currently supported is basic.

Enabling & configuring Telegram

Telegram is enabled by uncommenting the - telegram line in the docker-compose.yml file. See the comment above the line in the file to be sure the right line is changed.

Telegram is configured using the telegram.conf file. The following properties are supported:

Property Description Example
botToken Required. The bot token for your Telegram bot server. "123987123:adfk2893r7akdskanfsdalskf"

Obtaining the botToken and chatIds for the trigger configuration is not hard but does take a few steps. Here's what you need to do:

  1. Contact BotFather on Telegram
  2. Send the /newbot command. Follow the instructions and you'll get back a token that looks something like the one in the example above.
  3. Connect to the bot in your Telegram personal account and send it a message
  4. Go to https://api.telegram.org/bot123987123:adfk2893r7akdskanfsdalskf/getUpdates, after replacing the token in the URL with the one you obtained in step 2.
  5. In the response look for the id field to obtain the chatId. In the below sample response the chatId is 12345.
{"ok":true,"result":[{"update_id":297596982,
"message":{"message_id":2,"from":{"id":12345,"is_bot":false,"first_name":"Neil","last_name":"Enns","language_code":"en"},"chat":{"id":12345,"first_name":"Neil","last_name":"Enns","type":"private"},"date":1590551469,"text":"hi"}}]}
Clone this wiki locally