One of the killer feature of Thinger is the ability to fetch data from the device only when someone is displaying the dashboard, instead of having the device pushing permanently the data to MQTT even if no one looks at it.
That can really help to reduce the amount of data transmitted, which is the major power hog on a WiFi device.
So setting dashboard widgets to refreshing mode “sampling interval” only triggers a transmission if someone is watching at the dashboard.
For slower data, and data that must be plotted permanently in the background, feeding buckets with thing.write_bucket() is imho the way to go.
Update from thing.stream() at a fast pace is only efficient if the corresponding dashboard is permanently observed ( control room).
I would love to read your remarks about that topic.
You may set the refreshing mode to “stream by device” and then add a button on your dashboard to trigger the streaming. So data will be sent to the server only when you click the button… However, I think keeping the connection consumes almost the same power as both keeping the connection and sending data.
As I understood Alvaro, the sampling interval is the most effective.
The website calls for an update only when the dashboard is running.
The update requests are then processed by thing.handle(); else it does nothing.
Hi! good topic here
The stream
method will not send data if there is nothing listeing for it (i.e., a dashboard, a bucket…). So, if time series is not required for this resource, the most efficient will be to stream the state changes via the stream
method. So, it does not send periodically the same state (if it is a discrete state, i.e, on/off/charging…). If the state changes quite frequently, i.e., it is variable with decimals, a noisy sensor, etc., it can be worth to implement a stream based on difference with previous transmitted state to filter non-significant changes.
This could be verified by the device’s page, if you open a dashboard that will receive the streaming, at the device’s page you will see how it is sending data, by the “live transmision” graphic, if you close the dashboard, the live transmision graphic does not report the constant trafic from the device.
…will not send data if there is nothing listening…
How does the device know if a dashboard is listening for a given pson?
Have we users a method to know if the pson is live or not and adapt the processing accordingly?
Does this happen upon a subscription for every PSON with an expiry time, or is it a handshake running each time thing.handle(); is executed?
For a bucket it is clear: it is always listening, but for a dashboard?
How can i prevent also the dashboards in dormant tabs of the browser to “fast-replay” the data once returning to the foreground. That is surely a huge waste of bandwidth.
I am just trying to reduce the quantity of transmitted data to fit into a smaller data plan.
Thank you for your advice.