hass-config icon indicating copy to clipboard operation
hass-config copied to clipboard

It works!

Open kskenyon opened this issue 7 years ago • 2 comments

I'm using dlink.py to send dch-s150 motion updates to node-red through the python exec node.

python3 -u /home/pi/dlink.py ip pin loop

Exec node is triggered in spawn mode so it sends continuous output from python as a payload. Do what you want with the output. I use it to trigger occupancy for thermostat control with suitable timers, etc.

It actually makes the Dlink motion sensor useful without the cloud service. No lag.

It does use a fair amount of cpu to loop the python app though. There could be a better way.

However, thanks for your work on this. I think a lot of people would like to use their s150's directly. It's a nice piece of hardware.

K

kskenyon avatar Sep 19 '17 13:09 kskenyon

Hello kskenyon,

I realize your post is a bit older, but I am trying to write a daemon that will poll these devices. Is there some doc (or do you have some info) about what is exchanged between these dch-s150 devices and a host?

thanks,

Ron

roncro avatar Feb 05 '19 15:02 roncro

Something has changed, I run the script with a PIN and I get:

DEBUG:asyncio:Using selector: EpollSelector INFO:main:Logging into device DEBUG:main:Challenge: QTeItnNZbtzTEtxgdqrR, Public key: Q4F7RCEk6bymzW4VKAW4, Cookie: YaEybg2819 DEBUG:main:Private key: 853ECEE61571A05F6E9F1EBAFBF78DFF DEBUG:main:Generated new token for Login: B504BAC71AF951CC86A9926C64F131E0 (time: 1559670806) Traceback (most recent call last): File "./dlink.test.py", line 263, in loop.run_until_complete(_print_latest_motion()) File "/usr/lib/python3.5/asyncio/base_events.py", line 466, in run_until_complete return future.result() File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result raise self._exception File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step result = coro.send(None) File "./dlink.test.py", line 250, in _print_latest_motion yield from client.login() File "./dlink.test.py", line 75, in login raise AuthenticationError('Incorrect username or password') main.AuthenticationError: Incorrect username or password ERROR:asyncio:Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x75ebb5f0> ERROR:asyncio:Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x75ca8068>, 184202.470853537)]'] connector: <aiohttp.connector.TCPConnector object at 0x75c96e10>

How do I fix the username/password problem? It seems like something has changed on the dlink end.

kskenyon avatar Jun 04 '19 17:06 kskenyon