How to add new Action LSC power plug energy monitor to HA?

The new LSC Smart Connect power plugs have an energy meter that can be read with the Smart Life app. However, I have not yet managed to integrate this data (power, voltage and current) into Home Assistant via Local Tuya.

I see that the new smart plug uses two IP addresses.

That’s why Local Tuya also detects two devices where I assume that 1 is the switch (that works fine in HA) and the second represents a sensor.

I offcourse need to get the local key from this discovered device to enable integration into local tuya/home assistant.
Has anyone managed to add the device ID of the energy monitor in iot.tuya.com? If so, how?

I found the answer to my own question. The Voltage, Current and Power can be set as attributes of the switch entity. Using the API explorer > Device Control > Query Things Data Model I found the mapping.
Current Voltage = 20
Current Powerconsumption = 19
Current Current = 18

In local Tuya the second configuration screen looks like this:
image

Abd with result like this:

Hope this will help others.

Better solution is to add sensors to the device while setting up the device in Local Tuya because you are then able to change the scaling factor.
Current : scaling factor 1
Power: scaling factor 0.1
Voltage: scaling factor 0.1

You then get the seperate entities as part of the device:

image

How did you add the individual entities to the sensor card en waar can i find the scaling factor?

When you edit the device in local tuya, there should be an option to add extra entities (all the way at the bottom of the dialog)
image

Check that option and press submit. In the next screen select sensor
image
Press submit and fill in the form
image
Press submit and again repeat by selecting sensor but uncheck ‘do not add any more entities’
image
Press submit and fill in the form
image
Press submit and add the last sensor entity but uncheck ‘do not add any more entities’
image
Press submit and again fill in the form
image
Press submit and in the next screen leave the check in place
image
Press submit again and you should be ready
image
In local tuya select the device properties


And add the created entities to the preferred dashboard.

Remark: To make it easy to find the entities, it is recommended to include the name of the device in the friendly name. For example: “Smartplug Generiek Voltage”.
image

You might have to restart HA also

2 Likes

Hi, struggling to get this right. The plug has been added but current, voltage and power entities missing. And unfortunately I do not understand what you mean with ‘local tuya’. The phone app? Or somewhere in HA? I can’t find the option "add more entitities in edit device mode’. Thanks.

@ngauruhoe Local Tuya is an integration that you can add to HA. There are some spin-offs (forks) from this that are maintained. Also you could try Tuya Local which is another spin-off.

It was a challenge but I finally got HACS en LocalTuya installed. I found the “add more entities” option and added Current, Power and Voltage. As can be seen in the uploaded screenshot.
However, if I now display the plug “This device has no entities” is displayed. Previously there was the on/off switch control but that has gone too now. Where did I go wrong?


I don’t know why but all of a sudden they are all there.

1 Like

There’s one more thing. The Smart Plug also reports Daily and Monthly kW. How can I add these as well? See screenshots.

I also was wondering what the reasoning behind the entity numbering is (18: Current,…etc.).

Thanks again.

LSC001

The following ‘numbers’ are available. I guess 2 of these are daily and monthly. Perhaps there’s a Total as well? But which is which?

{\"abilityId\":9,\"accessMode\":\"rw\",\"code\":\"countdown_1\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_time2\",\"attribute\":\"736\"},\"name\":\"开关1倒计时\",\"typeSpec\":{\"max\":86400,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"s\"}},
{\"abilityId\":17,\"accessMode\":\"ro\",\"code\":\"add_ele\",\"description\":\"\",\"extensions\":{\"attribute\":\"704\"},\"name\":\"增加电量\",\"typeSpec\":{\"max\":50000,\"min\":0,\"scale\":3,\"step\":100,\"type\":\"value\",\"typeDefaultValue\":0}},
{\"abilityId\":18,\"accessMode\":\"ro\",\"code\":\"cur_current\",\"description\":\"\",\"extensions\":{\"attribute\":\"704\"},\"name\":\"当前电流\",\"typeSpec\":{\"max\":30000,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"mA\"}},
{\"abilityId\":19,\"accessMode\":\"ro\",\"code\":\"cur_power\",\"description\":\"\",\"extensions\":{\"attribute\":\"704\"},\"name\":\"当前功率\",\"typeSpec\":{\"max\":80000,\"min\":0,\"scale\":1,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"W\"}},
{\"abilityId\":20,\"accessMode\":\"ro\",\"code\":\"cur_voltage\",\"description\":\"\",\"extensions\":{\"attribute\":\"704\"},\"name\":\"当前电压\",\"typeSpec\":{\"max\":5000,\"min\":0,\"scale\":1,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"V\"}},
{\"abilityId\":21,\"accessMode\":\"ro\",\"code\":\"test_bit\",\"description\":\"\",\"extensions\":{\"attribute\":\"736\"},\"name\":\"产测结果位\",\"typeSpec\":{\"max\":5,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0}},
{\"abilityId\":22,\"accessMode\":\"ro\",\"code\":\"voltage_coe\",\"description\":\"\",\"extensions\":{\"attribute\":\"736\"},\"name\":\"电压校准系数\",\"typeSpec\":{\"max\":1000000,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0}},
{\"abilityId\":23,\"accessMode\":\"ro\",\"code\":\"electric_coe\",\"description\":\"\",\"extensions\":{\"attribute\":\"736\"},\"name\":\"电流校准系数\",\"typeSpec\":{\"max\":1000000,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0}},
{\"abilityId\":24,\"accessMode\":\"ro\",\"code\":\"power_coe\",\"description\":\"\",\"extensions\":{\"attribute\":\"736\"},\"name\":\"功率校准系数\",\"typeSpec\":{\"max\":1000000,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0}},
{\"abilityId\":25,\"accessMode\":\"ro\",\"code\":\"electricity_coe\",\"description\":\"\",\"extensions\":{\"attribute\":\"736\"},\"name\":\"电量校准系数\",\"typeSpec\":{\"max\":1000000,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0}},
{\"abilityId\":26,\"accessMode\":\"ro\",\"code\":\"fault\",\"description\":\"\",\"extensions\":{\"attribute\":\"128\"},\"name\":\"故障告警\",\"typeSpec\":{\"label\":[\"ov_cr\",\"ov_vol\",\"ov_pwr\",\"ls_cr\",\"ls_vol\",\"ls_pow\"],\"maxlen\":6,\"type\":\"bitmap\",\"typeDefaultValue\":0}},
{\"abilityId\":38,\"accessMode\":\"rw\",\"code\":\"relay_status\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-zhuangtai\",\"attribute\":\"736\"},\"name\":\"上电状态设置\",\"typeSpec\":{\"range\":[\"off\",\"on\",\"memory\"],\"type\":\"enum\",\"typeDefaultValue\":\"off\"}},
{\"abilityId\":40,\"accessMode\":\"rw\",\"code\":\"light_mode\",\"description\":\"\",\"extensions\":{\"iconName\":\"tcl_function_light\",\"attribute\":\"224\"},\"name\":\"指示灯状态设置\",\"typeSpec\":{\"range\":[\"relay\",\"pos\",\"none\",\"on\"],\"type\":\"enum\",\"typeDefaultValue\":\"relay\"}}]}]}"

The values are not included in the mapping but might be calculated from the other parameters - I never looked at that.

Ok, Thank you!

Thank you so much for providing the steps.
Once I read it, like really read it :face_with_peeking_eye:, device and sensors appear as intended.

I still encounter a problem with Current and Power consumption.
They always give me 0.
Never mind, I was testing with a bugged and low current device.
It works fine with a 50W light.
Now I can try to track power consumption of my dump dryer and get notification :wink:

Thanks again.

EDIT: of course, the first of the two I bought was faulty by switching off with a load…
Ruining the surprise demo for my wife…
Second one works as intended and first one exchanged at store.
Worth it.

1 Like

how is stability of these things? Any experience with multi wifi points? (i’ve seen many cheap devices choke on sudden roaming to other access point)

Hey Sander, very stable here (Ubiquiti network and Unifi monitoring). Powerplugs are not roaming in my case (and I can see it when they do), they’re mostly installed at a fixed location. Instability might also be related to the way the WiFi network is set up.

1 Like