I have a large Indoor Air quality dashboard (see below). From the picture I hope you can approximate the complexity of the flow associated with it. The issue is that I have many identical sensors in various locations. If I want to view a dashboard for each, with my current knowledge, it looks like I would need to copy the entirety of the flow potentially dozens of time. Each is different in only the topic that it listens to. You can imagine the maintenance issues of duplicating the code base, not to say the computing demand on the poor little NAS this runs on.
What I imagined was to have only one dashboard but with a pulldown that holds all the specific topics for each sensor of the type IAQ and upon selection reload the dashboard with the appropriate data. But I can's seem to figure out how to dynamically switch the topic of the MQTT listener.
The only two options I see are:
1 - have the MQTT listener listen for all topics under the root .../IAQ/# and dynamically filter. But that can be a lot of useless filtering. or
2 - Forget completely listening to the MQTT in real time and make this strictly a Database Driven dashboard, and that means querying the database often.
Are there any other way I do not know and which would you recommend?