User Tools

Site Tools


functions_to_manage_energy_resources_consumption

This is an old revision of the document!


Manage energy and other resources consumption

GetMeterConsumption(variable_name[, connection_name])

The GetMeterConsumption function returns the resource consumption for the specified counter. Parameters variable_name and connection_name work in the same way as in the function GetReg - they determine the register with the resource counter. Since version 3.2 there is no more connection_name parameter.

Returned consumption of resources is the consumption of the meter for each hour from the beginning of the month to the current moment. Data is taken from Level2 times per hour. Why not from the local database? Because a) the data storage period on the SD card can be less than 1 month and b) because the SD card may fail and if it is replaced in the middle of the month, the data will be unreliable.

The service requires an Internet connection, an account in Level2, and an active data storage service. The function is available since version 2.9.

If for some reason the data has not been received, the value nil will be returned.

GetResourceLimit(resource_name)

The GetResourceLimit function returns the limit of the specified resource for the current month. Limits are set in the Level2 system.

Possible resources names are: “ELECTRICITY”, “GAS”, “HEAT”, “WATER”, “HOTWATER”, “CUSTOM”

Data is taken from Level2. Data on WebHMI is usually updated no later than 1 hour after they are updated in Level2. If there is no connection, the system will return the limits from the cache. The cache stores the limits for the current and the next two months.

The service requires an Internet connection, an account in Level2. The function is available since version 2.9.

If for some reason the data has not been received, the value nil will be returned.

GetTodayDayType()

The GetTodayDayType function returns the type of the current day: work, weekend, holiday. The types of days are set in the Level2 system.

Three types are valid: “Working”, “Weekend”, “Holiday”.

Data is taken from Level2. Data on WebHMI is usually updated no later than 1 hour after they are updated in Level2. If there is no connection, the system will return the limits from the cache. The cache stores the limits for the current and the next two months.

The service requires an Internet connection, an account in Level2. The function is available since version 2.9.

If for some reason the data has not been received, the value nil will be returned.

GetTomorrowDayType()

The GetTomorrowDayType function is completely analogous to GetTodayDayType with the only difference that it returns data about the future.

GetHolidaysStats()

GetHolidaysStats returns a table with the following fields:

  • currentMonthDays – number of days in the current month
  • nextMonthDays - number of days in the next month
  • currentMonthWeekends - the number of dayoffs (according to the settings in the Level2 system) in the current month
  • nextMonthWeekends - the number of dayoffs (according to the settings in the Level2 system) in the next month
  • currentMonthHolidays - number of holidays (according to the settings in the Level2 system) in the current month
  • nextMonthHolidays - number of holidays (according to the settings in the Level2 system) in the next month

Data is taken from Level2. Data on WebHMI is usually updated no later than 1 hour after they are updated in Level2. If there is no connection, the system will return the limits from the cache. The cache stores the limits for the current and the next two months.

The service requires an Internet connection, an account in Level2. The function is available since version 2.9.

If for some reason the data has not been received, the value nil will be returned.

functions_to_manage_energy_resources_consumption.1547116895.txt.gz · Last modified: 2019/01/10 10:41 by akuzmuk

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki