SmartThings/MQTT sensor initialization after reboot

Hi everyone, can you help me discover what I’ve overlooked?

I am running HA on a Raspberry Pi 3. I am also running SmartThings, mosquitto, and the StJohnJohnson MQTT bridge. For the most part everything works well, but when I reboot my Pi one or more of my SmartThings sensors initializes in an unknown state. Sometimes one sensor does this, sometimes more than one. This only happens when I reboot, not when I merely restart HA. When this happens:

  • SmartThings always is aware of the correct state of the sensor(s)
  • state.json from the MQTT bridge also always knows the correct state
  • if I manually simulate a state change (mosquitto_pub -t “smartthings/reluctantsensor/contact” -m “closed”) then HA picks up on the change and properly displays the state until the next RPi reboot
  • Similarly, if I manually operate the sensor itself, HA picks up the state change all is well until the next RPi reboot

So I assume that HA is waiting for a state update message from SmartThings that, of course, doesn’t happen until an actual state change occurs at the sensor (or I simulate one).

Am I missing something, or did I forget to configure something properly?