Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It works! #2

Open
kskenyon opened this issue Sep 19, 2017 · 2 comments
Open

It works! #2

kskenyon opened this issue Sep 19, 2017 · 2 comments

Comments

@kskenyon
Copy link

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

@roncro
Copy link

roncro commented Feb 5, 2019

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

@kskenyon
Copy link
Author

kskenyon commented Jun 4, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants