Webhook Receivers
are used to get notifications about state changes in gridX/XENON within your app. A webhook receiver is a publicly accessible endpoint on a server that is called by gridX when domain events, e.g., when an appliance goes online, occur. By implementing a webhook receiver, you can react on these events within your custom application. This allows for push based delivery of events as opposed to your app having to pull gridXโs API constantly.
Currently, the following event types being emitted:
appliance/create
: Appliance was createdappliance/offline
: Appliance went offlineappliance/online
: Appliance went onlineinverter/status
: Inverter status has changedgateway/create
: Gateway was createdgateway/offline
: Gateway went offlinegateway/online
: Gateway went onlineev/plugged
: Vehicle was plugged into the charging station, charging state changedcommissioning/done
: Commissioning of a gateway was completed
To make it easy to get started using it, we published some code samples and explanations on GitHub.
If contains the following examples:
- NodeJS/Express: Hand-written webhook receiver that writes the IDs of appliances coming online to the console.
- Go: Server with stubs for all supported event types generated using
openapi-generator
. - Python/aiohttp: Server with stubs for all supported event types generated using
openapi-generator
. For the sample, we print information aboutappliance/online
events. - Go Signature Verification: Example implementation of signature validation in go.
- Reactive Webapp: A webhook receiver that relays events to a React client app through websockets
You might, e.g., build a reactive dashboard for appliances connectivity state based on the information in there.
Curious? Hop over to GitHub and start poking around!