Optimistic mode

I would like to hear some clarification of optimistic mode.
This is how I understand how it should work:

optimistic mode enabled:

  1. request state change
  2. update state on FrontEnd

optimistic mode disabled:

  1. request state change
  2. automatically retrieve state
  3. update state on FrontEnd

Unfortunatelly, it seems that with Z2M 2.21.2, when optimistic mode disabled, automatic retrival od device state is not going to happen. I have to press image button (in Z2M GUI, Exposes device tab)

Z2M debug logs confirms my assumption. In non-optimistic mode, setting state doesn’t cause getting current state from device.

I think it could be bug, but want to ask if you experiencing the same.


I confirm that you saw on your side. I’ve remove optimistic mode on one HUE bulb and switch on it on home assistant browser tab while look at Zigbee2mqtt device Expose on another TAB:

  • switch on was not set on both homeassistant and expose tab until I refresh Expose tab.
    I did it on 2 different brand plug switch too:
  • one get the feedback display on both homeassistant/expose
  • one didn’t get the feedback as HUE bulb

When the feedback doesn’t work I can see that event appears only once I refresh the Expose tab.
I think it’s a bug and it’s really strange to me that frontend is involved…

Yeah, exactly. This is how HA reacts in turn on Z2M.
I didn’t want to describe HA behaviour to not make things even more confusing. This is why I limited my findings to Z2M GUI

Seems I have to report this issue on GitHub

edit: Disabled Optimistic doesn't refresh state at all · Issue #9367 · Koenkk/zigbee2mqtt · GitHub