OpenZWave Beta Add-on - How to set Association Group

I am running the OZW beta and need to set an association group. Since the add-on has MQTT built-in, I am not running an external server. I can connect to the add-on MQTT server but I cannot get past the credential requirement. It appears that there are encrypted credentials for the ozw user.

I’ve seen a lot go guides here about publishing topics to the MQTT server but cannot find any information on how to actually connect to the one included with the add-on.

Thanks for the help!

To use the OZW Addon, you must also install the Mosquitto Addon. The Mosquitto Addon docs have instructions about users. It sounds like you can create users, or just use Home Assistant users, or enable anonymous access.

Thanks for the response. You don’t need to install the Mosquitto add-on anymore to use the OZW add on. You simply install the integration from the integrations page, then the OpenZWave add-on is automatically installed. That’s the path I took. There is no separate Mosquitto add-on, it’s built into the OZW add on now.

Therein lies the issue. I’m trying to get a connection into the built in MQTT server so I can set the association.

Are you sure about that? According to the docs, the Mosquitto addon must be installed beforehand. As far as I can tell, the addon is still configuring a bridge to the mosquitto addon broker and specifies it as a dependency. Neither does the OZW addon publicly expose an MQTT port, so how can HA talk to it?

What is not required, when using a Supervisor installation, is the MQTT integration. The OZW integration will talk directly to the mosquitto addon broker, instead of relying on the integration settings. That’s my understanding at least…

1 Like

I too am not sure about that as if you have ESPHome (or something similar) you NEED an MQTT Broker.
So what you are saying is that if you install the OZW Addon you must deinstall the original broker and configure the new one for the old duty ???
This seems backwards to me

You’ll have to clarify. That doesn’t sound like anything I said.

No it isn’t, it’s what I said
He said that you don’t need the broker if you install the OZW addon
You can’t have two brokers so it implies you must remove the old one

Though thinking about it, if it just checked there was a broker installed it might skip that step

It was meant to agree but from another angle

I’m running Home Assistant OS, so installing the integration installed the OZW add-on which includes the Mosquitto broker. I’ve got 48 devices on it right now, all working well. There is no Mosquito add-on in the supervisor page.

This is also backed up by the docs…

Requirements

SUPERVISOR MANAGED INSTALLATION

  • The official OpenZWave add-on installed available from the add-on store.

CORE INSTALLATION

I need to figure out how to connect an external client to the broker that is part of the OZW add-on. This is where I’m stuck.

OK, I was going by the addon installation instructions which are out of date.

  1. This add-on currently requires to have the Mosquitto add-on installed. Please make sure to install and set up that add-on before continuing.

All the addons and HA can communicate in an internal network. It looks like the OZW integration is using this method. How are you able to connect to the internal broker?

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.

  1. Install Mosquitto addon, configure it to your liking (I left the defaults) and start it
  2. 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.
  3. 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.
  4. 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:

  1. 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.
  2. Enable the Supervisor API access, this is necessary to get the API token that has full privileges.
  3. 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"
}

There seem to be two ways to add the Mosquitto broker into HA:

  1. From the Supervisor > Add-on Store and
  2. From the Configurations > Integrations > Add Integration

It’s not clear to me whether the broker ends up being configured exactly the same, or whether the configuration depends on the route chosen.

I chose route (1) for my OpenZWave (beta) setup and it worked out of the box.

Integrations and addons are not the same thing. Integrations provide the ability for HA to access a service, and addons can provide those services. #1 is an MQTT broker. #2 is not a broker, it is a client that is configured to connect to a broker, which could be the Mosquitto addon broker, or an external one.

The original release of the OZW Beta required (in the context of a Supervised install):

  1. The Mosquitto addon
  2. The OZW addon
  3. The MQTT integration, configured to connect to the Mosquitto addon broker
  4. The OZW integration

The latest version of HA can skip MQTT entirely (only in the context of a Supervised install). This is the installation method OP has used. Therefore the minimum requirements are now:

  1. The OZW addon
  2. The OZW integration

If you have no need for MQTT, then this is the simplest approach. The OZW integration installer will even automatically install the addon for you. Even if you want MQTT for other uses you can add it later.

If you extract the OZW internal broker secret username and password from the debugging API, you can actually configure the MQTT integration to connect to the internal broker by using hostname core-zwave and the discovered username and password. Of course, you won’t be able to use MQTT in HA for anything else, which makes it a bit pointless.

Thanks very much for the explanation - much appreciated. As a newcomer to HA, I am finding that the documentation forest is often difficult to navigate, and appears, in places, to be in dire need of brush clearing.

For example, the documentation for the OpenZWave add-on currently states:

Home Assistant Add-on: OpenZWave

Installation

Follow these steps to get the add-on installed on your system:

  1. Navigate in your Home Assistant frontend to Supervisor -> Add-on Store .
  2. Find the “OpenZWave” add-on and click it.
  3. Click on the “INSTALL” button.
  4. This add-on currently requires to have the Mosquitto add-on installed. Please make sure to install and set up that add-on before continuing.

You seem to be saying that step 4 is no longer needed, but should be changed to: “Add the OZW integration using the HA Configuration > Integrations screen” Or am I wrong?

Edit: I now notice you add the rider “only in the context of a Supervised install”. So if I’m using the Home Assistant OS package, I stick to adding both Add-ons…?

You can get the login info from .storage/core.config_entries if it’s using the internal mqtt. I rememeber stumbling on that when trying to solve my other issue. And now that you mention that’s how this works, I know how my installation broke the other day. When enabling discovery on the MQTT integration through configuration.yaml, it caused mqtt to be loaded after openzwave. This moved openzwave from MQTT to the internal (emtpy) MQTT.

It’s been a couple days but I am happy to report success.

The suggestion by @freshcoast was spot on. I ran that scenario on my development HA with success and re-ran the same steps on my production system which is now using the external MQTT server addon. I am happily now able to set association groups. I was even able to remove a dead node too.

@petro I wish I had seen your suggestion sooner, but thanks for offering it! I’m sure it will help others with similar questions in the future.