commit edf11eb6e4b3fd1c020f2a52c65ba7c47a8d6a84 Author: J. Fernando Sánchez Date: Thu Jan 10 11:50:50 2019 +0100 First commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..52c201a --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +This is just a simple environment with: + +* zigbee2mqtt: a bridge from zigbee (through a zigbee USB stick) to MQTT +* mosquitto: an MQTT server +* home assistant: a home automation platform, with MQTT support. +zigbee2mqtt also supports auto discovery for home assistant. + + +You'll need to configure zigbee2mqtt with a `z2m-data/configuration.yaml` file like this: + +``` +homeassistant: true +permit_join: true +mqtt: + base_topic: zigbee2mqtt + server: 'mqtt://mqtt' # The mosquitto server in this case. + serial: + port: /dev/ttyACM0 # The serial device. It should be the same as the device entry in docker-compose.yml. +``` + + +After running home assistant the first time, you will have to add the mqtt configuration to the config file: + +``` +mqtt: + broker: mqtt + discovery: true + birth_message: + topic: 'hass/status' + payload: 'online' + will_message: + topic: 'hass/status' + payload: 'offline' +``` + +More info here: http://balkian.com/controlling-zigbee-devices-with-mqtt.html diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..31ae6e2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,34 @@ +version: '2.1' +services: + zigbee2mqtt: + image: koenkk/zigbee2mqtt + container_name: zigbee2mqtt + restart: always + volumes: + - ./z2m-data/:/app/data/ + devices: + - "/dev/ttyACM0" + networks: + - hass + mqtt: + image: eclipse-mosquitto + ports: + - 1883:1883 + - 9001:9001 + networks: + - hass + volumes: + - ./mosquitto.conf:/mosquitto/config/mosquitto.conf + hass: + image: homeassistant/home-assistant + ports: + - "8123:8123" + networks: + - hass + volumes: + - ./hass-config:/config + - "/etc/localtime:/etc/localtime:ro" +networks: + hass: + driver: overlay + diff --git a/mosquitto.conf b/mosquitto.conf new file mode 100644 index 0000000..e69de29