Adding LEDvance Smart+ WiFI Nightlight Plugs to Home Assistant

Hey there, I am currently trying to implement LEDvance Smart+ WiFi Nightlight to Home Assistant to use it in some automations.
Via the Smart Life App you can perfectly control the power plug and the light function seperately. I also managed to get the devies show up in the Tuya integration and also in LocalTuya.

My problem now is that with Tuya integration the device is detected as power plug only, so there is no option to control the nightlight function which I require.

With LocalTuya, I do not find a suitable device type. Chosing light as type, I managed to find out which ID code controls the on/off state of the light but I cannot assign it to any switch function neither does the final interface offer me an on/off function.

Is there any solution how I can access the light on/off via Home Assistant?

Thanks in advance!

2 Likes

I have the same problem. I get the plug in Home Assistant with ZHA but no light controls. Did you find a solution?

Same problem here. This nightlight plug itself is very good product, would be cool to be able to use both features from HA.

Hey, a short update on the topic:

When using the Smart Life app (required setting the plugs up with Tuya via the server), you can set up scenes for your nightlights to be on or off. These scenes become available in Home Assistant through the Tuya integration. At least you can control the on/off state of the nightlight like this.
But: you still cannot control the brightness and you cannot check for the on/off state since this is not accessible in Home Assistant.

I guess this is a very rarely used plug so maybe no one else was looking for a slution or found one.

Hey,

invested some time and used ChatGPT for support to manage to implement light on/off (including checking the state) and brightness control to HA using LocalTuya.

First of all you need several Infos required for LocalTuya:

  • Name: This one you can choose by yourself
  • Host (IP): Required to address the device. For me, LocalTuya identified the devices in my network including the IP automatically
  • Device ID: This one you need to get from the Tuya website or read it out using TinyTuya or somethign comparable
  • Local Key: This one you need to get from the Tuya website or read it out using TinyTuya or somethign comparable

Then you can continue using the appropriate protocol (for me it was auto detected to be 3.3)

Then you need to add a switch entity for controlling the light on/off state:

  • ID: Choose entry 27: this is a boolean controling the on/off of the light

This shoudl already be enough to create the entity.

For light, add a light entity:

  • ID: 29
  • Brightness (only for white color): 29 (value: xxxx)
  • Brightness Lower Value: 10
  • Brightness Upper Value: 1000
  • Color: 28 (value: white)

The rest I left as it was (color temp. etc). Since then I got control of the light over HA using the added entites from LocalTuya.

The info which DPs to use could be drawn from tuya.com. In the API control center you can query all states of a device by giving the device ID and there the light conrol DPs were also listed.

I hope this helps someone besides me. :slight_smile:

1 Like

Here is the complete solution that I am using. It includes controlling the power, light & brightness of the nightlight plug and reads the voltage, current and consumption into sensors.

I use LocalTuya in the version that is directly available in HACS (you don’t need to add the repo first): GitHub - rospogrigio/localtuya: local handling for Tuya devices

After adding the integration I chose NOT to configure the Cloud API:


I did so because I already had the local communication credentials (device id and local key) determined through a special Python script. I simply did not know that the HACS integration would also do that for me (I think) if you configure the Cloud API. So you may to want the way to configure the Cloud API, which is probably simpler.

After that the Nightlight Plug should be found by LocalTuya and you can add the following 5 switch, light and sensor entities:

Here are the detailed settings for each of the 5 entities:

As you can see, I added the sensors for Voltage, Current, and Consumption twice: Once as attributes of the main power switch and once as separate entities. You may wish to use only one of these two versions, but it does not hurt to have both.

This is the result of my setup:

1 Like

This really works, it’s simple and elegant! :heart_eyes: I have tried to search working guide and everything is lost in endless threads, even if it’s there (not sure if any other thread has solution).

I didn’t use Python script to obtain private key, I just read it from Ledvance Smart+ app.

@Jpsy, I think it would help grealy other users if you could write short how-to about your excellent solution. It’s there above, but it gets lost among useless and no more working or difficult solutions.

1 Like

Thanks @honkkkis.
Here you go:

1 Like