JanLoebel / eufy-node-client

Experiment to talk to eufy security
43 stars 6 forks source link

Is it possible to activate profiles with this? #7

Closed xanthos84 closed 3 years ago

xanthos84 commented 3 years ago

Hi, I cant figure it if it is currently possible to control the security profiles of the Eufy Base with this node scripts? If so, can you maybe give some guidance how to start? That would be very nice, thank you!

JanLoebel commented 3 years ago

Yes that's possible if the machine you're running the script is in the same network as your homebase.

mainP2pLocal() is the method to start in index.ts, but first you need to provide your P2P_DID and ACTOR_ID in the .env-file. That information you can get by calling the mainHttp() method in the index.ts. You only have to do that once till you have the P2P_DID and ACTOR_ID. Then change the hard coded IP of 192.168.68.101 to your homebase ip.

With this command you can set the arming mode:

// CMD_SET_ARMING  # 0 => away 1 => home, 2 => schedule, 63 => disarmed
devClientService.sendCommandWithInt(CommandType.CMD_SET_ARMING, 1);

Remove or uncomment the line below: devClientService.sendCommandWithIntString(CommandType.CMD_SET_DEVS_OSD, 1, 0); to not change the OSD settings.

xanthos84 commented 3 years ago

thank you for the fast response! well, i am no real dev sadly - i am struggling where to start actually.. So installation first.. and then where to run the command? Is it possible via GET/POST request like an API? That would be easy to use...

JanLoebel commented 3 years ago

Sorry.. for a non developer this is currently to complicated. Currently I'm working to provide more features instead of adding a REST-like-API. Sorry you'll have to wait till this is further.