Skip to main content

Overview

Sends all currently stored state objects for a device to any active subscribe connections. This is useful for testing, debugging, or forcing an immediate state refresh on the thermostat without waiting for the normal subscribe cycle.

Endpoint

POST http://your-server:8082/notify-device

Request

{
  "serial": "02AB01AC012345678"
}
FieldTypeRequiredDescription
serialstringYesDevice serial number

Response

Success (200 OK)

{
  "success": true,
  "subscribers_notified": 1
}
FieldTypeDescription
successbooleanAlways true on success
subscribers_notifiednumberNumber of active subscribe connections that received the push
A subscribers_notified of 0 means the device has no active subscribe connections at this moment (it may be sleeping or disconnected).

Error (400 Bad Request)

{"error": "Serial required"}

Error (404 Not Found)

{"error": "Device not found"}

When to Use

  • Debugging: Force an immediate state push to see if the device picks up server-side changes
  • Testing: Trigger a state delivery without modifying any values
  • Recovery: If a device seems stuck, this may help it re-sync
Normal thermostat control (via /command) automatically notifies subscribers. You only need to call this endpoint for explicit manual pushes.

Example

curl -X POST http://your-server:8082/notify-device \
  -H "Content-Type: application/json" \
  -d '{"serial": "02AB01AC012345678"}'

POST /command

Send a command (automatically notifies)

GET /api/events

Subscribe to state change events