Dlink Smart Plug Wi‑Fi DSP‑W115

Yes with HA. In FTTT connect with MyDlink Account and create two new applets :

Receive a web request -> Event Name (what you want) -> Turn On Plug DSP-W115
Receive a web request -> Event Name (what you want) -> Turn Off Plug DSP-W115

After that in HA

In canfigurations yaml :

ifttt:
key: (insert your IFTTT key)

input_boolean:
lucitv_switch:
name: Luci TV
initial: off
icon: mdi:lightbulb-outline

in automations.yaml

  • alias: turn on lucitv_switch
    hide_entity: True
    trigger:
    • platform: state
      entity_id: input_boolean.lucitv_switch
      to: ‘on’
      action:
    • service: ifttt.trigger
      data: {“event”:“your event name on”, “value1”:" "}
  • alias: turn off lucitv_switch
    hide_entity: True
    trigger:
    • platform: state
      entity_id: input_boolean.lucitv_switch
      to: ‘off’
      action:
    • service: ifttt.trigger
      data: {“event”:“your event name off”, “value1”:" "}

And yes it works. Tell me if it fits also for you.

Bye

So ive put this in config yaml file… but i get :
Component error: lucitv_switch - Integration ‘lucitv_switch’ not found.
Component error: initial - Integration ‘initial’ not found.
Component error: icon - Integration ‘icon’ not found.
Component error: name - Integration ‘name’ not found.

You didn’t use the correct identation I think.
In Configuration.yaml

ifttt:
  key: your key
  
input_boolean:
  lucitv_switch:
    name: Luci TV
    initial: off
    icon: mdi:lightbulb-outline

in automations.yaml

- alias: turn on lucitv_switch
  hide_entity: true
  trigger:
  - platform: state
    entity_id: input_boolean.lucitv_switch
    to: 'on'
  action:
  - service: ifttt.trigger
    data:
      event: your event on
      value1: ' '
- alias: turn off lucitv_switch
  hide_entity: true
  trigger:
  - platform: state
    entity_id: input_boolean.lucitv_switch
    to: 'off'
  action:
  - service: ifttt.trigger
    data:
      event: your event off
      value1: ' '

I’m with Home Assistant 0.109.6.

And you don’t need to buy anything from IFTTT

Yes! Got it to work… Can i duplicate this to with my other plugs? Do i have to create 2 on IFTTT for every plug?

I think 2 IFTTT for every plug. After that you can create a script in HA to controll all of them with just one button.

Okay. That sounds great. Trying to add the other ones, they are in different rooms, so i will se what i can do. Main issue so far is getting them to work :slight_smile: and now it does. :):slight_smile:

Is there a way to check if they are on or off? If i activate them in my dlink app, will HA find that out?

Never tried, nut I think it is not possible :frowning:

Does anyone know if this still works? I created an IFTTT account but when trying to connect to a web hook with Dlink I get an error message.

I have a W115 too, connection work with (not in HA, in web browser)
username : Admin
password : PIN CODE (see it on device)

Maybe this can help…

2 Likes

I don’t know if still someone is interested, but i got it work with a python script with the appdaemon add-on.

Here is the script and the manual how to trigger on and off the plug with a python script:


For me it worked without the token just with the pin. Just abort the installation as its written in the manual.

Next you setup the Appdaemon 4 add-on in Home Assistant an integrate the script.

1 Like

So i´ve come this far that when running “python3.8 dspW245.py” i get the response : Sending HTTP upgrade request, sending sign_in to get salt, sending get device status, Turning LED #1 ONm Turning LED #2 off, Sending keep alive"

But here it stopsl How do i get this to work by the Appdeamon.
Everything now is in /config/custom_components/dspW245/

When reading the dspW245 guide and “The device can then be interfaced with using the code below.” where is this going?

Running Rpi4 and hassio all updated.

I´m not a good developer but for me it works fine like this:

  1. I copied the content of the dspw245.py up to column 358 in one config. The last part (360 - 371) isn’t nesessary.

  1. For each Dlink Plug I created a seperat config with the following code:

  2. You have to create the modules and classes in the apps.yaml
    appsyaml

You can test your script right on your PC e.g. with MS visual studio

let me now If you need further informations. Hope it helps you :slight_smile:
Merry X-Mas and greetings from Germany

2 Likes

Final Edit : W115 works good in HA, not connected to MyDlink app, but also works by Google Home.
W118 works with Google TTS and Google Assistant. (Needs to be in MyDlink app)

Not gonna buy anymore Dlink wall-switches.

Hi there.
I’ve been trying to integrate the DSP-W245 power strip but i’ve never used appdaemon.
Can you write a tutorial a bit more detailed pls?
thank you!

This was working fine for me but when Home Assistant updated it’s Python version that implemented higher security cypher as default, it broke and I have been unable to find a solution. I always get “sslv3 alert handshake failure (_ssl.c:997)”.

1 Like

To bypass the ssl exception caused by the new version of python, the following code change must be made:

195a196,200
>         ctx = ssl.create_default_context()
>         ctx.check_hostname = False
>         ctx.set_ciphers('DEFAULT')
>         ctx.verify_mode = ssl.CERT_NONE
196a202
>
198c204
<         self.socket = ssl.wrap_socket(sock)
---
>         self.socket = ctx.wrap_socket(sock, server_hostname="<host-name-of-your-power-strip>")
1 Like

Has anyone managed to read the power consumption?

DSP-W115 hardware does not support power metering.

Not even for drink w245?