I’m integrating several devices of the same model (www.dingz.ch) into my home assistant environment based on MQTT. The topics (read & write) use device ID and model and there are 12+ topics (even if ignoring uninteresting topics) to integrate with topics like:
state_topic: 'dingz/246F28A76F1C/dz1f-pir/state/light/0'
state_topic: 'dingz/<id>/<model>/state/light/0'
Obviously one or two parameter would help to clean up and simplify sensor and script files:
state_topic: 'dingz/{{ device }}/state/light/0'
state_topic: 'dingz/{{ id }}/{{ model }}/state/light/0'
Whether solved by secret or sensor value, either way would help but I have not yet found a working way.
Any hints or help?
Btw.: Putting the hole topic in a secret is not much of a help because - ignoring id and model - the topic differs for most of the MQTT sensors / scripts.