Data history in a custom widget

Hello,

I want to create a custom widget to display a chart with accumulated historical energy data. Therefore, my question is how to send not only the most recent data value to my custom widget but also the values from today, last week, or last month. I already had a look at these sites, but I did not find a suitable solution there.

Custom Widget (tago.io)

Custom Widget (iFrame) (tago.io)

I attached a picture of my current custom widget. The idea is that when you click one of the buttons, the chart shows the summarized data, e.g., for a day with 6 bars, where each bar represents a time interval of 4 hours. I hope you understand what my idea is, and I’m looking forward to your suggestions.

Thanks in advance.

Tammo Post

Hello Julian.

In the Custom Widget settings, you can set how many registers get per variable. See the image below:

If you use TagoIO’s Toolkit for creating a custom widget, you can take this data object by the method `window.TagoIO.onRealtime`. This method invokes a function every time the widget receives new data. Once you have access to this data object you can filter the results by the specific time range when clicking on a button.

Another option would be to use the TagoIO SDK, get the device’s data directly and apply the filters when the button is clicked.

If you are familiar with React, take a look at this boilerplate to give you some insights.

I hope this helps you.