Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ We support the following event types on a webhook subscription:
- `appliance/offline`: An appliance's state switched offline.
- `appliance/online`: An appliance's state switched online.
- `appliance/upate`: An appliance has been update.
- `ev/charge-failed`: Charging has failed for an electric vehicle.
- `ev/charge-started`: Charging has started for an electric vehicle.
- `ev/charge-stopped`: Charging has stopped for an electric vehicle.
- `ev/control` (**deprecated**)
Expand Down
63 changes: 62 additions & 1 deletion openapi/webhook-events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ components:
- $ref: '#/components/schemas/EVMeasurementEvent'
- $ref: '#/components/schemas/EVPluggedEvent'
- $ref: '#/components/schemas/EVChargeSessionEvent'
- $ref: '#/components/schemas/EVChargeSessionFailedEvent'
- $ref: '#/components/schemas/GatewayEvent'
- $ref: '#/components/schemas/GSP14aSignalEvent'
- $ref: '#/components/schemas/InverterEvent'
Expand All @@ -126,6 +127,7 @@ components:
appliance/offline: '#/components/schemas/ApplianceEvent'
appliance/online: '#/components/schemas/ApplianceEvent'
appliance/update: '#/components/schemas/ApplianceEvent'
ev/charge-failed: '#/components/schemas/EVChargeSessionFailedEvent'
ev/charge-started: '#/components/schemas/EVChargeSessionEvent'
ev/charge-stopped: '#/components/schemas/EVChargeSessionEvent'
ev/control: '#/components/schemas/EVControlEvent'
Expand Down Expand Up @@ -288,7 +290,66 @@ components:
enum:
- CHARGING
- STOPPED
- FAILED
description: ChargeState defines whether the vehicle is charging
EVChargeSessionFailedEvent:
# See https://github.com/grid-x/cloud-connector/blob/main/docs/api/openapi.yaml
allOf:
- $ref: '#/components/schemas/WebhookEventBase'
- properties:
type:
type: string
enum:
- ev/charge-failed
data:
$ref: '#/components/schemas/EVChargeSessionFailedEventData'
EVChargeSessionFailedEventData:
# See https://github.com/grid-x/cloud-connector/blob/main/docs/api/openapi.yaml
allOf:
- $ref: '#/components/schemas/EVEventDataBase'
- $ref: '#/components/schemas/EVStateChangeEventData'
- required:
- state
properties:
state:
description: ChargeState defines whether the vehicle is charging
type: string
enum:
- FAILED
atHome:
description: |-
atHome specifies if the vehicle is currently at the users home location and is used
to make decisions on whether to control charging behaviour
type: boolean
failureReason:
$ref: '#/components/schemas/EVChargeSessionFailureReason'
EVChargeSessionFailureReason:
type: object
properties:
type:
type: string
enum:
- NO_RESPONSE
- FAILED_PRECONDITION
- CONFLICT
- NOT_FOUND
- REQUESTED_CANCELLATION
description: |-
A machine-readable high level error category.

NO_RESPONSE: The chargeable device did not react to our charge commands within the command's timeout window.
FAILED_PRECONDITION: The chargeable device did not meet all required preconditions for this command to be executed during the command's timeout window.
CONFLICT: A newer command for this chargeable has been created. This command is now abandoned.
NOT_FOUND: The chargeable was deleted while the command was PENDING
REQUESTED_CANCELLATION: This command was cancelled by request of the controlling owner.
detail:
type: string
description: A human-readable explanation of why the charging command was unsuccessful.
required:
- type
- detail
description: Reason why a given command has failed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this newline can be omitted :-)

EVControlEvent:
allOf:
- $ref: '#/components/schemas/WebhookEventBase'
Expand Down Expand Up @@ -534,7 +595,7 @@ components:
title: Inverter status event
description: |-
Payload for `inverter/*` events.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

The event describes the change of an inverter from one status to a new one. The old status is referred to as the
lastStatus.
required:
Expand Down