take your D-Link DCS-D150 out of the cloud and into Home Assistant

I’m not especially recommending the D-Link DCS-D150 motion sensor but it does have some features that had me buy it. Firstly it plugs straight into the wall above a worktop so it can sense when someone is in the kitchen. (I can then turn on the lighting – whatever). Secondly this was one of the few sensors that worked as a standalone sensor, without the need for a separate hub or other hardware. Furthermore it could send a ‘motion detected’ signal straight to IFTTT and I could then make the lights turn on and more. At £25 that’s not bad.

A few years later D-link went over to a new system and the DCS-D150 was no longer supported. A few years more, in 2020, D-link dropped it’s support for IFTTT so all I had was a stupid sensor that talked to a stupid app that talked to nothing – not even new D-link devices.

Luckily I found a custom component for Home Assistant. The motion sensor could now be ‘heard’ over the network.

DCS-D150
D-link motion sensor abandoned and IFTTT cloud services shut

Install the Dlink component into Home Assistant

Go to the file editor in the Home Assistant frontend.

  • In /config create a new folder ‘custom_components’.
  • In the custom-components folder make another folder ‘dlink_motion_sensor’
  • Add the three files shown (go to the end of this thread to find the files)
  • Still in File editor open your configuration.yaml and add this code to the binary_sensor section.
  • Save the edits and completely shut down and restart the Raspberry Pi
binary_sensor:
  - platform: dlink_motion_sensor
    name: kitchen_motion
    host: 192.168.1.131
    password: 9957XX
# the password or PIN is printed on the sensor. The ip address can be found # via the router. 

After Home Assistant restarts

You’ll now have an new entity called binary_sensor.kitchen_motion. When you walk past the sensor the state changes from Open to Closed.

Create an automation to turn on the lights and start a timer

id: '1566591XX7312'
alias: motion day lightson
trigger:
entity_id: binary_sensor.kitchen_motion
from: 'off'
platform: state
to: 'on'
condition:
after: 06:30
before: '23:00'
condition: time
action:
data: {}
entity_id: switch.cupboard_lights
service: switch.turn_on
data: {}
entity_id: switch.ceiling_lights
service: switch.turn_on
data: {}
entity_id: timer.ceiling_lights
service: timer.start

Create an automation to turn off the lights when a timer finishes

id: '1578935XX2018'
alias: motion light timer finished so turn off lights
trigger:
event_data:
entity: timer.ceiling_lights
event_type: timer.finished
platform: event
action:
alias: ''
data: {}
entity_id: switch.ceiling_lights
service: switch.turn_off
data: {}
entity_id: switch.cupboard_lights
service: switch.turn_off

Leave a Reply

Your email address will not be published. Required fields are marked *