You can’t replace the value. You can only make a template sensor with the correct value and Hide the original.
You don’t need an association with the device. If you’re having issues running actions or triggers because the entity isn’t associated with the device, then you shouldn’t use a device action or trigger. You should use a normal state trigger or a service-call as your action.
I have the same issue - is this still not possible?
I’m interested in where this issue occurs - should this be a bug in the Tuya implementation or is HA translating something incorrectly?
It would be nice to simply correct a value transform a value as part of the device as @fnx wanted…
In the meantime can someone give details of how to create the template sensor?