monster1025 / aqara-mqtt

Aqara (Xiaomi) Gateway to MQTT bridge (I use it for home assistant integration)
Apache License 2.0
88 stars 21 forks source link

Add support for environment variable to load the configuration #20

Closed seblucas closed 6 years ago

seblucas commented 6 years ago

Hi,

A little something I'm using for some weeks with docker-compose. There's no more need to have a volume so it's easier to deploy. I'm using a docker-compose.yml like this one :

version: '3'

services:
  aqara:
    image: monster1025/aqara-mqtt:1-armhf
    restart: always
    environment:
      AQARA_MQTT_CONFIG: |-
        mqtt:
          server: 127.0.0.1
          port: 1883
          username: username
          password: pwd
          prefix: home

        gateway:
          password: 12345667
          unwanted_data_fix: False
          polling_interval: 2
          polling_models:
            - motionx

        sids:
          # motion
          158d0001292a42:
            model: motion
            name: salon

          # buttons
          158d000129f700:
            model: switch
            name: kitchen

          # gateway
          f0b429cc25e8:
            model: gateway
            name: main