bropat / eufy-security-client

This shared library allows to control Eufy security devices by connecting to the Eufy cloud servers and local/remote stations over p2p.
MIT License
462 stars 66 forks source link

Websocket #8

Closed bachya closed 3 years ago

bachya commented 3 years ago

Hi! Excited that you've put so much work into this great library; thank you!

What would you think about some sort of two-way websocket that would allow non-JS/TS libraries to interact with this? I'm thinking of Home Assisstant, which is Python-based; rather than re-implementing everything you've done in Python, a read/write websocket could allow a Python library to interact with Eufy Security via this library.

You could even do read-only as step one.

I'm a top Home Assistant contributor and own several Eufy Security devices, so I would be happy to collaborate with you on this!

bropat commented 3 years ago

Hi, thank you very much.

How the zwave-js-server project?

I could start implementing an eufy-security-server as my free time allows. If you do the rest, I'm in ;)

bachya commented 3 years ago

zwave-js-server is doing great! It's the example I'm thinking of: by having that websocket, the Home Assistant core integration development with ZWave-JS has gone super fast.

I could start implementing an eufy-security-server as my free time allows. If you do the rest, I'm in ;)

Wonderful! No pressure, of course; I'm sure you're busy. That said, looking forward to working with you!

bropat commented 3 years ago

I think this weekend I will publish a first version. I let you know. ;)

bropat commented 3 years ago

The first version is almost finished, but I still need a little time. I still need to abstract the parameters of the station and the devices (high level api).

A small screenshot of the test client (included with the server, as with zwave-js-server project): image

bropat commented 3 years ago

Sorry for the delay, but I didn't have as much time as I had hoped.

Small status update:

I have now rewritten part of the driver to abstract the parameters. This part is not finished yet, but first tests already give a good result. As soon as it is finished, I can complete the first version of the websocket implementation. I will keep you informed.

bropat commented 3 years ago

Small status update:

The driver part is done and also the first websocket implementation, now I have to test everything and check if it works as expected.

Still a little patience ;)

bropat commented 3 years ago

Good news I have released the first version:

npm: https://www.npmjs.com/package/eufy-security-ws github: https://github.com/bropat/eufy-security-ws

For any bugs please open an issue on the above repo, if the bug is in the websocket implementation

bachya commented 3 years ago

Cool! Great work, @bropat! I'll take a look soon.

bachya commented 3 years ago

@bropat I've played around and, in short, I'm elated. This is going to be great. Thanks so much for your collaboration on this!

Here are the next steps I'd like to pursue; some of them will require your help and others (i.e., Home Assistant-specific things), I'll take back into our community (unless, of course, you want to be involved!):

I'll make sure to submit bugs/issues/requests in the eufy-security-ws library; if I post something in the incorrect place, please correct me.

Thoughts on the above (especially your help with pushing Docker images)?

bropat commented 3 years ago

@bachya Thank you, you are welcome.

I am always interested to learn new things ;) I have added you as a collaborator so that we are faster.

The points mentioned sound good :)

bachya commented 3 years ago

@bropat Excellent! Thank you!