Help testing developer library for HomeKit support

Hey,

Some of you might be aware of the python-lakeside package that lets Python developers connect to EufyHome smart power plugs, switches and light bulbs.

I’ve ported that library to JavaScript, so I can add a plugin for homebridge, which is a software that lets you connect devices to HomeKit, even if they don’t officially support it. I built both a general library to connect to EufyHome devices, and a specific plugin for homebridge, but unfortunately I only own the UK smart plug, so I can’t test whether the app works properly.

Would anybody who knows their way around Node/NPM be willing to test it and let me know if it works?
You can find the code on this page: https://github.com/sebmos/node-eufy-api
And the NPM package is linked here: https://www.npmjs.com/package/node-eufy-api

You can find a list of devices that should in theory be supported, here: https://github.com/sebmos/node-eufy-api#supported-devices

If one of them works (or doesn’t), feel free to either open an Issue on GitHub, or post a message here.

Thanks!

2 Likes

Just starting to take a look, and have a couple of observations to begin with… I develop on OS X Mojave, and don’t have protobuf installed by default, so perhaps a blurb in the README about it would be useful. Also, I’m new to node/npm, so had to blink a couple of times when “node run cli” didn’t work for me… I think you meant “npm run cli”, right? I’m also just getting my feet wet with Github, I’m hoping to follow up through its issue tracking system as requested.

Hey,

Thanks for the responses.

Yes, protobuf is required at the moment. Leaving this out is an oversight. You can install it through homebrew (https://brew.sh/ - a pretty useful way to install missing software for developers and command-line users.)

And more importantly: Yes, it’s npm run cli - that’s a typo. Thanks for noticing and letting me know.

Thanks,
Sebastian

Hey @anker236 - I published a new version that removes the protobuf step completely, so you won’t need that anymore. Simply running npm install, then npm run cli should be enough now.

Thanks, I was able to verify proper operation (on/off) with a Smart Plug (US, model T1201) although I did have to make a small edit to get it to work. Here’s the diff…

diff --git a/src/device-base.ts b/src/device-base.ts
index c97d7d1..1d076dc 100644
--- a/src/device-base.ts
+++ b/src/device-base.ts
@@ -27,13 +27,17 @@ export enum DeviceType {
 
 export const getTypeForModel = (model: Model | string): DeviceType => {
        switch (model) {
-               case Model.T1201, Model.T1202, Model.T1203:
+               case Model.T1201:
+               case Model.T1202:
+               case Model.T1203:
                        return DeviceType.POWER_PLUG;
 
                case Model.T1211:
                        return DeviceType.SWITCH;
 
-               case Model.T1011, Model.T1012, Model.T1013:
+               case Model.T1011:
+               case Model.T1012:
+               case Model.T1013:
                        return DeviceType.LIGHT_BULB;
 
                default:

Thanks so much @anker236 - I fixed that bug and updated the README.md to show that it works for you!

In case you want to set eufy devices up with your HomeKit, I have now published the homebridge-eufy plugin, which works with homebridge.

2 Likes

Hey @sebastian.moser: I see you are doing some nice work there. Can you also see if you can add eufycam to your device list?
I am not pro at coding stuff, but if you can figure out a way to add eufycam to Homekit, that will give me enough boost to even start learning Homebridge, Github etc.,

Hey @Ice1 - unfortunately, I don’t have a eufycam, so I won’t be able to figure that out myself. I ported this library from a Python library, which only supports light bulbs itself at the moment.

If you know JavaScript or Python, I would recommend you take a look at the node-eufy-api or python-lakeside libraries. If the eufycam communication protocol works similar to the light bulbs, they could be a good starting point!

1 Like

Thanks @sebastian.moser, I don’t think eufycam works similar to the bulbs. So, I guess either it needs a lot efforts or code change, which is not an easy task for a biginner like me. I will leave it to the professionals at this time, the cams are out only couple months now, it might take some time for any techie to even start thinking of writing custom codes.