arachnetech / homebridge-mqttthing

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

[FS] Wildcard Subscribe by Type? #607

Open NickJLange opened 1 year ago

NickJLange commented 1 year ago

I'm using a republishing rule/js to normalize zigbee devices to fixed topics by type. I would love to have a dynamic subscription (even if I have to restart homebridge) to keep the boilerplate config down. Something like:

        {
            "type": "temperatureSensor",
            "url": "mqtt://192.168.XXX.XXX:1883",
            "logMqtt": true,
            "topics": {
               "getCurrentName": {
                    "topic": "stat/temperatureSensor_+/Name",
                } 
               "getCurrentRelativeHumidity": {
                    "topic": "stat/temperatureSensor_+/Temperature",
                    "apply": "return parseFloat(JSON.parse(message));"
                }
            },
            "accessory": "mqttthing"
        },

I could not find an existing enhancement request/idea. Is there anyone else interested?