ESPHome Tuya Dimmer switch state bounces in Home Assistant GUI

I just managed to flash a DS02 Tuya dimmer switch with ESPHome using tuya-cloudcutter and the libretiny ESPHome library. I used the yaml config from the ESPhome devices page

Once the dimmer is discovered in Home Assistant, I can successfully add the device to my dashboard with dimmer and on/off switch controls. The dimmer state in HA tracks the hardware buttons and indicator lights on the switch. However, if I toggle the on/off switch, I hear the relay change state, but HA immediately bounces the displayed state back one second later. So I get weird log entries like this:

HA GUI Button Press:

turned on triggered by service Light: Turn off
11:08:43 PM - 9 minutes ago - Steve

turned off triggered by service Light: Turn off
11:08:42 PM - 9 minutes ago - Steve

Hardware Button Press:

turned on
11:19:45 PM - 9 seconds ago

turned off
11:19:44 PM - 10 seconds ago

Any idea what could be going on here? I haven’t set up any automations at all. HA version 2023.11.2 and ESPHome version generic-bk7231t-qfn32-tuya by LibreTiny Firmware: 2023.9.0-dev

Thanks!

Have the same issue since last year when i start Home Assistant an it drives me Crazy.

In my case its related to zugbee/deconz devices