// Todo: info text
syntax = "proto3";
package MonalysePlugin;
option csharp_namespace = "EnergyDataLibrary.MonalysePlugin.protobuf";
option java_outer_classname = "MonalysePlugin";
//************************ General definitions *********************************
message DateTime {
double days = 1; // Origin: Midnight, 30 Dec 1899, always UTC
}
message ProtoError {
int32 error_code = 1; // Error code, 0 is success
string error_message = 2; // Error message
string error_more_info = 3; // Optional link to more info
}
//************************ Service discovery ***********************************
message Plugins {
int32 error_code = 1; // Error code, 0 is success
string error_message = 2; // Error message
string error_more_info = 3; // Optional link to more info
repeated PluginInfo plugin_infos = 4; // List of PluginInfo
}
message PluginInfo {
string name = 1; // Plugin name
string info_text = 2; // Human readable info
}
//************************ Execute plugin **************************************
enum PluginInputType
{
Textbox = 0;
Meterlist = 1;
}
enum Units
{
Any = 0;
Energy = 1;
Temperature = 2;
Percent = 3;
Boolean = 4;
}
message PluginInput
{
string id = 1; // e.g. Heat group has id "HG" -> first meter will be HG1, then HG2, etc.
PluginInputType plugin_input_type = 2;
bool is_optional = 3;
string label = 4;
uint32 max_input = 5;
uint32 min_input = 6;
Units allowed_units = 7; // filters on the ui will apply based on this setting
}
message PluginDefinition
{
int32 error_code = 1; // Error code, 0 is success
string error_message = 2; // Error message
string error_more_info = 3; // Optional link to more info
string name = 4;
string description = 5;
repeated PluginInput plugin_inputs = 6;
string function_block = 7; // Name of function block
}
//************************ Run plugin ******************************************
//** Request **//
message Request {
repeated TimeSeries metervalues = 1;
repeated UserValue uservalues = 2;
}
message TimeSeries
{
string input_id = 1; // id from PluginInput (e.g. HG1)
optional string unit = 2; // even if in Units "Energy" was defined, we have to know if it is kWh / MWh
optional int32 period = 3; // the period defined in Monalyse (e.g. 15, 5, 60)
repeated TimeSeriesRow rows = 4;
}
message TimeSeriesRow
{
DateTime datetime = 1;
double value = 2; // contains double.nan if gaps exist
optional double rawvalue = 3; // contains double.nan if gaps exist or meter is a virtual meter
}
message UserValue {
string input_id = 1; // id from PluginInput (e.g. THRESHOLD_WHATEVER)
string value = 2;
}
//** Result **//
message Alerts
{
int32 error_code = 1; // Error code, 0 is success
string error_message = 2; // Error message
string error_more_info = 3; // Optional link to more info
repeated Alert alerts = 4;
}
message Alert
{
AlertType alert_type = 1;
DateTime datetime = 2;
string message = 3;
}
enum AlertType
{
Information = 0;
Warning = 1;
Error = 2;
}
//************************ Schedule ********************************************
enum TimePeriod {
Day = 0;
Week = 1;
Month = 2;
Year = 3;
}
// This object describes the schedule of the calculation done by the plugin.
message PluginSchedule
{
TimePeriod recurrence = 1; // How often to schedule
TimePeriod data_range = 2; // The TimePeriod to use as unit to get the range to calculate
int32 data_range_count = 3; // How many of TimePeriods defined in DateRange back to calculate
}