Charger Command Validation Update
Endpoint Affected:
charger_sendcommand:POST /api/chargers/{id}/sendCommand/{commandId}
Zaptec has updated the sendCommand
endpoint to prevent commands that would result in no operational change. Commands are now rejected if the charger is in a state where the command would have no effect.
This change enhances API efficiency, reduces unnecessary operations, and aligns with best practices for charger state validation.
Impacted Command IDs
Command ID | Description | Now Rejected If... |
---|---|---|
506 | Pause/Stop Charging | Charger is already paused (710 = 5 and 718 = 1 ), or disconnected (710 = 1 ) |
507 | Resume Charging | Charger is not paused, or a scheduler is active (763 is set) |
This change affects only commands where charger state makes the action redundant. Commands 102 (restart) and 200 (firmware upgrade) and 10001 (Deauthorize and Stop)remain unaffected.
Required Integration Changes
1. Validate Charger State Before Sending Commands
To avoid rejections, integrators are required to check the charger state before sending a command. You have two implementation options:
a. (Recommended) : Track Charger State via Zaptec Service Bus
Use Zaptec Service Bus to subscribe to real-time state changes. This real-time stream allows your system to maintain an up-to-date view of:
ChargeOperationMode (710)
FinalStopActive (718)
NextScheduleEvent (763)
Benefits:
- Reduces API traffic
- Improves responsiveness
- Enables event-driven logic
b. Poll Charger State via API
GET /chargers API Endpoint: GET /chargers/{id}/state
to read the current state:
ChargeOperationMode (710)
FinalStopActive (718)
NextScheduleEvent (763)
- Firmware version (for commands 506/507 on PRO chargers)
2. Handle Rejections Gracefully
Rejections are returned immediately with appropriate HTTP error codes (typically 528
). Do not retry commands unless the charger's state has changed.
3. Update Client Logic
Prevent sending commands that do not match the required state preconditions. This reduces API errors and improves overall system stability.
Next Steps
- Review your integration logic for charger command handling
- Ensure state checks are performed before issuing commands
- Monitor for
sendCommand
rejections and log failure reasons for future debugging
For further details, see the Zaptec API Reference.