Problem: When trying to use the Resample expression, no data is returned (removing this expression shows data is being pulled through without it)
Scenario: I have a number of smart plugs reporting power usage data and am trying to get the sum total of all values at any given time (trying to do this using a stacked graph). The challenge is that these devices provide updates values as they change (as well as a soft poll every minute) and therefore, to the best of my understanding, the data points don’t stack due to the time differance. I’ve included a simple example of the dataset below:
| Time | DeviceName | GroupName | PowerDraw | |-------------------------|------------|-----------|-----------| | 2021-03-16 10:41:29:548 | Plug1 | Room1 | 42 | | 2021-03-16 10:41:30:210 | Plug2 | Room1 | 8 | | 2021-03-16 10:41:50:012 | Plug2 | Room1 | 10 | | 2021-03-16 10:41:58:223 | Plug1 | Room1 | 35 | | 2021-03-16 10:45:21:321 | Plug1 | Room1 | 40 |
Looking at the recently added Resample Expressions tool, it looks like this should do what I need by automatically sampling each device once for every timestamp and then fill in the gaps (specifically pad it using the last-known value as that would still be correct if no new value was received).
Below is the config without the expression:
Below is the config with the expression:
Am I doing something wrong or is this a bug of the new feature? If the latter, is there some other way I should be approaching this issue?