Mqtt.cfg - dynamic hostname (${hostname} for client id?

Is there anyway I can set this dynamically? Just for being able to move the system around.

Can you use localhost? It should be the desired outcome correct?

I am afraid but you can’t. The mqtt.cfg docs indicate that the clientId is optional and if you leave it commented out OH will provide a clientId automatically.
What exactly is your purpose, here?

I’ve been dockerising everything (why yes, that is a word, I just made it up). As part of that Its possible that I could be running openhab on more than one physical system.

In the past I’ve found that having two clients with the same name to one mosquitto server will cause one to disconnect.

I was hoping I could use a variable in the mqtt.cfg so that the same config works on either…but as you saw I could leave it empty…or feed in it in another method.

Nope, it’s a word and you mispelled it. :wink:

Do you have any USB dongles? That will make doing so difficult.

That is correct. But you really shouldn’t have more than one OH connected to the broker at a time if they are doing the same thing. There are all sorts of situations where you don’t want things happening twice (or more) for every event. They OH’s are different configs then they should have a different client ID.

Oh no I didn’t. The blasphemy brought to us by our American cousins cannot be forgiven. Though shall not replace an S with a Z.

Yeah I do, at the moment I’m likely to pull it out and replace it in a new system. If was was really keen, I’d dedicate a machine to hosting the zwave dongle…but probably not.

1 Like