zwave: Add instance config (#1380)

This commit is contained in:
Jordan Speicher
2020-06-09 14:46:20 -05:00
committed by GitHub
parent 7d0c41d249
commit 32b6943a46
3 changed files with 15 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ Add-on configuration:
```yaml ```yaml
device: /dev/ttyUSB0 device: /dev/ttyUSB0
network_key: network_key:
instance: 1
``` ```
### Option `device` ### Option `device`
@@ -25,6 +26,12 @@ network_key:
### Option `network_key` ### Option `network_key`
### Option `instance`
Zwave instance number as reported to MQTT. This corresponds with the
`instance_id` attribute of `ozw` services in Home Assistant.
## Known issues and limitations ## Known issues and limitations
- You hardware need to be compatible with OpenZwave library - You hardware need to be compatible with OpenZwave library

View File

@@ -29,7 +29,8 @@
}, },
"schema": { "schema": {
"device": "str", "device": "str",
"network_key": "password" "network_key": "password",
"instance": "int(1,)"
}, },
"image": "homeassistant/{arch}-addon-zwave" "image": "homeassistant/{arch}-addon-zwave"
} }

View File

@@ -5,6 +5,9 @@
OZW_CONFIG=/data/ozw/config OZW_CONFIG=/data/ozw/config
OZW_NETWORK_KEY=$(bashio::config 'network_key') OZW_NETWORK_KEY=$(bashio::config 'network_key')
OZW_DEVICE=$(bashio::config 'device') OZW_DEVICE=$(bashio::config 'device')
bashio::config.has_value 'instance' \
&& OZW_INSTANCE="$(bashio::config 'instance')" || OZW_INSTANCE=1
MQTT_PASSWORD="$(bashio::jq /data/auth.json ".ozw_password")" MQTT_PASSWORD="$(bashio::jq /data/auth.json ".ozw_password")"
# Wait until mosqitto is up and running # Wait until mosqitto is up and running
@@ -24,5 +27,5 @@ exec ozwdaemon \
--mqtt-server 127.0.0.1 \ --mqtt-server 127.0.0.1 \
--mqtt-port 1883 \ --mqtt-port 1883 \
--mqtt-username ozw \ --mqtt-username ozw \
--mqtt-instance 1 \ --mqtt-instance "${OZW_INSTANCE}" \
--stop-on-failure --stop-on-failure