Bottesford Posted November 15, 2017 at 12:27 PM Share Posted November 15, 2017 at 12:27 PM I'm using a number of different sensors and am finding some of them are reporting a lot of value changes. This is especially true of my humidity, air pressure and ambient light (v1) sensors. When combined with the MQTT proxy this is leading to a lot of data traffic - multiple times per second per sensor kind of thing. For air pressure the changes are usually around 0.01 mbar which I don't care about. Is it possible to only fire the callback when a rounded 0.1 (or whatever I choose) difference is seen? I don't want it to only callback when a value change is > 0.1 but instead when the 1st number after the decimal point changes. So if I see this: 1010.335 rounds to 1010.3 no callback 1010.348 rounds to 1010.3 no callback 1010.389 <-- rounds to 1010.4 to fire callback here. The humidity sensor is worse as it varies over 1% very frequently (see attachment). So far I've been moderating the data flow in my application but this doesn't solve the network traffic to the MQTT broker being very high. I feel that I should plug this before it hits the mqtt broker service but am open to suggestions! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.