How to correct sensors information with Home Assistant

Some of the smart power plugs I’m using to monitor power usage appear to report incorrect information when viewed in Home Assistant through the Tuya bridge. The information is fine directly in the Tuya app, so the app is probably doing some data processing behind the hood.
Unfortunately, there’s no way of correcting this directly in the entities as managed by Home Assistant. To display (and use) the right sensors values in HA we need to (manually) create some aliases and mathematically correct the values.