Skip to content

Commit

Permalink
experimental custom devices.js support for edge branch; github issues…
Browse files Browse the repository at this point in the history
… template for device issues
  • Loading branch information
danielwelch committed Oct 4, 2018
1 parent 4df566e commit 465bc9b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Is your issue about a specific device? It probably belongs in the [zigbee2mqtt issue tracker](https://github.com/Koenkk/zigbee2mqtt). Consider posting your issue there first.
3 changes: 2 additions & 1 deletion zigbee2mqtt-edge/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"cache_state": "bool?",
"log_directory": "str?",
"log_level": "match(^info|debug|warn|error$)?",
"rtscts": "bool?"
"rtscts": "bool?",
"zigbee_shepherd_devices": "str?"
},
"image": "dwelch2101/zigbee2mqtt-edge-{arch}"
}
10 changes: 10 additions & 0 deletions zigbee2mqtt/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ CONFIG_PATH=/data/options.json
DATA_PATH=$(jq --raw-output ".data_path" $CONFIG_PATH)

ZIGBEE_SHEPHERD_DEBUG=$(jq --raw-output ".zigbee_shepherd_debug // empty" $CONFIG_PATH)
ZIGBEE_SHEPHERD_DEVICES=$(jq --raw-output ".zigbee_shepherd_devices // empty" $CONFIG_PATH)

python3 set_config.py "$CONFIG_PATH" "$DATA_PATH"

if [[ ! -z "$ZIGBEE_SHEPHERD_DEBUG" ]]; then
export DEBUG="zigbee-shepherd*"
fi

if [[ ! -z "$ZIGBEE_SHEPHERD_DEVICES" ]]; then
echo "[Info] Searching for custom devices file in zigbee2mqtt data path..."
if [[ -f "$DATA_PATH"/devices.json ]]; then
cp -f "$DATA_PATH"/devices.json ./node_modules/zigbee-shephard-converters/devices.js
else
echo "[Error] File $DATA_PATH/$ZIGBEE_SHEPHERD_DEVICES_PATH not found! Starting with default devices.json"
fi
fi

ZIGBEE2MQTT_DATA="$DATA_PATH" pm2-runtime start npm -- start

0 comments on commit 465bc9b

Please sign in to comment.