Device shadow visualization not updating after reported state changes from edge devices

The device shadow visualization panel in IoT Operations Dashboard (iod-23) isn’t reflecting state changes reported by our edge devices. When devices update their reported state via MQTT, the shadow document updates correctly in the backend (I can verify this via API queries), but the visualization panel continues showing stale data.

Our edge devices publish state updates like this:

shadowClient.update({
  state: {reported: {temperature: 22.5, status: 'active'}}
});

The backend shadow service acknowledges these updates, but the dashboard visualization doesn’t refresh unless I manually reload the page. I suspect the issue is with device shadow event handling or the push vs polling update mechanism. The dashboard real-time sync doesn’t seem to be working for shadow state changes. Is there a configuration setting to enable real-time shadow visualization updates in iod-23?

The device shadow panel uses polling by default in iod-23, not push notifications. You need to enable the real-time event stream for shadow updates. Check your dashboard configuration for the ‘shadowUpdateMode’ setting.

Complete solution addressing all focus areas:

Device Shadow Event Handling: The visualization panel needs proper event subscription configuration. Edit your dashboard configuration file (usually dashboard-config.json) and add:

"deviceShadow": {
  "eventHandling": {
    "enabled": true,
    "topics": [
      "$aws/things/+/shadow/update/accepted",
      "$aws/things/+/shadow/update/delta"
    ]
  }
}

The panel must subscribe to both ‘accepted’ (for reported state confirmations) and ‘delta’ (for state differences) topics. Without these subscriptions, the dashboard doesn’t receive real-time shadow update notifications.

Push vs Polling Updates: The default polling mode is insufficient for real-time visualization. Switch to push-based updates:

"deviceShadow": {
  "updateMode": "push",
  "fallbackPollInterval": 60000,
  "reconnectStrategy": "exponential"
}

Set updateMode to ‘push’ to enable event-driven updates. Keep fallbackPollInterval as a backup mechanism in case the event stream disconnects. The exponential reconnect strategy prevents connection storms if the MQTT broker has issues.

Polling mode (the default) explains why you see updates only after manual page reload - the panel polls every 30 seconds, and if you reload before the next poll cycle, you see stale data.

Dashboard Real-Time Sync: The broader issue is dashboard initialization and event stream lifecycle management. Ensure the shadow visualization panel initializes its event subscriptions AFTER the MQTT connection is established:

// In dashboard initialization code
await mqttClient.connect();
await shadowPanel.subscribeToEvents();

In iod-23, there’s a race condition where panels may initialize before MQTT connects, causing subscription setup to fail silently. The panel then falls back to polling mode without notification.

Implement connection state monitoring:

mqttClient.on('disconnect', () => {
  shadowPanel.pauseUpdates();
});
mqttClient.on('connect', () => {
  shadowPanel.resubscribeAndRefresh();
});

This ensures the panel resubscribes to shadow events after connection interruptions, maintaining real-time sync.

Additional considerations:

  1. Event Filtering: If you have many devices, subscribe to specific device shadow topics rather than wildcard patterns to reduce event volume

  2. State Reconciliation: Implement periodic reconciliation (every 5 minutes) to catch any missed events - fetch full shadow state and compare with visualization

  3. Delta Generation: Verify your shadow service configuration generates deltas correctly. Some configurations require explicit ‘desired’ state to generate deltas. If you only update ‘reported’ without ‘desired’, no delta is generated.

After implementing these changes, test by updating device shadow state and verifying the visualization panel updates within 1-2 seconds without page reload. Monitor the browser console for shadow update events to confirm subscriptions are working.

No, you don’t publish deltas manually - the shadow service generates them automatically when reported state differs from desired state. But the dashboard needs to subscribe to the delta topic to receive those events. Check if your dashboard MQTT client is subscribed to ‘$aws/things/+/shadow/update/delta’ or equivalent topic pattern for your platform.