Code Monkey home page Code Monkey logo

eufy-node-client's People

Contributors

bropat avatar janloebel avatar matijse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eufy-node-client's Issues

Very interested!

Have a Eufy Floodlight camera which sadly isn't supported by HomeKit (or even provides a RTSP feed) so anything that can integrate even basic functionality would be great!

help starting node.js

I have installed your node and can run the p2p local file from the terminal to change my security mode but wanted to find out how to run it from webcore using a get request? I'd like to incorporate the mode changes with smartthings.
thanks

http requests help

Hi,
I'm writing a simple bash script to turn on and off the night vision.
I'm using this simple code to retrieve all the information that I need:

token=$(curl -s --header "Content-Type: application/json" --request POST --data '{"email":"[email protected]","password":"MyP455w0rd"}' https://mysecurity.eufylife.com/apieu/v1/passport/login | jq --raw-output '.data.auth_token')

curl -H "X-Auth-Token: $token" -H "Content-Type: application/json" --request POST --data '{"device_sn": "","num": 100,"orderby": "","page": 0,"station_sn": ""}' https://mysecurity.eufylife.com/apieu/v1/app/get_devs_list

curl -H "X-Auth-Token: $token" -H "Content-Type: application/json" --request POST --data '{"device_sn": "MyDevicesSN", "station_sn": "MyStationSN", "params": [{"param_type": 2002,"param_value": "1"}]}' https://mysecurity.eufylife.com/api/v1/app/upload_devs_params

but it doesn't works.
Please may you give me same input to get this?
Thanks a lot

M.

Environment Setup

I am looking for instructions on how to obtain my DSK_KEY and ACTOR_ID.

Thank you!

Some additional debug information you might want

Thanks for your amazing work! I have been analyzing some additional data to send commands to each device (channel) and with some minor adjustments its working.

Wireshark logs:

cam0 off:
8800 0000 0100 0000 0000 0000 0000 0100 0000
cam0 on:
8800 0000 0100 0000 0000 0000 0000 0000 0000
cam1 off:
8800 0000 0100 0100 0000 0100 0000 0100 0000
cam1 on:
8800 0000 0100 0100 0000 0100 0000 0000 0000
cam2 off:
8800 0000 0100 0200 0000 0200 0000 0100 0000
cam2 on:
8800 0000 0100 0200 0000 0200 0000 0000 0000

I have altered buildIntStringCommandPayload to include the channel (0x00, 0x01, 0x02) as can be seen above. These correspond with device_channel in the json-payload received from get_devs_list.

export const buildIntStringCommandPayload = (value: number, actor: string, channel = 0): Buffer => {
  const headerBuffer = Buffer.from([0x88, 0x00]);
  const emptyBuffer = Buffer.from([0x00, 0x00]);
  const magicBuffer = Buffer.from([0x1, 0x00]);
  const channelBuffer = Buffer.from([channel, 0x00]);
  const valueBuffer = Buffer.from([value, 0x00]);
  const actorBuffer = Buffer.from(actor);
  const rest = Buffer.alloc(88);

  return Buffer.concat([
    headerBuffer,
    emptyBuffer,
    magicBuffer,
    channelBuffer,
    emptyBuffer,
    channelBuffer,
    emptyBuffer,
    valueBuffer,
    emptyBuffer,
    actorBuffer,
    rest,
  ]);
};

Now you can send commands to the individual channels:

To switch individual cameras on/off use command 0b04 (1035) with 0 (on) or 1 (off)

Turn camera 0 on
service.sendCommandWithIntString(CommandTypes.CMD_DEVS_SWITCH, 0, 0);

Turn camera 2 off
service.sendCommandWithIntString(CommandTypes.CMD_DEVS_SWITCH, 1, 2);

Im currently using CMD_NAS_TEST to manually start/stop the RTSP stream which seems to work just fine.

Is it possible to activate profiles with this?

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!

Example

This seems great but an example for how to use it from e.g. a shell script would be great ;)

I am mostly interested in

  • setting arm mode
  • manually triggering recording

PushRegisterService

Hi @JanLoebel ,
I do have a question about the PushRegisterService.
Is this firebaseinstallation from Eufy or someone else?

Push notification no longer works correctly

As of today, I have noticed that the push notification no longer works correctly. Before i received the payload correctly and now it is missing:

{"notification":{"from":"348804314802","priority":"normal"},"persistentId":"<id>"}

Do you have the same behavior?

LocalLookupService.lookup timeout but works with CloudLookupService.lookup

Hey,

First of all, I want to thank you for creating this library.
I received my Eufy battery doorbell last week and I'm thrilled to see that I can already start playing with it.
I started with the examples repo and everything worked perfectly (HTTP, push).
When trying to connect locally over the p2p connection I hit a timeout issue with the LocalLookupService.
I switched then to the run.ts in this repo and tested the cloud version witch worked like a charm:

const mainP2pCloud = async () => {
  const lookupService = new CloudLookupService();
  try {
    const addresses = await lookupService.lookup(P2P_DID, DSK_KEY);
    console.log('Found addresses', addresses);
  } catch (err) {
    console.error('Not found any address...', err);
  }
};
Found addresses [
  { host: 'xx.xx.xx.xx', port: xxxx },
  { host: '192.168.x.x', port: xxxx }
]

If I use the LocalLookupService:

const mainP2pLocal = async () => {  
  const lookupService = new LocalLookupService();   
  try {
    const address = await lookupService.lookup(LOCAL_STATION_IP);
    console.log('Found address', address);
  } catch (err) {
    console.error('Not found any address...', err);
  }
};
Not found any address... Timeout on address: 192.168.x.x

the 192.168.x.x is the local base station 2 IP address.

Could you point me in a certain direction to solve this issue?
Am I doing something wrong ?
Is it related to my router/network/pihole setup you think?
Could you explain to me what is actually broadcasted to the network?

Thanks in advance.

Doorbell without homebase

Trying to do a lookup service on the wired doorbell directly. Does this work without the homebase?

const address = await lookupService.lookup('192.168.0.155');

This just times out on port 32108.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.