This article explains how to configure widgets to retrieve data from one or more sites during opening or closing periods.
TABLE OF CONTENTS
Functionality of the Formulas
The site calendar function allows you to define opening and closing hours for your sites. Once these time slots are set, the OPEN & CLOSE functions will enable you to filter data retrieval in widgets to include only data with timestamps that correspond to these time slots.
Note that only sensor data with a sub-daily time interval can be considered. Within the specified time slot, data from the last hour is included. For example, if a site is open from 9 a.m. to 5 p.m., data with a timestamp at 5 p.m. will be included in the calculation if the data is retrieved for the opening period.
These two functions (OPEN & CLOSE) can only be used in conjunction with other formulas. If you use them in a widget, the minimum aggregation time interval will be daily.
Filtering Sensor Data
The OPEN & CLOSE functions can only be used with the SENSOR BY LABEL formulas, which allow you to retrieve your sensor data based on a label.
For example, if I have Enedis sensors that report my site's consumption every 10 minutes, I can use the OPEN function to retrieve this data only during my site's opening hours. The CLOSE function will allow me to view consumption recorded during the site's closing hours.
In my widget formula, I will enter OPEN(+the SENSOR BY LABEL formula of my choice):
Here, my formula OPEN(SUM_SENSOR_LABELS(conso-enedis))
will retrieve all data associated with the label "conso-enedis," keeping only those recorded during the site's opening hours.
If I want to retrieve the average consumption during closing periods, I could use the formula:CLOSE(AVERAGE_SENSOR_LABELS(conso-enedis))
The formula CLOSE(MAX_SENSOR_LABELS(conso-enedis))
will give me the maximum value recorded among all sensors with this label during the site's closing hours.
Find all SENSOR BY LABEL formulas and their functionality in this article.
These functions are available for both single and multi-site configurations.
Counting Opening and Closing Hours
You can also count the number of opening and closing hours for your sites. In this case, the OPEN & CLOSE functions will be used with the NB_HOUR function.
- NB_OPEN_HOUR will give you the number of hours your site was open during the period observed by the widget.
- NB_CLOSED_HOUR will give you the number of hours your site was closed during the period observed by the widget.
With the customization of site hours having a granularity of 15 minutes, you can obtain decimal results, accounting for the number of quarter hours during opening and closing periods.
Find the complete list of available formulas for your widgets here.