D-Link Motion Sensor DCH-S150

Cool, then we know for a fact that it is a firmware thing. Since there is a GetLatestDetection action now, I believe that should be used instead (not sure why GetMotionDetectorLogs doesn’t work though, would have to investigate that). So, I have made an attempt to implement support for that action but still be backwards compatible. Please try latest_motion with the updated version in my repo.

1 Like

Worked like a charm! Thanks a lot!

I spent a couple of hours trying to find the right parameters, for that call (had tried using GetLatestDetection before and only got errors). How did you managed it so fast?!

That’s great! You will likely notice some “connection errors” and that calls takes too long to execute some times. Not sure if the device can handle the update rate. My goal is to re-write the SOAP-code to use aiohttp instead and keep the connection alive at all time. Now pysimplesoap wll close it between each call, which is a bit excessive. Hopefully that re-write will make it more stable.

I’m a wizard :wink: No, I actually cheated this time. After writing the initial implementation I discovered open PR for this sensor in the OpenHAB project. But since it used GetLatestDetection it wasn’t interesting to me. Now, in your case, however I could benefit a bit from their work.

3 Likes

Hi Guys,

Do you know if there is any progress in developing the code for this sensor?
I’m using DCH-S150 in conjunction with IFTTT, it works ok, however, there is a delay in a few seconds that I would like to avoid.
I could be a tester of the code if needed.

Watching this topic with interest as I also have one of these sensors. I want to use this sensor without relying on outside servers.

I will tinker with component build (Thanks @postlund) but my inexperience with HA is likely to be an issue.

I cannot find anything about DCH-D150 on the net, did you mean S and not D? Or is it some special version? My custom component should work OK for DCH-S150, just drop it in custom_components. What you need to know is that there is no “push” functionality from the device (at least that I have found). That’s only available for their cloud solution. So polling is the available solution to get a reading locally. I poll with 5 seconds intervals which seems to work fine when using one device. When I add my second, I get timeouts sometimes. Not sure if this is due to my Home Assistant being overloaded or not, so you might not see it. But That’s an issue I see.

@postlund yes you are right, I have a DCH-S150. I misread @Molodax’s post.

Sorry for confusion, I meant DCH-S150 (it was typo).
And thank you for the answer, I also saw that you mentioned before that

my library is not compatible with the latest firmware

So I just wanted to check if that issue has been solved since I am using the latest firmware as well as I’m planing to add a second device.

Yep, it works with the latest firmware now!

2 Likes

I too have got this sensor working! It certainly has been a useful learning excercise for me as I’m such a newbie to HA. Thanks @postlund et al.

Great to he hear! Happy hacking!

Howdy. What exactly am I to do with those two files you linked? I’m cluless. Thanks in advance.

Create a directory called custom_components in your configuration directory (where configuration.yaml is). Inside that directory, create another directory called binary_sensor. Place the two files in that directory and add the configuration mentioned above.

1 Like

Thanks for the response. What an I supposed to write for host? The IP of the detector?

Yep, IP of the detector.

Still not showing up. I take it the password is the one I made up in the app or is there a default one I should be using? Sorry for all the questions…been trying to figure this out for a couple of days alone, but it hasn’t worked out.

It’s the PIN code you used to setup the device.

Still not showing up. Guess I’ll have to use IFTTT for the time being. Thanks again for the help.

If you enable logging and provide some logs I can help you troubleshoot.

Thanks so much for the offer. I will read how to do that and get back to you soon.