Skip to content

Add example to documentation of "payload" field #115

Open
@stefan-brus-frequenz

Description

@stefan-brus-frequenz

What's needed?

The "payload" field could use some clarification as to what it's for.

Proposed solution

Proposed documentation example:

// Message representing one dispatch.
//
// Timezone Note: Timestamps are in UTC. It is the responsibility of each microgrid to translate UTC
// to its local timezone.
message Dispatch {
  // ... [other fields] ...

  // The dispatch payload
  // This field is used to carry additional, user-defined data relevant to the dispatch.
  //
  // The payload typically contains a JSON object with settings that dictate how the dispatch should be processed.
  // This provides the flexibility to include a variety of dispatch parameters without altering the API structure.
  //
  // The payload is expected to follow a specific format that the downstream applications consuming the dispatch API
  // are responsible for understanding and processing.
  //
  // Example JSON payload:
  // {
  //   "settings": {
  //     "power_max": 10,   // Maximum power level for the dispatch (in kW)
  //     "soc_min": 20,     // Minimum state of charge for battery storage (in %)
  //     "soc_max": 80      // Maximum state of charge for battery storage (in %)
  //   }
  // }
  //
  // In this example, a microgrid could use this payload to set operational parameters such as the maximum power output
  // of a solar PV array or the charge/discharge limits of a battery storage system. This flexibility allows the microgrid
  // to dynamically adjust its behavior based on the current needs or conditions, such as optimizing battery usage or
  // limiting PV output during low demand periods.
  google.protobuf.Struct payload = 11;

  // ... [other fields] ...
}

Use cases

No response

Alternatives and workarounds

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    part:docsAffects the documentationpriority:lowThis should be addressed only if there is nothing else on the tabletype:enhancementNew feature or enhancement visitble to users

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions