FYI, I bought a 4-pack of the Arlec Smart plug-in socket with energy meter (model PC191HA) from Bunnings for Aus$65.oo.
I followed instructions in the video at Get your Tuya Device Local Key - YouTube to get the Local key and Device specification attributes:
Having installed in the Tuya phone app, I used my router to associate the device MAC addresses to specific IP addresses (which happen to be blocked by the firewall).
I have installed each using the TuyaLoacal integration:
- Select the new device from Device ID or IP Address, with Platform of “switch” then as shown:
plus dp_id 20 for Voltage. - UN-tick the “Do not add any more entities” box, select “number”, Submit, then select dp_id of 9, name “countdown” and range 0 to 86400 (from memory, number of seconds in 1 day).
- Same for dp_id 38, relay_status with enumerated values “off”, “on”, and “last”.
- no more entities to add, so leave the “Do not add any more entities” box ticked.
The switch works, as does the countdown timer. The relay_status does not - but I can live without it for now.
I see current, current_consumption and voltage values are attributes of the “switch” entities - however they aren’t automagically made available to report on.
I had to add the YAML code from the “Energy monitoring values” section of LocalTuya documentation to my HA configuration.yaml, and they are now reporting correctly (using the custom:multiple-entity-row frontend available in HACS)