MQTT Testing - 8s
Opened this issue · 4 comments
Starting this as a clarification thread for setup and deploy of the MQTT transport option. I observed that I was using much more data than I'd hoped. Current setup is BMS(local) > Telegraf (local) > Influx (local) > Grafana (remote). This meant anytime Grafana tried to render for a client it pulls data from Influx over the VPN. I burned my 3g data up in no time. Current thinking is now, send the MQTT data once remotely and have the queried DB local to Grafana.
MQTT Setup:
BMS(local) > MQTT Broker(vpn remote) > Telegraf(vpn remote) > Influx(vpn remote) > Grafana(vpn remote) > Home Assistant/client grafana view
Observations:
For my setup and the unreliability of tunneled 3g cellular internet, MQTT QOS is important. In the .py file one request would be to have a single location to set QOS instead of at each message.
topic ="data/bms"
gauge ="data/bms/gauge"
broker="192.168.xx.1"
port=1883
qos=1
Yeah, good ideas. I'm just trying to get it going. There is something funky that I couldn't sort out so i fell back to sockets for now.
I was getting data, but it would only do a few iterations and then hang. I think it's my mqtt input config (only thing i've not looked at)..
anyhow, seems to be fine with the following
BMS(local) > Telegraf(local) > Influx(vpn remote) > Grafana(vpn remote) > Home Assistant/client grafana view.
I haven't looked at the data size for the Telegraf to Influx communication, but it's vastly less impactful than multiple clients hitting the DB on the local side everytime the view refreshes.
Onsite i've got a RPi with a touchscreen that is running a version of the dashboard in kiosk mode all the time. It was fetching over VPN to grafana remote > Grafana was querying the DB back over the vpn > sending data back over to hand off to grafana and then finally back onsite to the RPi display... total waste. Now it's only going over VPN once to refresh. I can probably sort that out by running local copies... tomorrow.