I found this in another project’s repository.
Maybe addresses could be transformed into a Quirk for these sensors?
{
fingerprint: tuya.fingerprint('TS0601', ['_TZE204_81yrt3lo', '_TZE200_rks0sgb7']),
model: 'PJ-1203A',
vendor: 'TuYa',
description: 'Bidirectional energy meter with 80A current clamp',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
onEvent: tuya.onEventSetTime,
configure: tuya.configureMagicPacket,
exposes: [
e.ac_frequency(), e.voltage(),
tuya.exposes.powerWithPhase('a'), tuya.exposes.powerWithPhase('b'), tuya.exposes.powerWithPhase('ab'),
tuya.exposes.currentWithPhase('a'), tuya.exposes.currentWithPhase('b'),
tuya.exposes.powerFactorWithPhase('a'), tuya.exposes.powerFactorWithPhase('b'),
tuya.exposes.energyFlowWithPhase('a'), tuya.exposes.energyFlowWithPhase('b'),
tuya.exposes.energyWithPhase('a'), tuya.exposes.energyWithPhase('b'),
tuya.exposes.energyProducedWithPhase('a'), tuya.exposes.energyProducedWithPhase('b'),
e.numeric('update_frequency', ea.STATE).withUnit('s').withDescription('Update frequency'),
],
meta: {
tuyaDatapoints: [
[111, 'ac_frequency', tuya.valueConverter.divideBy100],
[101, 'power_a', tuya.valueConverter.divideBy10],
[105, 'power_b', tuya.valueConverter.divideBy10],
[115, 'power_ab', tuya.valueConverter.divideBy10],
[112, 'voltage', tuya.valueConverter.divideBy10],
[113, 'current_a', tuya.valueConverter.divideBy1000],
[114, 'current_b', tuya.valueConverter.divideBy1000],
[110, 'power_factor_a', tuya.valueConverter.raw],
[121, 'power_factor_b', tuya.valueConverter.raw],
[102, 'energy_flow_a', tuya.valueConverterBasic.lookup({'consuming': 0, 'producing': 1})],
[104, 'energy_flow_b', tuya.valueConverterBasic.lookup({'consuming': 0, 'producing': 1})],
[106, 'energy_a', tuya.valueConverter.divideBy100],
[108, 'energy_b', tuya.valueConverter.divideBy100],
[107, 'energy_produced_a', tuya.valueConverter.divideBy100],
[109, 'energy_produced_b', tuya.valueConverter.divideBy100],
[129, 'update_frequency', tuya.valueConverter.raw],
],
},
},