Physical switch does not update my MQTT topic. Trying to connect openHAB & Home Assistant using MQTT

If the switch is “owned” by HA, it’s HA’s job to publish the update caused by physically flipping the switch so OH can know about it. We can’t help with that here on this forum likely.

If the switch is “owned” by openHAB, it’s openHAB’s job to publish state updates it receives from the device to the MQTT state topic.

By default, MQTT will only publish when the Item receives a command. To you might need to create a rule to command the Item or separately publish the state update using the MQTT Action when Zwave updates the Item.

You could use the MQTT Event Bus Publication [3.2.0;3.4.9] and MQTT Event Bus Subscription [3.2.0;3.4.9] (merged into one rule templale for OH 4 MQTT Event Bus [4.0.0.0;4.1.0.0)). If you follow the topic patterns you’ve already established you don’t need to mess with the MQTT stuff at all and can just add your Items to one or two Groups.

For example, since the device is “owned” by OH, add SwitchCCC and DimmerCCC to both the MQTTCommand and MQTTUpdate (choose what ever names for the Groups works for you) and the publish rule will make sure both updates and commands get published. Going the other direction if HA follows the same pattern for MQTT topics the subscribe will automatically command or update the Item which matches the name in the topic.