/config/lua/script/tariff

The Lua script used to calculate energy cost. This script can be modified only if server-storage variable global/billing/tariff_uri is empty or unset.

If loading this script takes longer than 15 seconds or evaluating the register formulas takes longer than half the update-interval, an alert is raised.

Get /config/lua/script/tariff

SecurityApiKey
Responses
200

Normal response.

401

Unauthorized response.

get/config/lua/script/tariff
Request samples
Response samples
application/json
{
  • "result": "print(\"this is the tariff script\");",
  • "error": "Error message (present if an error occurred)."
}

Replace /config/lua/script/tariff

SecurityApiKey
Request
Request Body schema: application/json
string (configLuaScriptTariff)

The Lua script used to calculate energy cost. This script can be modified only if server-storage variable global/billing/tariff_uri is empty or unset.

If loading this script takes longer than 15 seconds or evaluating the register formulas takes longer than half the update-interval, an alert is raised.

Responses
200

Normal response.

401

Unauthorized response.

put/config/lua/script/tariff
Request samples
application/json
"print(\"this is the tariff script\");"
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}

Update /config/lua/script/tariff

SecurityApiKey
Request
Request Body schema: application/json
string (configLuaScriptTariff)

The Lua script used to calculate energy cost. This script can be modified only if server-storage variable global/billing/tariff_uri is empty or unset.

If loading this script takes longer than 15 seconds or evaluating the register formulas takes longer than half the update-interval, an alert is raised.

Responses
200

Normal response.

401

Unauthorized response.

post/config/lua/script/tariff
Request samples
application/json
"print(\"this is the tariff script\");"
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}

Delete /config/lua/script/tariff

Reset to empty string.

SecurityApiKey
Responses
200

Normal response.

401

Unauthorized response.

delete/config/lua/script/tariff
Request samples
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}