arachnetech / homebridge-mqttthing

A plugin for Homebridge allowing the integration of many different accessory types using MQTT.
Apache License 2.0
466 stars 104 forks source link

No MQTT dispatch handler for WILDCARD topic #500

Open HolgerAusB opened 2 years ago

HolgerAusB commented 2 years ago

I have two raspberrys working on different corners of my house. One of them is the mosquitto server/dispatcher. Both have a rtl_433 receiver to catch signals of 433 MHz weather-station-sensors and two doorbells. Because of the doorbells with self-havesting energy and low signal, I need the two pi-receivers.

As I want to know, which of my receivers cought a signal, the topc contains pi1 or pi2 in the topic, everything else is identical:

rtl/pi1/55/77/Acurite-606TX/temperature_C
rtl/pi2/55/77/Acurite-606TX/temperature_C

while 55 is the protocol-preset of rtl_433, and 77 the id of the transmitter.

Normally one can subscribe to both topics with topic rtl/+/55/77/Acurite-606TX/temperature_C with the + as wildcard

mqttthing does successfully subscribe that wildcard-topic but can't handle the message which contains pi1 or pi2 instead of +.

Homebridge-Log:
Warning: No MQTT dispatch handler for topic [rtl/pi2/55/84/Acurite-606TX/battery_ok]
Warning: No MQTT dispatch handler for topic [rtl/pi2/55/84/Acurite-606TX/temperature_C]
rbswift commented 2 years ago

One solution would be to use something like nodered to subscribe to the wildcard topic and then republish the message on a fixed topic. It would be a very simple flow and nodered is very powerful to support future workflows you might need.

HolgerAusB commented 2 years ago

Thank You @rbswift but I will not install a large extra software/server just for fixing a problem of mqttthing. David has applied the "feature request" tag, so I will wait in humility and gratitude.

Meanwhile I took out the server-name out of the topic-path.

arachnetech commented 2 years ago

rbswift's suggestion is a good one, but I understand it would be good if this can be implemented within mqttthing to save the additional infrastructure. However, to set your expectations I am only finding time to work on mqttthing occasionally at the moment - so it won't get added immediately...

HolgerAusB commented 2 years ago

Yes, I thought so. That's why I wrote '...wait in humility and gratitude'. It is not urgent for me, so I can wait - for as long as it may take.

BTW: Thank you for your work. The plugin was a great help to get my two 433Mhz doorbells working (as motion sensors).

tablatronix commented 2 years ago

Ditto, i use tasmota full topics with deviceid, having a topic token would be sweet. I assumed this was automatic already.

halk1982 commented 1 year ago

Same need here, it seems like mqtthing cannot handle the + wildcard. Any update on this Dave? Thank you very much for your work, this is a great plugin!