What can be a reason for such odd behaviour? It doesn’t make any sense. It shows true values but with significant delay.
EDIT: Also it never gets offline. Even if you unplug it from power it will never become offline in HA. Another thing is that if you switch it using button on plug it will not change state in HA. Only if you change state via HA.
Regarding the consumption reporting, it is likely that the reporting configuration is not configured as expected.
Regarding the on/off state report: I have several where the “Vendor” is set to “_TZ3000_wamqdr3f” that report the on/off state as expected. However Tuya has a tendency of doing things differently from the Zigbee specifiation. We even have a “Magic spell” for some Tuya devices to unlock their normal behavoir.
I think you could increase the zipy log level to see the incoming packets sot that you can can if HA actually receives somthing from the plug when you change the state.
This Tuya Magic thing actually fixed manual button switch reporting. Now even when pressed on device itself it reports new state immediatelly to HA. Does it have to be done only once per device or maybe each device reboot or HA restart? Would it also fixed power reporting? I already fixed it using your automation but maybe this magic spell works also for that so automation is not needed anymore?
I suppose that you implemented the first solution: attr_read, but you can send a report configuration to the device ass well - read on in the link I shared first above.
The reporting configuration is a standard Zigbee command. Normally when you add a device, some report configuration configuration is sent by ZHA, but if this configuration is not received by the device, it just stays as is because the initialisation commands are not repeated (unless you trigger reinitialize in HA’s UI).
So I guess that is what happened and you ended up with default device settings.
Normally those settings should remain velid until reconfigured or factory reset, but I can’t vouich for how they implemented it.
the magic spell shoul only be needed once, and typically until factory reset or sometimes when you add the device to the network again.