MQTT relay all traffic from mosquito to external server?

hi.

Im currently running mosquito MQTT server locally on the same RPI that runs hass.io.

Everything is peachy :slight_smile:

My question goes: is there any way to redirect all MQTT published data to mosquito to another broker. eg. an external one.

The reason is I wanted to keep years of stats for temps humid etc. in a safe way and more importantly I want to keep the DB size at a bare minimum on the RPI in order to keep performance in a healthy state.
I dont think mosquito on the pi will handle a huge DB too well.

Anyone tried this ?

I would guess I could do a python script in appdaemon that would catch all traffic from the mosquito and then redirect it to some other external MQTT server.

http://www.steves-internet-guide.com/mosquitto-bridge-configuration/

I would suggest you use an actual database though. MQTT is not intended for long term data storage.