Our field devices frequently go offline due to poor cellular connectivity in remote locations. When they reconnect, the device shadow state doesn’t synchronize properly - the shadow shows stale data from before the disconnect. This causes our automation rules to fire incorrectly because they’re acting on outdated state.
We’re using MQTT for device communication, and the devices typically reconnect within 1-6 hours of going offline. During that time, the cloud-side shadow gets updated by our control system with desired states, but when the device comes back online, these desired states aren’t being applied to the device. The shadow reports show “last updated” timestamps from before the disconnect.
The automation rules misfire because they check shadow state to determine if a device needs configuration updates. With stale shadow data, devices don’t get the updates they need. We’ve verified that the devices are successfully reconnecting and can receive messages, but the shadow sync just doesn’t happen. Is there a configuration for MQTT persistent sessions or retained messages that we’re missing?