Stream live updates
Keep a screen live without polling: one stream per project says the moment a charger, a session or a meter reading changes.
On this page
Open one stream per project and Flowion tells you the moment something changes: a charger comes online, an outlet becomes occupied, a session starts, new meter readings land. Your screen stays live without polling, and without spending your rate limit on guesses.
event: chargingStationConnected
data: {"type":"chargingStationConnected","chargingStationId":"4b1e…"}
-N turns off curl's buffering, so frames show up as they arrive. The stream uses Server-Sent Events: each frame's event: line is its type, and data: is one JSON object with the same type inside.
Refetch what changed
An event names what changed, not the new value. Use its ids to refetch the matching resource — the session, the charger, the outlet — over the API.
Events are delivered best effort, so treat the stream as a reminder rather than a record:
Connect, then load the current state of whatever you show.
On each event, refetch what it names.
After every reconnect, load the current state again.
What arrives
Every event carries chargingStationId. The rest depends on the type; a field that does not apply is left out, never sent as null.
type | Also carries | Means |
|---|---|---|
chargingStationConnected | — | The charger came online |
chargingStationDisconnected | — | The charger went offline |
connectorStatusChanged | connectorId, status | A connector changed state: Available, Occupied, Reserved, Unavailable or Faulted |
transactionStarted | connectorId, transactionId | A session began |
transactionUpdated | connectorId, transactionId | A session's readings or state changed |
transactionEnded | connectorId, transactionId | A session finished |
meterValuesUpdated | evseId | New meter readings for an outlet. Several readings close together arrive as one event |
commandStatusChanged | commandId | A command you sent moved to a new status |
Read it from a browser
The stream needs the same Authorization header as every other call. A browser's built-in EventSource cannot send one, so read the stream with fetch and split the body into frames yourself, or open the stream on your server and pass the events on.
Stay connected
It closes after 30 minutes. Reconnect, and load the current state again as you do.
It stays open when quiet. A comment line arrives as soon as you connect and every 15 seconds after, so proxies do not drop an idle connection. Ignore lines that start with
:.Access is checked again every 2 minutes. If the caller loses access to the project — removed from it, or its API key revoked — the stream sends one last frame and closes:
event: revoked
data: {"reason":"accessRevoked"}
reason is accessRevoked, or tokenExpired when the token that opened the stream has expired. For tokenExpired, reconnect with a fresh token. For accessRevoked, reconnecting is refused until access is restored.