I’ve been planning a home automation build for some time including most recently over a period of months being away from home with work. Home assistant is definitely going to be the platform I build on and around. Being unable to actually build anything yet and continue research has meant that I haven’t started building the first setup I came across. I’m aiming to build something quite robust for the long term. A little more complexity for a better overall system is fine with me.
But I’m now getting closer to execute and wanted to run some things regarding the overall system structure by the community here for advice before learning things the hard (slow) way. I want to get the data flows as good as I can from the start.
Firstly, for my sensors I’m aiming to use an entirely MQTT network using Mosquitto as the broker. I’m also aiming to use PostreSQL for the HA database rather than SQLite and feed HA data into InfluxDB.
I’m aiming to feed metrics (and eventually logs) from my router/firewall, desktops, laptops and servers into InfluxDB via Telegraf for use in both Grafana and HA. However here I get to my query.
I am considering sending the metrics (CPU use, HDD use, network activity, temps etc) from the computers from Telegraf via MQTT (which is possible) to Mosquitto which would then make it into both HA then InfluxDB. I could then use that data in both Grafana and HA. The main advantage I am considering for doing that rather than direct from Telegraf into InfluxDB is that I will be able to use that data in automations inside HA. I am thinking also that using MQTT could allow for better data assurance. I could set up alerts inside Grafana (for example a volume reaching 90% capacity or CPU above 90% for more than 1 minute etc), but that’s about it. With HA I could do much more beyond just alerting. And doing it inside Grafana means I’d also have configs/alerts in both HA and Grafana which would be very manageable but perhaps less than ideal?
So my question is, what am I missing when considering sending metrics from Telegraf via MQTT into Mosquitto then into HA and InfluxDB instead of just direct from Telegraf into InfluxDB? What assumptions have I made that are wrong? Clearly, I’ll be able to test this out when I start building the system but seeking to save lots of time by learning from others here. I’ve reviewed both the InfluxDB integration page and the page about State Objects and lots of other articles online that don’t discuss this specifically. I note in the InfluxDB page it says it transfers all State changes from HA into InfluxDB.
The main things that occur to me are that the data flow is more circular and therefore perhaps more prone to error. Perhaps some data from Telegraf will be lost or not compatible if going via MQTT then into Mosquitto then HA then InfluxDB due to some data not being a State change? What haven’t I considered? Obviously, setting this all up will take some work but just wanting to get the overall design and data flows optimised before getting my hands dirty.
Many thanks for considering this query. This is my first post here so apologies if it’s not in the right spot.