I have small problem with MQTT devices. It seems like my hub is killing the driver after couple of days, as there’s nothing when I’m checking logs. I suspect this has something to do with sheer amount of events the driver is processing.
I have 5 RuuviTag sensors and I collect data from those with rpi4 and publish to Mosquitto running on same rpi every 5 seconds. As the tags have multiple sensors, I have separate humidity and temperature mqtt device for each tag. The sensors are ble beacons and sends data every second. To throttle it a bit, there was mode for ready-made collector which reduces it to once per 5 second. So, 10 events every 5 seconds.
I have couple of other mqtt devices as well (like switch, which gets info from Sleep As Android if I’m sleeping or not, which is used as a state info during the night (like when visiting bathroom, PIR sensor turns on one light with minimum brightness for a short time instead of normal dark time light scene for a significantly longer time)) and those won’t get updated either. Mosquitto and collector works fine as rebooting my hub (v3) fixes the problem for a couple of days.
I’d like to use the other mode of the collector, which pushes each event from sensors to MQTT and route it to grafana as well, as one sensor especially is in a place from which I’d like to get temperature and humidity to ST with one minute resolution (or 5), and acceleration data (IMU, axes are separated) to grafana with one second resolution.
So, would it be possible to throttle the data processing somehow in the driver? Either global or device level, something like “process only one event per device per x amount of time and ignore/drop the rest”, or do I need to figure out how to do that in the collector by using multiple topics for same data with different update cycles? I think I should be able to pull that off as the collector is written in python, but I thought this might be beneficial feature for others as well.
Also as a side note, device, which could receive all data (temperature, humidity, air pressure, acceleration with x, y and z separated, and battery voltage) from RuuviTags as JSON dict would be awesome! I want to thank you otherwise as well, your work is enabling me to do more with automations.