hass-config
hass-config copied to clipboard
Looks great, but what does it do?
Hi, read in a forum that this project might be helpful with motion sensors like the D-Link S150 (as well as other HA devices).
Would you mind describing the project's functionality in a nutshell?
The S150 has fairly bad reviews on Amazon, but I'm still tempted to try it on the idea that there is a library that could help provide a little more control. You never know when a little custom code could change a product from mediocre to very useful.
(edit: I'm hoping to use the motion sensor to turn on a light switch like the WeMo or tp-link)
Hi!
This repo contains most of my config for HA, which also includes a few custom components that I have written. One of them is for the mentioned D-Link motion sensor. It basically allows you to set up a binary sensor that will trigger (move to "on") when motion is detected. Then you can use it in automations, to for instance turn on a light when someone enters the room.
It does not need nor use D-Links cloud services, so you do not need to activate the device or get any such account. Just connect it to your wifi and you're good to go. I have not implemented anything else than motion detection, so that is what you get. But a few additional commands, e.g. for settings should be quite easy to add.
It is polling, so it can have a delay up to five seconds (it's possible to change like with any other sensor, but lower is no good). Might be worth knowing.
That's all very helpful information thank you. Nice project.
Wonder if the five second delay makes it impractical to use with the light switch. For example imagine you're walking into a laundry room with a basket of clothes in your arms. I guess you would have to sit there in the dark for five seconds until the detector register and turn on the light for you.
I assume when you said the five second delay is the minimum, the implication is there are some practical problems with polling any faster than that? Does it seem like a fundamental limitation, or something where it might be possible to find a little hack or work around with enough poking around?
In some cases it's noticeable, yes. So it's not perfect, but most cases OK. I use it in my kitchen to turn on sonos and in the bedroom for a light switch. Works good enough for my needs in those cases. Only reason I have these sensors are because they happened to be cheap when I bought them and they gave me a technical challenge to integrate 😄
Polling is in general a very bad solution. Push-like behavior is much more desirable since it stresses all involved systems much less. Using too low polling times will stress the event loop (in this case) and causes problems if the previous update was not finished when a new polling session starts. That happens every once in a while. It is of course possible to set a lower value than five, but I have found that it is very unstable when doing so.
That makes sense. It's a shame they don't enable a more efficient / lower response time way to handle events because it seems the practical use cases could expand quite a bit.
Unfortunately I'm unaware of another motion detector that does this without requiring extra baggage.
For example, the hue motion detector is nearly instantaneous, but works only with their bulbs. Lutron doesn't have any for their newer caseta system, etc.