zewelor / bt-mqtt-gateway

A simple Python script which provides a Bluetooth to MQTT gateway, easily extensible via custom workers. See https://github.com/zewelor/bt-mqtt-gateway/wiki for more information.
MIT License
549 stars 116 forks source link

topic_subscription not working as expected #235

Open andrey-yantsen opened 2 years ago

andrey-yantsen commented 2 years ago

I have 3 instances on 3 different rpi0w, in different rooms. All of them are used to control my AM43 blinds and to prevent conflicts when processing an MQTT command, they have topic_prefix set depending on the rpi0w's hostname.

In the config I have the following bit:

manager:
  topic_subscription:
    update_all:
      topic: homeassistant/status
      payload: online

The idea is to have up-to-date data sent to MQTT every time HASS restarts. Unfortunately, the defined topic gets concatenated with topic_prefix. It would be good to have an extra option in the topic_subscription in order to prevent such concatenation.

stefanbosch commented 2 years ago

Interesting, this solved my problem. Thank you @andrey-yantsen

Goodwillson commented 1 year ago

By home assistant manual https://www.home-assistant.io/integrations/mqtt/#birth-and-last-will-messages - By default, Home Assistant sends online and offline to homeassistant/status. Adding prefix to this topic is a bug in my opinion, because other mqtt gateways then wont receive birth notifications, if we customize birth message in home assistant to match bluetooth gateway config.