Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNAP Set commands to change mqtt:pub-topic not working #26

Open
AA6CG opened this issue Aug 15, 2024 · 0 comments
Open

SNAP Set commands to change mqtt:pub-topic not working #26

AA6CG opened this issue Aug 15, 2024 · 0 comments

Comments

@AA6CG
Copy link

AA6CG commented Aug 15, 2024

Describe the bug
I'm using the SNAP install of TheengsGateway (v1.4) on an RPi Zero 2W under Debian 12. The MQTT broker is Mosquitto 2.0.18 running in a docker on another server. I am using MQTT Explorer to monitor the broker. The installation was smooth and I was able to connect to the broker easily. The system has been 100% stable for several days.

Before putting the gateway into production, I needed to change the mqtt pub-topic and lwt-topic to something other than the default home/TheengsGateway/xxx to avoid confusion with other TheengsGateways.

I have ha:discovery disabled

The commands I used after I SSH'd to the Pi Zero were:

sudo snap set theengs-gateway mqtt.pub-topic=pi_0/TheengsGateway/BTtoMQTT
sudo snap set theengs-gateway mqtt.lwt-topic=pi_0/TheengsGateway/LWT

The commands were accepted without error and the theengs-gateway service was automatically restarted after each command. I checked the config using:

sudo snap get -d theengs-gateway

pi@rpi-Zero:~ $ sudo snap get -d theengs-gateway

{
"bindkeys": "",
"ble": {
"adapter": "",
"enable": 1,
"scan-duration": 5,
"time-between": 5
},
"general-presence": 0,
"ha": {
"discovery": 0,
"discovery-device-name": "TheengsGateway",
"discovery-filter": "IBEACON GAEN MS-CDP",
"discovery-topic": "homeassistant/sensor",
"hass-discovery": 1
},
"identities": "",
"log-level": "WARNING",
"mqtt": {
"enable-tls": 0,
"enable-ws": 0,
"host": "192.168.0.34",
"lwt-topic": "pi_0/TheengsGateway/LWT",
"pass": "",
"port": 1883,
"pub-topic": "pi_0/TheengsGateway/BTtoMQTT",
"publish-advdata": 0,
"sub-topic": "home/+/BTtoMQTT/undecoded",
"user": ""
},
"presence": {
"enable": 0,
"topic": "home/TheengsGateway/presence"
},
"private": {
"bindkeys": "",
"ble": {
"adapter": "",
"enable": 1,
"scan-duration": 5,
"time-between": 5
},
"general-presence": 0,
"ha": {
"discovery": 0,
"discovery-device-name": "TheengsGateway",
"discovery-filter": "IBEACON GAEN MS-CDP",
"discovery-topic": "homeassistant/sensor",
"hass-discovery": 1
},
"identities": "",
"log-level": "WARNING",
"mqtt": {
"enable-tls": 0,
"enable-ws": 0,
"host": "192.168.0.34",
"lwt-topic": "pi_0/TheengsGateway/LWT",
"pass": "",
"port": 1883,
"pub-topic": "pi_0/TheengsGateway/BTtoMQTT",
"publish-advdata": 0,
"sub-topic": "home/+/BTtoMQTT/undecoded",
"user": ""
},
"presence": {
"enable": 0,
"topic": "home/TheengsGateway/presence"
},
"time-sync": {
"addresses": "",
"format": 0
},
"tracker-timeout": 120
},
"time-sync": {
"addresses": "",
"format": 0
}
}

The results were as expected with the configuration parameters correctly reflecting the changes.

The results in MQTT Explorer were different, however. The mqtt.lwt-topic was now publishing to pi_0/TheengsGateway/LWT as expected but the mqtt-pub-topic was still sending to the default home/TheengsGateway/BTtoMQTT

I restarted the MQTT broker several times and rebooted the Pi Zero several times with no difference in the behavior

Any thoughts?

Screenshot 2024-08-15 112201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant