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

Multiple topics for single property #673

Open fjolnir opened 3 months ago

fjolnir commented 3 months ago

For devices that expose multiple topics to do something represented by mqtttthing as a single property, it'd be useful to be able to map it to multiple topics.

Example: My air conditioner has separate power=on/off and state=heat/cool/auto topics. While mqttthing's thermostat has a single targetHeatingCoolingState=off/heat/cool/auto.

So what I need to do is: when mqttthing sets for example targetHeatingCoolingState=auto is to set both power=on&state=auto, then when mqttthing's targetHeatingCoolingState is off, I only want to set power=off

I looked into using a codec, but didn't make any progress. Is there any way to accomplish this?

dylexrocks commented 2 months ago

Please correct me if I am wrong, but I don’t think that it is possible to map more than one topic to a characteristic currently. What I would do is to put something in between that aggregates the messages to a single topic. You could this for example with node-red or did you already find another solution?