I follow this big project from make long time, and i have a some systems with home assistant installed, my question now or if some people help my, is that recently acquisition two sensor of D-Link motion sensor in concrete the model DCH-S150, i am try write one conector with home assistant based in the @LinuxChristian project for D-Link Switch DSP-W215, but not it is possible and send me some errors, if some have some idea of how connect this module ( DCH-S150 motion sensor) with home assistant or help me with make the codeâŠ
@kronostime I hope you have some success with this as Iâd also like to see these motion sensors working in Home Assistant. If you need anyone to do any testing for you Iâd be happy to help.
http://w.x.y.z/HNAP1/ returns the sort of information I think is needed to proceed with this. I would paste it in but it contains too many links for a new member apparently.
Note the url begins http NOT https which I believe is more usual.
If there are any Australian developers who might be interested in working on a solution for this request I have received a commitment from D-Link Australia to supply free hardware for development and testing of this device within HASS.
@postlund this is great news that youâve progressed the development of this custom component.
I have installed the two files and I am finding the following in the log, the sensor otherwise does not show in my HASS installation at this time.
File "/home/michael/.homeassistant/custom_components/binary_sensor/dlink_motion_sensor.py", line 84, in async_update last_trigger = yield from self._motion_sensor.latest_trigger()
File "/home/michael/.homeassistant/custom_components/binary_sensor/dlink.py", line 160, in latest_trigger log_list = resp.MotionDetectorLogList
I assume the answer is empty. Chances are that my library is not compatible with the latest firmware. I will try to upgrade to a later version if I can figure out how to do that. One thing you can try however is to run dlink.py manually with IP and PIN code:
Traceback (most recent call last):
File "H:\custom_components\binary_sensor\dlink.py", line 12, in <module>
from pysimplesoap.client import SoapClient
ImportError: No module named 'pysimplesoap'
I originally thought it was unrelated but here is more info from the HASS log that now seems relevant:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_component.py", line 361, in async_process_entity
new_entity, self, update_before_add=update_before_add
File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_component.py", line 189, in async_add_entity
yield from entity.async_update()
File "/home/michael/.homeassistant/custom_components/binary_sensor/dlink_motion_sensor.py", line 84, in async_update
last_trigger = yield from self._motion_sensor.latest_trigger()
File "/home/michael/.homeassistant/custom_components/binary_sensor/dlink.py", line 160, in latest_trigger
log_list = resp.MotionDetectorLogList
File "/home/michael/.homeassistant/deps/pysimplesoap/simplexml.py", line 251, in __getattr__
return self.__call__(tag)
File "/home/michael/.homeassistant/deps/pysimplesoap/simplexml.py", line 247, in __call__
raise AttributeError("Tag not found: %s (%s)" % (tag, e))
AttributeError: Tag not found: MotionDetectorLogList (No elements found)
FYI - my /deps folder contains âpysimplesoapâ and âPySimpleSOAP-1.16-py3.5.egg-infoâ
Itâs easiest to just install it in your venv too, so:
pip install PySimpleSOAP==1.16
My firmware upgrade didnât work, so I had to roll-back. So I pushed an updated dlink.py that can list supported actions. So, I would like you to try this instead:
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.
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 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.
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.
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.