I have installed Theengs Gateway on a RPI with Mosquitto and I would like to personalize the topics tree to integrate it with the existing topics.
I made an attempt but it seems that as soon I touch the configuration into “theengsgw.conf” somethings is wrong.
Moreover, how can I eliminate the clutter of the bluetooth devices that just pass by the rpi and are captured? I need just to focus on one Mopeka sensor.
Have a look at the option of setting a white-list, to only publish messages for device(s) defined in it…
What exactly is wrong when you make changes to the theengsgw.conf? Admittedly we could probably improve on the gateway name not having to be changed in multiple configs there in the future, but otherwise changes to the theengsgw.conf is the proper way to make any required changes to tiopic names and structures and other settings.
Where can I look for the white-list settings, please?
After the changes into the configuration file, it seems that the gateway doesn’t publish anymore to the mqtt.
Some other times I have to restart the gateway several times to make it working
Where can I look for the white-list settings, please?
All the config setting options are described in the documentation, at
e. g.
-wl ADDRESS [ADDRESS ...], --whitelist ADDRESS [ADDRESS ...]
Addresses of Bluetooth devices to allow, all other devices are ignored
Best practice:
• Stop the Gateway
• Make changes to your theengsgw.conf
• Start the gateway without any additional arguments possibly resetting any changes made in the config file
Alternatively:
• Stop the Gateway
• Start the gateway once with any specific arguments you want to change/add, which will then be taken over in the theengsgw.conf, and will not be required as arguments again for future starts
Thanks DigiH for your reply, much appreciated.
I have already followed the best practices you suggested.
If it is not too much hassle, would you mind checking if the modified configuration file has something wrong, please?
Do you not use other discoveries with Home Assistant, and don’t they all publish their discovery entries into the home assistant topic, with HA also picking discoveries up there. Unless you have changesd this topic structure for all other discovery enabled add-on and gateways and changed this in Home Assistant as well. Or possibly setting this back to the default
"discovery_topic": "homeassistant",
With all the other topic structures being changes to the top topic to be
btsensors
instead of
home
that’s fine, but you might want to keep the remains topic structure as the Theengs Gateway defaults, especially with the BTtoMQTT part, which you have changed to all lower case bt2mqtt. This should then also work nicely with the discovery messages defined topics.
"publish_topic": "btsensors/theengs/bt2mqtt",
to
"publish_topic": "btsensors/theengs/BT2MQTT",
and adding your Mopeka to the whitelist, as to only publish it
…
"whitelist": [
"AA:BB:CC:DD:EE:FF"
]
and starting up Theengs Gateway without any additional parameters, I don’t see anything obvious which should not make it work nicely and reliably.
Actually, the lower case bt2mqtt should also be fine, as I just looked it up in the code, and the discovery state topics are actually derived from the publish_topic.
So the only other thing is the Moe Assistant discovery topic, depending on how you have your Home Assiatnt set up.
Thanks,
I am not using Home Assistant at all.
All the sensors I use (mostly ZigBee ones) just send their data to Mosquitto and with a Virtuino dashboard I visualize them.
The changes I made are for cleanliness of the topics tree and uniformity (that’s why I used lowercases).
and also delete any unnecessary discovery messages you have already had published to your MQTT broker - unfortunately not under the default homeassistant topic, but within your general btsensors top topic.
You can easily delete them with MQTT Explorer.
And with my additional above comment you can keep everything lower case, and by defying the Topeka in the whitelist I don;t see any reason why Theengs Gateway should not run fine for you with the Topeka being the only device being published under your individually defined topics.
Somehow once I have been able to make it working for a while, then no more.
Digging a bit, but I am no developer, it seems that the gateway sees the bluetooth down even if the blue icon on the taskbar is lit.
This is the output of systemctl status for theengs
theengsgateway.service - Theengs Gateway
Loaded: loaded (/etc/systemd/system/theengsgateway.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2024-12-11 10:54:30 CET; 1min 49s ago
Main PID: 2985 (python3)
Tasks: 1 (limit: 8754)
CPU: 663ms
CGroup: /system.slice/theengsgateway.service
└─2985 /usr/bin/python3 -m TheengsGateway -H localhost
Dec 11 10:54:30 houston systemd[1]: Started Theengs Gateway.
Dec 11 10:54:30 houston python3[2985]: INFO:BLEGateway:Starting BLE scan
Dec 11 10:54:30 houston python3[2985]: INFO:BLEGateway:Connected to MQTT broker
Dec 11 10:54:30 houston python3[2985]: INFO:BLEGateway:Subscribed to btsensors/+/BTtoMQTT/undecoded
Dec 11 10:54:35 houston python3[2985]: ERROR:BLEGateway:No powered Bluetooth adapters found.
exactly 5 seconds after starting it loses the connection with the rpi onboard bluetooth.
I have tried to investigate what’s wrong, but I am at a dead end
While I can give you tips about the Theengs Gateway config, I’m afraid I don’t know much about Bluetooth adapter conflict and issue on different systems.
Hopefully someone else might have some insight into your problem.
Just to follow-up on my issue.
I have been able to solve it, and having the system working flawlessly, disabling the rpi onboard bluetooth and using a bluetooth dongle connected via an usb extension cable.