Upgrading from 4.3.10 to 5.2.0 causes flood of mqtt events to fire

I tried to upgrade directly from 4.3.10 to 5.2.0 via openhabian. After upgrading I noticed a flood of mqtt events in the log:

2026-07-31 15:46:52.167 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Geyser_OnOff_Switch' received command ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:4db0ac2aba:Geyser>
2026-07-31 15:46:52.227 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sit>
2026-07-31 15:46:52.245 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SitkamerLig2_SitkamerLig2_Skakelaar' changed from ON to OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797f>
2026-07-31 15:46:52.290 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sit>
2026-07-31 15:46:52.350 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sit>
2026-07-31 15:46:52.361 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Geyser_OnOff_Switch' received command ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:4db0ac2aba:Geyser>
2026-07-31 15:46:52.368 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sitk>
2026-07-31 15:46:52.378 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SitkamerLig2_SitkamerLig2_Skakelaar' changed from OFF to ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797f>
2026-07-31 15:46:52.436 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sit>
2026-07-31 15:46:52.439 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SitkamerLig2_SitkamerLig2_Skakelaar' changed from ON to OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797f>
2026-07-31 15:46:52.451 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sit>
2026-07-31 15:46:52.510 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Geyser_OnOff_Switch' received command ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:4db0ac2aba:Geyser>
2026-07-31 15:46:52.562 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sit>
2026-07-31 15:46:52.565 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sitk>
2026-07-31 15:46:52.577 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SitkamerLig2_SitkamerLig2_Skakelaar' changed from OFF to ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797f>
2026-07-31 15:46:52.634 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Geyser_OnOff_Switch' received command ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:4db0ac2aba:Geyser>
2026-07-31 15:46:52.716 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Geyser_OnOff_Switch' received command ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:4db0ac2aba:Geyser>
2026-07-31 15:46:52.770 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sit>
2026-07-31 15:46:52.784 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SitkamerLig2_SitkamerLig2_Skakelaar' changed from ON to OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797f>
2026-07-31 15:46:52.785 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sit>
2026-07-31 15:46:52.847 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Geyser_OnOff_Switch' received command ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:4db0ac2aba:Geyser>
2026-07-31 15:46:52.848 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sit>
2026-07-31 15:46:52.907 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sitk>
2026-07-31 15:46:52.920 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SitkamerLig2_SitkamerLig2_Skakelaar' changed from OFF to ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797f>
2026-07-31 15:46:52.967 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sit>
2026-07-31 15:46:52.968 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Geyser_OnOff_Switch' received command ON (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:4db0ac2aba:Geyser>
2026-07-31 15:46:52.983 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SitkamerLig2_SitkamerLig2_Skakelaar' changed from ON to OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797f>
2026-07-31 15:46:52.987 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SitkamerLig_Skakelaar' received command OFF (source: org.openhab.core.thing$mqtt:topic:cdaf1797fd:3c499ee170:Sit>

Another issue: triggering one of the mqtt switches (‘SitkamerLig_Skakelaar’) would lead to rapid flickering due to item state cycling between ON and OFF.

Can I upgrade directly from 4.3 to 5.2, or should I upgrade to an intermediate version first? Note this is running on a Raspberry Pi 3B, so upgrading takes a while to complete, hence I do not want to version hop unless required.

The reason for this is, that the switch “Is Command” in your MQTT channel configuration needs to be OFF (except you want to command the state of a linked item based on the received MQTT value). What you describe happens if this switch is ON, right?

If you have many MQTT channels, you probably need to go through all of them to check for this switch.

The reason for this is, that the switch “Is Command” in your MQTT channel configuration needs to be OFF (except you want to command the state of a linked item based on the received MQTT value).

Thank you for the pointer, here were indeed a couple of mqtt channels where this was enabled - now disabled. Will test upgrading again to check if it is fixed.

I can confirm that the “Is command” mqtt setting caused the problem. Openhab seems to be running fine after reinstalling openhab 5.2.1, then restoring the 4.3.10 backup.

Glad to have helped you. :heart: