ocpp/v2_0_1/datatype/event_data

OCPP 2.0.1 EventData data type (schema EventDataType).

to_json/decoder map to/from its OCPP-J JSON object; new (when present) builds a value from the required fields only.

Types

Class to report an event notification for a component-variable.

FieldTypeReqDescription
actual_valueStringActual value (attributeType Actual) of the variable. The Configuration Variable ReportingValueSize can be used to limit GetVariableResult.attributeValue, VariableAttribute.value and EventData.actualValue. The max size of these values will always remain equal. (max 2500 chars)
causeIntRefers to the Id of an event that is considered to be the cause for this event.
clearedBoolCleared is set to true to report the clearing of a monitored situation, i.e. a ‘return to normal’.
componentComponent
custom_dataCustomData
event_idIntIdentifies the event. This field can be referred to as a cause by other events.
event_notification_typeEventNotification
tech_codeStringTechnical (error) code as reported by component. (max 50 chars)
tech_infoStringTechnical detail information as reported by component. (max 500 chars)
timestampDateTimeTimestamp of the moment the report was generated.
transaction_idStringIf an event notification is linked to a specific transaction, this field can be used to specify its transactionId. (max 36 chars)
triggerEventTrigger
variableVariable
variable_monitoring_idIntIdentifies the VariableMonitoring which triggered the event.

Schema: EventDataType

pub type EventData {
  EventData(
    actual_value: String,
    cause: option.Option(Int),
    cleared: option.Option(Bool),
    component: component.Component,
    custom_data: option.Option(custom_data.CustomData),
    event_id: Int,
    event_notification_type: event_notification.EventNotification,
    tech_code: option.Option(String),
    tech_info: option.Option(String),
    timestamp: timestamp.Timestamp,
    transaction_id: option.Option(String),
    trigger: event_trigger.EventTrigger,
    variable: variable.Variable,
    variable_monitoring_id: option.Option(Int),
  )
}

Constructors

Values

pub fn decoder() -> decode.Decoder(EventData)

Decode a EventData from its OCPP-J JSON object, enforcing schema constraints.

pub fn new(
  actual_value actual_value: String,
  component component: component.Component,
  event_id event_id: Int,
  event_notification_type event_notification_type: event_notification.EventNotification,
  timestamp timestamp: timestamp.Timestamp,
  trigger trigger: event_trigger.EventTrigger,
  variable variable: variable.Variable,
) -> EventData

Construct a EventData from its required fields, with every optional field set to None.

pub fn to_json(value: EventData) -> json.Json

Encode a EventData to its OCPP-J JSON object.

Search Document