Instead of trying to connect to the internal broker with hidden credentials, I think it’s much easier to just use the Mosquitto addon. Plus it’s a supported method.
- Install Mosquitto addon, configure it to your liking (I left the defaults) and start it
- Restart the OZW addon. If the mosquitto addon is installed it will recognize that the mqtt service is available and create a bridge to the mosquitto addon broker.
- Use your MQTT client to connect to the HA IP and port 1883. You can connect with your HA user and password, as the addon automatically configures it with the HA credentials.
- Publish the assocation command, the bridge connection will result in the command going to the OZW internal broker.
I’m still curious how you are connecting to the internal OZW Addon MQTT broker. Are you using a Supervised install but not HAOS? If you insist on this approach then it’s a much more involved process, and not really supported. I had to satisfy my curiosity and did all of the following using HAOS:
- Enable SSH debugging mode. Make sure your USB stick is named
CONFIG
, that got me. If you are using a Supervised install and not HAOS, then I assume this could be skipped.
- Enable the Supervisor API access, this is necessary to get the API token that has full privileges.
- Use the discovery endpoint of the API, with the API token, to get the username and password.
Here is the output of my addon’s discovery info:
$ curl -sSL -H "Authorization: Bearer $HASSIO_TOKEN" http://homeassistant.local/discovery | jq '.data.discovery[0]'
{
"addon": "core_zwave",
"service": "ozw",
"uuid": "ff8d99b7e1034d75908bd7bca8a2b163",
"config": {
"host": "core-zwave",
"port": 1883,
"username": "homeassistant",
"password": "ien9ieko3aeshahLah2liezaib3ahcoo8ohgh1eedaith9ahp0quebaeGhahph6b"
}
}
host
is the internal container dns name. If you can connect to the container host, then the username
and password
would be your MQTT credentials, that is what the integration is using.
I was able to docker exec
into the OZW container from the host and run mosquitto_sub on the local broker.
# docker exec -it addon_core_zwave sh
/ # mosquitto_sub -t OpenZWave/1/status/ -u homeassistant -P ien9ieko3aeshahLah2liezaib3ahcoo8ohgh1eedaith9ahp0quebaeGhahph6b
{
"OpenZWave_Version": "1.6.1545",
"OZWDaemon_Version": "0.1.0",
"QTOpenZWave_Version": "1.2.0",
"QT_Version": "5.12.5",
"Status": "driverAllNodesQueried",
"TimeStamp": 1609657462,
"ManufacturerSpecificDBReady": true,
"homeID": 3361531979,
"getControllerNodeId": 1,
"getSUCNodeId": 1,
"isPrimaryController": true,
"isBridgeController": false,
"hasExtendedTXStatistics": true,
"getControllerLibraryVersion": "Z-Wave 6.09",
"getControllerLibraryType": "Static Controller",
"getControllerPath": "/dev/serial/by-id/usb-0658_0200_E2061B02-4A02-0114-3A06-FD1871291660-if00"
}