I am currently trying to make my dashboard snappier and save transmission data at the same time.
Some of my data are calculated from user inputs and will only change when a new user input happens.
I think that it is inefficient to show these data n a polled process.
My idea is to group the few user-related data into a PSON structure:
thing[“control”] >> [](pson & out)
{
out[“bat_CV”] = dashboard.CVbat;
out[“bat_CC”] = dashboard.CCbat;
//…
};
…and then start a thing.stream(“control”);
when variables are changed and only then.
The display in the dashboard should be set on “Stream by device”
thing["scv"] = [](pson & in, pson & out)
{
if (in.is_empty())
{
in = CVbat;
} else {
CVbat = in;
}
dashboard.CVbat = float(in) / 1000;
thing.stream("control");
out["batCV"] = dashboard.CVbat;
};
That way to user data is just uploaded to Thinger when the user interacts.
But that did not work.
Isn’t that doable?
Which mistake did I do, that it does not update the data in the dashboard?
Thank you for your advice.
Laszlo