bropat / eufy-security-ws Goto Github PK
View Code? Open in Web Editor NEWSmall server wrapper around eufy-security-client library to access it via a WebSocket.
License: MIT License
Small server wrapper around eufy-security-client library to access it via a WebSocket.
License: MIT License
Describe the bug
I am unable to install on my rpi4 buster and receive the following error. I tried with and without sudo. Here is the error I received running npm 7.12.1.
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /home/pi/node_modules/eufy-security-ws/dist/bin/server.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/home/pi/node_modules/eufy-security-ws/dist/bin/server.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
What is the additional cost and complexity of including these as attributes of device state?
Moreover, we can fire events as property_changed
for is_livestreaming
and is_rtsp_livestreaming
True and False.
Now, i need to send start rtsp livestream command and check its result. I am not getting any event.
For p2p livestream, it generates livestream started
and livestream_stopped
but it could be managed via specific attributes mentioned above.
I think the issue is announced in version 5.0
Entity picture (url) is not showing anything , i get an internal server error and/or the entity inside HA isnt showing any picture/thumbnail
camera is T8114
I'm on last version of ws
Describe the bug
When I was using 0.3.3 version device.stop_livestream
was succesfully generating livestream stopped
event but I had tried latest (0.4.2) and I am not able to get respective event to detect the status
To Reproduce
Steps to reproduce the behavior:
Expected behavior
to receive: {'type': 'event', 'event': {'source': 'device', 'event': 'livestream stopped', 'serialNumber': 'T8113N1320483643'}}
Screenshots & Logfiles
N/A
Versions:
Docker version 0.4.2 (latest tag(
Additional context
N/A
Describe the bug
After updating from 0.3.3 to the latest version the battery sensor has problems showing the correct state.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Battery sensor showing the correct percentage.
Screenshots & Logfiles
2021-11-29 20:23:45.609 INFO Eufy Security server listening on port 3000
2021-11-29 20:23:47.173 INFO Connected to station T8010 on host 192.x.x.x and port 11294
2021-11-29 20:23:49.047 INFO Push notification connection successfully established
Versions:
Hardware information about camera
Additional context
I already tried a fallback and reinstalled the old addon(s) from a backup (both Eufy security WS addon + integration). After a reboot the battery sensor will immediately show the correct percentage again:
After some usage time it seems like periodically the correct value is shown and after a while drops to 0% again:
Using Home Assistant (docker) with fuatakgun's custom integration pointing to eufy-security-ws (docker).
Clicking "lock" or "unlock" throws an error in the eufy-security-ws log, such as this (identifier obfuscated because I'm not sure if that's "secret"):
2021-10-28 16:50:00.485 ERROR Message error ,
NotSupportedError This functionality is not implemented or supported by T8************F6,
details:,
{,
name: 'NotSupportedError',�,
m,
error stack:,
• station.ts:2384 lockDevice,
node_modules/eufy-security-client/src/http/station.ts:2384:19,
• message_handler.ts:85 handle,
src/lib/device/message_handler.ts:85:31,
• server.ts:46 device,
src/lib/server.ts:46:34,
• server.ts:98 receiveMessage,
src/lib/server.ts:98:58,
• server.ts:57 <anonymous>,
src/lib/server.ts:57:53,
• events.js:400 emit,
events.js:400:28,
• websocket.js:1022 receiverOnMessage,
node_modules/ws/lib/websocket.js:1022:20,
• receiver.js:522 dataMessage,
node_modules/ws/lib/receiver.js:522:14,
• receiver.js:440 getData,
node_modules/ws/lib/receiver.js:440:17
I'm able to use the iOS app to lock/unlock, but the integration doesn't seem to be receiving push notifications. I've used the app and manually locked/unlocked several times recently but the lock doesn't show any history. Not sure if it's related, but I'm also seeing these heartbeat errors every minute:
2021-10-28 16:26:10.305 INFO Connected to station T8************F6 on host 192.168.42.181 and port 11044 ,
2021-10-28 16:27:15.306 WARN Station T8************F6 - Heartbeat check failed. Connection seems lost. Try to reconnect... ,
2021-10-28 16:27:15.306 INFO Disconnected from station T8************F6 ,
2021-10-28 16:28:30.593 INFO Connected to station T8************F6 on host 192.168.42.181 and port 26995 ,
2021-10-28 16:29:30.596 INFO Disconnected from station T8************F6 ,
2021-10-28 16:29:30.595 WARN Station T8************F6 - Heartbeat check failed. Connection seems lost. Try to reconnect... ,
2021-10-28 16:29:38.473 INFO Connected to station T8************F6 on host 192.168.42.181 and port 26121 ,
2021-10-28 16:30:43.473 WARN Station T8************F6 - Heartbeat check failed. Connection seems lost. Try to reconnect... ,
2021-10-28 16:30:43.473 INFO Disconnected from station T8************F6 ,
2021-10-28 16:31:18.558 WARN Station T8************F6 - Tried all hosts, no connection could be established ,
2021-10-28 16:31:18.558 INFO Timeout connecting to station T8************F6 ,
2021-10-28 16:31:30.705 INFO Connected to station T8************F6 on host 192.168.42.181 and port 28072 ,
2021-10-28 16:32:30.708 WARN Station T8************F6 - Heartbeat check failed. Connection seems lost. Try to reconnect... ,
2021-10-28 16:32:30.708 INFO Disconnected from station T8************F6 ,
2021-10-28 16:32:37.998 INFO Connected to station T8************F6 on host 192.168.42.181 and port 16327
Thanks!
As you might have noticed, each integration point for client, requires to come up with its own implementation for generating video stream.
Do you consider to incorporate a rtsp server into web socket server and publish the RTSP URL when p2p stream starts?
Hi bropat, great work done with the integrations. :-)
I think I encountered a (new) Eufy product that is not added yet?
The T8020 Wi-Fi doorbell chime & T8220 doorbell combination.
It also does not appear in your list of devices.
I encountered this in my installation process with fuatakgun's Home Assistant add-on.
I did the setup exactly as described, but in the logs it says:
2021-11-28 11:04:43.297 INFO Eufy Security server listening on port 3000
2021-11-28 11:04:44.995 INFO No stations found.
2021-11-28 11:04:45.125 INFO No devices found.
2021-11-28 11:04:45.894 INFO Push notification connection successfully established
They are on the same network as my HA device.
Looks like the account is also connected properly.
Type number WiFi chime: T8020P10212301D6, Wi-Fi Doorbell Chime
Type number doorbell: T8220P6021210810, Battery doorbell 1080P
Manufacturer Part Number (MPN) for this set: E8220311
It looks the same as the T8222 model, only the number is different: T8220.
If you would like to add the product and need some data, let me know how I can be of assistance.
Greetings, Richard
I'm running the docker container, and am receiving an emailed 2fa code when starting, but I have no idea how to get that code to the server. What am I missing?
Created for tracking issue: bropat/eufy-security-client#63
original issue: fuatakgun/eufy_security#85
You can see below start_listening
response for Entry Sensor, there are no attributes as sensor_open
or any other to rely on. I am always using this dump to initiate the sensors and then start listening events (eg: https://github.com/bropat/eufy-security-ws#sensor-open) to update its state.
I see that you are publishing this information for device added
and I think all the information published between device added
and start_listening
should be identical to create a valid state for a new device.
{
'name': 'Garage',
'model': 'T8900',
'serialNumber': 'T8900P002039XXXX',
'hardwareVersion': '0.0.1',
'softwareVersion': '0.1.0gb',
'stationSerialNumber': 'T8010N132003XXXX',
'batteryLow': False
}
Hello, I just hacked up a quick script that listens to the server and triggers other stations alarms in case a station fires an alarm event
https://gist.github.com/fourlastor/596ab614dd6a2145a29c2bcdbec66200
It's a bit rough but I thought it could be a good addition to this project!
Is there an option (send msg?) to trigger the doorbell to start recording?
For example, doorbell normally triggers on motion/persons within 5 meters. Having a hue outdoor motion sensor at the entrance of my yard at 12 meters. Would be nice to have the option to send a command to the doorbell to start recording.
Eufy suggests a similar solution with their own motion detector so maybe it is possible with some commands already..
so a third party (hue) motion sensor in HA can trigger a recording that I can see in the eufy app (just like normal recordings captured by de doorbell itself)
Almost all other properties are part of start_listening response, having this eliminate my need to call get_propeties.
I am interested this piece:
type:
value: 8
timestamp: 1627398188000
start_listening_response:
name: Entrance
model: T8113-Z
serialNumber: somevalue
hardwareVersion: T8113-Z
softwareVersion: 5.2.7
stationSerialNumber: somevalue
enabled: true
state: 1
battery: 80
batteryTemperature: 25
lastChargingDays: 8
lastChargingTotalEvents: 1105
lastChargingRecordedEvents: 364
lastChargingFalseEvents: 741
batteryUsageLastWeek: 0
motionDetected: false
personDetected: false
personName: ''
antitheftDetection: false
autoNightvision: true
ledStatus: true
motionDetection: true
rtspStream: false
watermark: 1
wifiRSSI: -44
pictureUrl: somevalue
motionDetectionType: 2
motionDetectionSensivity: 14
microphone: true
speaker: true
speakerVolume: 93
audioRecording: true
powerSource: 0
powerWorkingMode: 1
notificationType: 2
properties:
name:
value: Entrance
timestamp: 1627398188000
model:
value: T8113-Z
timestamp: 1627398188000
serialNumber:
value: somevalue
timestamp: 1627398188000
type:
value: 8
timestamp: 1627398188000
hardwareVersion:
value: T8113-Z
timestamp: 1627398188000
softwareVersion:
value: 5.2.7
timestamp: 1612754167000
stationSerialNumber:
value: somevalue
timestamp: 1627398188000
lastChargingDays:
value: 8
timestamp: 1627398188000
lastChargingFalseEvents:
value: 741
timestamp: 1627398188000
lastChargingRecordedEvents:
value: 364
timestamp: 1627398188000
lastChargingTotalEvents:
value: 1105
timestamp: 1627398188000
batteryUsageLastWeek:
value: 0
timestamp: 1627398188000
pictureUrl:
value: some value
timestamp: 1627296590000
rtspStream:
value: false
timestamp: 1615749944000
enabled:
value: true
timestamp: 1612263231000
powerSource:
value: 0
timestamp: 1612263234000
speaker:
value: true
timestamp: 1612263234000
microphone:
value: true
timestamp: 1612263234000
battery:
value: 83
timestamp: 1620280047000
motionDetectionSensivity:
value: 14
timestamp: 1615674209000
speakerVolume:
value: 93
timestamp: 1612263234000
notificationType:
value: 2
timestamp: 1615664174000
statusLed:
value: true
timestamp: 1616056809000
motionDetectionType:
value: 2
timestamp: 1615674345000
wifiRSSI:
value: -42
timestamp: 1627414690729
antitheftDetection:
value: false
timestamp: 1612263234000
motionDetection:
value: true
timestamp: 1612263234000
watermark:
value: 1
timestamp: 1612265064000
state:
value: 1
timestamp: 1619015562000
audioRecording:
value: true
timestamp: 1612263234000
autoNightvision:
value: true
timestamp: 1612263234000
powerWorkingMode:
value: 1
timestamp: 1612263236000
batteryTemperature:
value: 25
timestamp: 1620280047000
motionDetected:
value: false
timestamp: 0
personDetected:
value: false
timestamp: 0
personName:
value: ''
timestamp: 0
I was previously using JanLoebals/eufy-node-client based on his p2p example with Flask. Is it possible to utilize this web socket in Flask also? I am pretty green but figured out how to use Flask and Webcore to change my 2C and indoor 2k cameras guard mode.
the arm/disarm status stops updating after some time for my indoor cameras in home assistant.
If I open the Eufy app on my iPhone, it will updated immediately in home assistant. but will not update for any change after that.
If I restart the the Eufy Security Integration, it will start working again... but will eventually fail again.
Steps to reproduce the behavior:
apparently the push token is expiring.
here's the log for the eufy_security_addon:
Error FID Token renewal failed with error: Bad Request
error stack:
• service.ts:131 renewFidToken
node_modules/eufy-security-client/src/push/service.ts:131:23
• service.ts:155 renewPushCredentials
node_modules/eufy-security-client/src/push/service.ts:155:45
• service.ts:491 _open
node_modules/eufy-security-client/src/push/service.ts:491:32
• service.ts:510
node_modules/eufy-security-client/src/push/service.ts:510:17
2021-11-06 14:55:08.878 ERROR Push credentials renew Error:
Error FID Token renewal failed with error: Error: FID Token renewal failed with error: Bad Request
error stack:
• service.ts:135 renewFidToken
node_modules/eufy-security-client/src/push/service.ts:135:19
• service.ts:155 renewPushCredentials
node_modules/eufy-security-client/src/push/service.ts:155:45
• service.ts:491 _open
node_modules/eufy-security-client/src/push/service.ts:491:32
• service.ts:510
node_modules/eufy-security-client/src/push/service.ts:510:17
2021-11-06 14:55:08.886 ERROR Push notifications are disabled, because the registration failed!
I'm running everything on the latest home assistant OS 6.6, core-2021.11.1, supervisor-2021.10.8
I am trying to call get livestream status
and sending parameters as serial number but I am not receiving serial_number
in return construct, I need to rely on message id. It could be beneficial to reply back serial number.
Describe the bug
ERROR Stations - Generic Error
To Reproduce
I have a system with a Eufy Homebase 2 and a Eufy 2K Battery Doorbell. eufy-security-ws
is running inside a jail on my TrueNAS system (FreeBSD 12.2). Config used is pasted below
config.json
{
"username": <username>,
"password": <password>,
"persistentDir": "/usr/local/share/eufysecurity/",
"p2pConnectionSetup": 0,
"pollingIntervalMinutes": 10,
"eventDurationSeconds": 10
}
Expected behavior
No errors
Screenshots & Logfiles
2021-11-10 07:22:06.865 ERROR Stations - Generic Error:
TypeError Cannot read property 'length' of null
error stack:
• session.ts:1546 updateRawStation
usr/local/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/src/p2p/session.ts:1546:37
• session.ts:98 P2PClientProtocol
usr/local/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/src/p2p/session.ts:98:14
• station.ts:49 Station
usr/local/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/src/http/station.ts:49:27
• eufysecurity.ts:329 handleHubs
usr/local/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/src/eufysecurity.ts:329:33
• eufysecurity.ts:130 <anonymous>
usr/local/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/src/eufysecurity.ts:130:50
• events.js:400 emit
events.js:400:28
• api.ts:297 updateDeviceInfo
usr/local/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/src/http/api.ts:297:30
• eufysecurity.ts:453 refreshCloudData
usr/local/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/src/eufysecurity.ts:453:9
Versions:
Describe the bug
I tried to update to one of the newest versions 0.5.4 of the docker container,
but durcng start it crashes with fatal error.
I tried 0.5.1 , 0.5.2, 0.5.3 ...all the same
Image 0.5.0 does not crash but get the known "token error"
Fatal error in , line 0
unreachable code
FailureMessage Object: 0xffe6c8ac
Illegal instruction (core dumped)
To Reproduce
Start the Docker container
Expected behavior
Screenshots & Logfiles
Versions:
-docker container 0.5.1 - 0.5.4
Sorry that this is not a bug, but strangely I cannot find any information about this.
Is this library not supposed to work when the homebase 2 is blocked from accessing the internet? I can still use the eufy app when at home but this library just gives me the error:
ERROR P2PClientProtocol.lookup(): station: T8010XXXXXXX - All address lookup tentatives failed
I'm probably wrong, but from what I understand about the logs/code, the library tries to get the homebase local ip from one of the cloud addresses and then connects directly to it.
The problem seems to be that if the homebase has no internet access, then the cloud address returns nothing and the library doesn't connect.
Couldn't a multicast be used to find the homebase? Or maybe even easier, couldn't the library try to use the IP that eufy sent when the connection is made? From what I can see in the logs, when the connection is made eufy sends a lot of information about the cameras and homebase including the (probably last seen) local ip. Couldn't the library use that to connect for a truly offline experience?
I'm sorry in advance if what I'm saying makes no sense..
And thank you @bropat for an excellent library! and @fuatakgun for the HA integration!
Seeing this in the log of the add-on:
2021-11-29 15:55:42.730 ERROR Station runtime state error (station: T8002 channel: 2)
InvalidPropertyError Property battery invalid
details:
{
name: 'InvalidPropertyError'
}
error stack:
• device.ts:279 getPropertyMetadata
node_modules/eufy-security-client/src/http/device.ts:279:15
• eufysecurity.ts:1213 onStationRuntimeState
node_modules/eufy-security-client/src/eufysecurity.ts:1213:44
• eufysecurity.ts:347 <anonymous>
node_modules/eufy-security-client/src/eufysecurity.ts:347:150
• node:events:390 emit
node:events:390:28
• station.ts:2535 onRuntimeState
node_modules/eufy-security-client/src/http/station.ts:2535:14
• station.ts:65 <anonymous>
node_modules/eufy-security-client/src/http/station.ts:65:114
• node:events:390 emit
node:events:390:28
• session.ts:1218 handleDataControl
node_modules/eufy-security-client/src/p2p/session.ts:1218:26
• session.ts:898 handleData
node_modules/eufy-security-client/src/p2p/session.ts:898:18
• session.ts:889 parseDataMessage
node_modules/eufy-security-client/src/p2p/session.ts:889:26
2021-11-29 15:56:15.682 WARN Station T8124 - Tried all hosts, no connection could be established
2021-11-29 15:56:15.682 INFO Timeout connecting to station T8124
2021-11-29 15:57:05.745 WARN Station T8124 - Tried all hosts, no connection could be established
2021-11-29 15:57:05.746 INFO Timeout connecting to station T8124
2021-11-29 15:57:45.826 ERROR Station runtime state error (station: T8002 channel: 1)
InvalidPropertyError Property battery invalid
details:
{
name: 'InvalidPropertyError'
}
error stack:
• device.ts:279 getPropertyMetadata
node_modules/eufy-security-client/src/http/device.ts:279:15
• eufysecurity.ts:1213 onStationRuntimeState
node_modules/eufy-security-client/src/eufysecurity.ts:1213:44
• eufysecurity.ts:347 <anonymous>
node_modules/eufy-security-client/src/eufysecurity.ts:347:150
• node:events:390 emit
node:events:390:28
• station.ts:2535 onRuntimeState
node_modules/eufy-security-client/src/http/station.ts:2535:14
• station.ts:65 <anonymous>
node_modules/eufy-security-client/src/http/station.ts:65:114
• node:events:390 emit
node:events:390:28
• session.ts:1218 handleDataControl
node_modules/eufy-security-client/src/p2p/session.ts:1218:26
• session.ts:898 handleData
node_modules/eufy-security-client/src/p2p/session.ts:898:18
• session.ts:889 parseDataMessage
node_modules/eufy-security-client/src/p2p/session.ts:889:26
2021-11-29 15:58:05.757 WARN Station T8124 - Tried all hosts, no connection could be established
2021-11-29 15:58:05.758 INFO Timeout connecting to station T8124
2021-11-29 15:58:51.977 INFO Connected to station T8124 on host 172.16.5.160 and port 11294
2021-11-29 15:59:01.847 INFO Disconnected from station T8124
restarted the addon and this is the logs:
2021-11-29 16:06:05.242 INFO Eufy Security server listening on port 3000
2021-11-29 16:06:07.573 INFO Connected to station T8002 on host 172.16.5.204 and port 15235
2021-11-29 16:06:07.606 INFO Connected to station T8200 on host 172.16.5.163 and port 17178
2021-11-29 16:06:07.920 INFO Push notification connection successfully established
2021-11-29 16:06:11.945 INFO Connected to station T8124 on host 172.16.5.159 and port 15154
2021-11-29 16:06:13.436 ERROR Station runtime state error (station: T8002 channel: 1)
InvalidPropertyError Property battery invalid
details:
{
name: 'InvalidPropertyError'
}
error stack:
• device.ts:279 getPropertyMetadata
node_modules/eufy-security-client/src/http/device.ts:279:15
• eufysecurity.ts:1213 onStationRuntimeState
node_modules/eufy-security-client/src/eufysecurity.ts:1213:44
• eufysecurity.ts:347 <anonymous>
node_modules/eufy-security-client/src/eufysecurity.ts:347:150
• node:events:390 emit
node:events:390:28
• station.ts:2535 onRuntimeState
node_modules/eufy-security-client/src/http/station.ts:2535:14
• station.ts:65 <anonymous>
node_modules/eufy-security-client/src/http/station.ts:65:114
• node:events:390 emit
node:events:390:28
• session.ts:1218 handleDataControl
node_modules/eufy-security-client/src/p2p/session.ts:1218:26
• session.ts:898 handleData
node_modules/eufy-security-client/src/p2p/session.ts:898:18
• session.ts:889 parseDataMessage
node_modules/eufy-security-client/src/p2p/session.ts:889:26
2021-11-29 16:06:13.990 INFO Connected to station T8124 on host 172.16.5.161 and port 22833
2021-11-29 16:06:21.811 INFO Disconnected from station T8124
2021-11-29 16:06:23.928 INFO Disconnected from station T8124P
2021-11-29 16:06:42.490 WARN Station T8124 - Tried all hosts, no connection could be established
2021-11-29 16:06:42.491 INFO Timeout connecting to station T8124P
2021-11-29 16:06:58.286 INFO Connected to station T8124Pon host 172.16.5.160 and port 17735
2021-11-29 16:07:07.651 INFO Disconnected from station T8124
2021-11-29 16:08:33.763 ERROR Station runtime state error (station: T8002 channel: 0)
InvalidPropertyError Property battery invalid
details:
{
name: 'InvalidPropertyError'
}
0.7.0
n.a.
Docker
docker
i can view the status of the cameras connected over homebase 2 but i can't arm or disarm the system.
start the container and try to arm the system - it's not happening and after some time you can see "command aged out"
this is a generic setup there the docker container runs unmodified on a synology NAS box.
Hello,
first I tried to activate (via api and APP) person detection without video catupture. Without success.
So my next idea was so delete "old" events/video via this api like in the app... but found nothing
Any hint ?
Thank you
Hello, i'm running the docker version of this server with this command
docker run -it
-e USERNAME=user
-e PASSWORD=pw
-v "$(PWD)"/data:/data
-p 3300:3000
bropat/eufy-security-ws:latest
(by the way there is a typo in readme.md concerning the port)
Dont know if this can be linked but i use -p 3300:3000 because 3000 is already used on my host.
I tried various ws client to connect. My goal is to use Nodered.
Except eufy-security-ws-python, all other clients gets disconnected when sending "start_listening"
Here's the server log
2021-06-24 13:49:46.830 INFO Eufy Security server listening on port 3000
2021-06-24 13:49:48.093 INFO Connected to station T8010N2321061E81 on host 192.168.1.133 and port 16511
2021-06-24 13:49:48.509 INFO Push notification connection successfully established
2021-06-24 13:50:09.670 INFO Client disconnected with ip: ::ffff:172.17.0.1 port: 51244 code: 1005 reason:
And here's the Nodered Flow and debug.(There's two message in the debug Pane, because the client connects once, get disconnected and then reconnects)
Thank you for any idea
I am walking in corner/dangerous cases now, but I would like to know your opinion on this.
rtsp livestream stopped
and rtsp livestream finished
events, which would make sense, as we are not directly controlling them. For couple of minutes, streaming continues and you will not be able to stop the stream as it is not registered internally to us and you will not be able to start one, as there is already ongoing one.Can you block starting the stream when it is being enabled? so, these functions would become totally unique without overlapping functionalities. There might be software level limitation from eufy on this.
Hello,
I think it is not a bug, but I could not find the error.
Is use the latest docker version and sends via Node Red
e.g.
{
"messageId": "1",
"command": "start_listening"
}
the same to other commands
I always get on the server console
ERROR Unexpected error TypeError Cannot read property 'split' of undefined
What I am doing wrong...how could I debug the incoming message ?
Thank you
I'm trying to run this in docker. I've tried just docker and docker-compose with the same result.
Sorry if I'm doing something obviously wrong. Thanks in advance. Let me know if I can provide any other details.
I'll run something like this:
docker run -e USERNAME="username" -e PASSWORD="password" -v "/data:/data" -p "3000:3000" bropat/eufy-security-ws:latest
and I get invalid credentials everytime
2021-08-14 23:39:39.948 INFO Eufy Security server listening on port 3000
2021-08-14 23:39:40.818 ERROR Response code not ok
{
code: 26006,
msg: 'Email address or password incorrect.'
}
2021-08-14 23:39:40.832 ERROR Token error
What's interesting is that if I use the library straight like this:
eufy-security-server
I don't get an authentication error but something else.
2021-08-14 23:44:49.456 INFO Eufy Security server listening on port 3000
2021-08-14 23:44:55.041 ERROR Station T8510Q10202703D0 - Response code not ok
{
code: 20028,
msg: 'Failed to request.'
}
buffer.js:207
throw new ERR_INVALID_ARG_TYPE(
^
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined
at Function.from (buffer.js:207:11)
at stringWithLength (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/utils.js:23:35)
at p2pDidToBuffer (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/utils.js:32:18)
at Object.buildLookupWithKeyPayload (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/utils.js:36:26)
at P2PClientProtocol.lookupByAddress (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/session.js:188:33)
at cloudAddresses.map (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/session.js:172:51)
at Array.map (<anonymous>)
at P2PClientProtocol.lookup (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/session.js:172:29)
at Socket.socket.bind (/usr/lib/node_modules/eufy-security-ws/node_modules/eufy-security-client/build/p2p/session.js:247:26)
at Object.onceWrapper (events.js:286:20)
I know that it is getting past authentication in this case because if I change the password in my config.json
file, then I get this result:
eufy-security-server
2021-08-14 23:46:41.568 INFO Authentication properties changed, invalidate saved cloud token.
2021-08-14 23:46:41.701 INFO Eufy Security server listening on port 3000
2021-08-14 23:46:42.505 ERROR Response code not ok
{
code: 26006,
msg: 'Email address or password incorrect.'
}
2021-08-14 23:46:42.532 ERROR Token error
I'm noticing that eufy-security-client
does a ton of work to determine things like device type from Eufy's interval values. How difficult would it be to propagate this information down the websocket?
Example: knowing that a device is an Indoor Camera would prevent downstream libraries from having to (a) redefine all of the device types the client library shows and (b) infer device type from the properties that the websocket does provide.
I need your help to understand more on device.start_download
. I would like to download recorded videos from home base (or station) but I am not able understand cipher id
. Thanks
Thank you very much for this project. One issue I have run into is I am running 2 "eufyCam 2" but I can not see either of their battery statistics in the device details. Everything else is working flawlessly, but that one stat of each camera is missing. Is this specific to this model or have I mucked up implementation somewhere. Thank you!
Camera Details Below:
type: DEVICE_TYPE.CAMERA
category: CAMERA
state:
name: Front Yard
model: T8111
serialNumber: T8111H121941037E
hardwareVersion: HAIYI-IMX323
softwareVersion: 1.9.3
stationSerialNumber: T8001H13193500C8
enabled: true
motionDetected: false
personDetected: false
personName: ''
antitheftDetection: true
autoNightvision: true
motionDetection: true
rtspStream: false
watermark: 2
pictureUrl: >-
https://zhixin-security-pr.s3.us-west-2.amazonaws.com/xxx
type: 1
motionDetectionType: 0
microphone: true
speaker: true
audioRecording: true
powerSource: 0
powerWorkingMode: 1
recordingEndClipMotionStops: true
recordingClipLength: 60
recordingRetriggerInterval: 5
notificationType: 1
motionDetectionSensitivity: 86
statusLed: false
rtspStreamUrl: ''
chargingStatus: 2
p2pLiveStreamingStatus: false
rtspLiveStreamingStatus: false
properties:
name:
value: Front Yard
timestamp: 1638307529000
model:
value: T8111
timestamp: 1638307529000
serialNumber:
value: T8111H121941037E
timestamp: 1638307529000
type:
value: 1
timestamp: 1638307529000
hardwareVersion:
value: HAIYI-IMX323
timestamp: 1638307529000
softwareVersion:
value: 1.9.3
timestamp: 1621561266000
stationSerialNumber:
value: T8001H13193500C8
timestamp: 1638307529000
pictureUrl:
value: >-
https://zhixin-security-pr.s3.us-west-2.amazonaws.com/xxx
timestamp: 1638504051000
recordingClipLength:
value: 60
timestamp: 1638310456697
recordingRetriggerInterval:
value: 5
timestamp: 1638310456697
recordingEndClipMotionStops:
value: true
timestamp: 1638310456697
rtspStreamUrl:
value: ''
timestamp: 1638310456697
motionDetectionType:
value: 0
timestamp: 1621560464000
chargingStatus:
value: 2
timestamp: 1629688219000
watermark:
value: 2
timestamp: 1621560514000
statusLed:
value: false
timestamp: 1621560464000
autoNightvision:
value: true
timestamp: 1621560514000
powerWorkingMode:
value: 1
timestamp: 1621560524000
rtspStream:
value: false
timestamp: 1621560514000
microphone:
value: true
timestamp: 1621560514000
audioRecording:
value: true
timestamp: 1621560514000
enabled:
value: true
timestamp: 1621560464000
motionDetectionSensitivity:
value: 86
timestamp: 1621560514000
speaker:
value: true
timestamp: 1621560514000
powerSource:
value: 0
timestamp: 1621560514000
motionDetection:
value: true
timestamp: 1621560464000
antitheftDetection:
value: true
timestamp: 1629694657000
notificationType:
value: 1
timestamp: 1621560514000
motionDetected:
value: false
timestamp: 0
personDetected:
value: false
timestamp: 1638504064389
personName:
value: ''
timestamp: 1638504064389
custom:
is_streaming: false
stream_source_type: ''
stream_source_address: ''
codec: h264
is_rtsp_streaming: false
is_p2p_streaming: false
friendly_name: Front Yard
entity_picture: >-
/api/camera_proxy/camera.front_yard?token=xxx
supported_features: 3
Ok, so i have tried this with 2 different sd cards and fresh HA install.
I still get the same issue and wondering if there is something wrong with the code or files? Or docker?
I have tried uninstalling Node.js and chnaging from Latest LTS Version: 14.17.3 to Latest Current Version: 16.5.0
If i try to rerun docker:
➜ eufy-security-ws git:(master) docker run -it -e USERNAME=[email protected] -e PASSWORD=******* -v "$(pwd)"/data:/data -p 3000:3000 bropat/eufy-security-ws :latest
I get this:
docker: Error response from daemon: error while creating mount source path '/root/eufy-security-ws/data': mkdir /root/eufy-security-ws: read-only file system.
I found this command docker ps --quiet --all | xargs docker inspect --format '{{ .Id }}: ReadonlyRootfs={{ .HostConfig.ReadonlyRootfs }}'
All files show within eufy-security-ws show this: 6d762b1ada03519e679445833c0801e806dbe1b729c5173dbee8392031feadaa: ReadonlyRootfs=false
Indicating there are False which means the container’s root filesystem is writeable
https://docs.datadoghq.com/security_platform/default_rules/cis-docker-1.2.0-5.12/
Describe the bug
When I try to start two different p2p streams for two independent cameras, no response is received from second one. No errors are generated in docker output.
To Reproduce
Steps to reproduce the behavior:
1-
WebSocket message sent. {"messageId": "start_livesteam", "command": "device.start_livestream", "serialNumber": "AAA"}
on_message - {'type': 'result', 'success': True, 'messageId': 'start_livesteam', 'result': {}}
on_message - {'type': 'event', 'event': {'source': 'device', 'event': 'livestream started', 'serialNumber': 'AAA'}}
2-
WebSocket message sent. {"messageId": "start_livesteam", "command": "device.start_livestream", "serialNumber": "BBB"}
on_message - {'type': 'result', 'success': True, 'messageId': 'start_livesteam', 'result': {}}
3- Following this, if I try to turn off p2p streaming on first camera, I receive this error
LivestreamNotRunningError Livestream for device AAA is not running
Expected behavior
Being able to start multiple streams in parallel
Hi,
I am trying to get the Eufy Security Add-on working and I get the following log:
2021-11-19 20:39:27.076 INFO Authentication properties changed, invalidate saved cloud token.
2021-11-19 20:39:27.090 INFO Eufy Security server listening on port 3000
2021-11-19 20:39:27.846 INFO Switching to another API_BASE (https://security-app-eu.eufylife.com/v1) and get new token.
2021-11-19 20:39:27.901 ERROR Status return code not 200
{
status: 204,
statusText: 'No Content'
}
2021-11-19 20:39:27.904 ERROR Token error
Any idea what to do?
I see that you have quickly implemented captcha support in WS, i am trying to catch up with it :-) thanks for quick implementation
So, when docker is starting up, it tries to login and generates captcha request event so client can send the captcha. In home assistant case, docker is always running in background and integration is connected to it later on.
Please help me to find answers for these;
Security Add-on giving errors. 2FA is not enabled. Fresh Install no other Eufy addons.
2021-11-29 05:32:45.064 INFO Authentication properties changed, invalidate saved cloud token.
2021-11-29 05:32:45.081 INFO Eufy Security server listening on port 3000
2021-11-29 05:32:45.954 ERROR Response code not ok
{
code: 100032,
msg: 'Failed to request.'
}
2021-11-29 05:32:45.957 ERROR Token error
Hello, i´m a rooki in the wrapper theme. I´ve installed the eufy security ws as a docker. It works.
Bit what are the first steps? Can you explain a simple example how to access the docker station?
When i tried: 192.168.178.10:3000 i get the message connection refused
Should came a web frontend? Sorry for the rookie question...
Describe the bug
Although they were working fine before, none of my cameras are available. After checking the logs for the add-on, I see:
Restarted HA Restarted add-on Log: 2021-11-22 23:06:31.890 INFO Eufy Security server listening on port 3000 2021-11-22 23:06:36.321 INFO Connected to station T8400XXXXXXXXXXX on host 192.168.86.47 and port 27574 2021-11-22 23:06:36.346 INFO Connected to station T8410XXXXXXXXXXX on host 192.168.86.52 and port 13210 2021-11-22 23:06:36.383 INFO Connected to station T8010XXXXXXXXXXX on host 192.168.86.22 and port 21326 2021-11-22 23:06:36.416 INFO Connected to station T8021XXXXXXXXXXX on host 192.168.86.67 and port 14910 2021-11-22 23:06:36.457 INFO Connected to station T8410XXXXXXXXXXX on host 192.168.86.33 and port 20757 2021-11-22 23:06:36.991 INFO Push notification connection successfully established 2021-11-22 23:06:41.240 INFO Connected to station T8124XXXXXXXXXXX on host 192.168.86.26 and port 16848
Then after a minute or two:
2021-11-22 23:06:50.980 INFO Disconnected from station T8124XXXXXXXXXXX 2021-11-22 23:06:52.180 ERROR P2PClientProtocol.lookup(): station: T8401XXXXXXXXXXX - All address lookup tentatives failed. 2021-11-22 23:06:52.181 INFO Timeout connecting to station T8401XXXXXXXXXXX 2021-11-22 23:07:12.189 ERROR P2PClientProtocol.lookup(): station: T8401XXXXXXXXXXX - All address lookup tentatives failed. 2021-11-22 23:07:12.191 INFO Timeout connecting to station T8401XXXXXXXXXXX 2021-11-22 23:07:37.197 ERROR P2PClientProtocol.lookup(): station: T8401XXXXXXXXXXX - All address lookup tentatives failed. 2021-11-22 23:07:37.198 INFO Timeout connecting to station T8401XXXXXXXXXXX 2021-11-22 23:08:12.200 ERROR P2PClientProtocol.lookup(): station: T8401XXXXXXXXXXX - All address lookup tentatives failed. 2021-11-22 23:08:12.201 INFO Timeout connecting to station T8401XXXXXXXXXXX 2021-11-22 23:08:57.204 ERROR P2PClientProtocol.lookup(): station: T8401XXXXXXXXXXX - All address lookup tentatives failed. 2021-11-22 23:08:57.205 INFO Timeout connecting to station T8401XXXXXXXXXXX
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Sorta expected to see my cameras
Screenshots & Logfiles
Logfiles posted above.
Versions:
Additional context
Add any other context about the problem here.
Describe the bug
I've set-up a script in Home Assistant that calls 'start_livestream' targeted at my Eufy 2k Wired doorbell, however most of the time when I trigger this script I get the below error in bropat/eufy-security-ws logs:
2021-08-18 14:32:15.041 ERROR Message error
LivestreamNotRunningError Start of livestream for device T8200N0XXXXXXXXX was not also requested by this client
details:
{
name: 'LivestreamNotRunningError'
�������
m
error stack:
• message_handler.ts:139 handle
src/lib/device/message_handler.ts:139:31
• server.ts:46 device
src/lib/server.ts:46:34
• server.ts:98 receiveMessage
src/lib/server.ts:98:58
• server.ts:57 <anonymous>
src/lib/server.ts:57:53
• events.js:400 emit
events.js:400:28
• websocket.js:1009 receiverOnMessage
node_modules/ws/lib/websocket.js:1009:20
• events.js:400 emit
events.js:400:28
• receiver.js:522 dataMessage
node_modules/ws/lib/receiver.js:522:14
• receiver.js:440 getData
node_modules/ws/lib/receiver.js:440:17
• receiver.js:148 startLoop
Occasionally it does work but mostly not. The stream always seems to start when the docker (bropat/eufy-security-ws) is restarted - in fact I've noticed that the doorbell seems to automatically start streaming as soon as bropat/eufy-security-ws is started. Because of this, maybe I can't always properly STOP the stream using Home Assistant as the "start stream" command didn't come from Home Assistant...? aka "was not also requested by this client" from the error log.
I've even tried calling 'stop_livestream' , waiting a few seconds and then calling 'start_livestream' but still same issue and no stream starts.
Expected behaviour
I expect the livestream to start when triggered so that I can view the video stream on my Home Assistant dashboard whenever I wish.
Versions:
I also have encountered the below error in the logs when attempting to start livestream:
2021-08-16 20:15:31.029 WARN Station T8200N0XXXXXXXXX - Result data for command not received
{
message: {
sequence: 34,
command_type: 1700,
nested_command_type: 1000,
channel: 0,
data: <Buffer d1 00 00 22 58 5a 59 48 a4 06 74 01 00 00 01 00 00 00 00 00 7b 22 63 6f 6d 6d 61 6e 64 54 79 70 65 22 3a 31 30 30 30 2c 22 64 61 74 61 22 3a 7b 22 61 ... 342 more bytes>,
retries: 1,
acknowledged: true,
return_code: -133,
timeout: Timeout {
_idleTimeout: 20000,
_idlePrev: null,
_idleNext: null,
_idleStart: 217867957,
_onTimeout: [Function (anonymous)],
_timerArgs: undefined,
_repeat: null,
_destroyed: false,
[Symbol(refed)]: true,
[Symbol(kHasPrimitive)]: false,
[Symbol(asyncId)]: 27024870,
[Symbol(triggerId)]: 5643274
}
}
}
Describe the bug
When calling stop_rtsp_livestream
, docker throws error as
ERROR Station stop rtsp livestream error (station: T8010N2320460480 channel: -1)
DeviceNotFoundError No device with channel -1 found on station with serial number: T8010N2320460480!
details:
{
name: 'DeviceNotFoundError'
}
error stack:
• eufysecurity.ts:280 getStationDevice
node_modules/eufy-security-client/src/eufysecurity.ts:280:15
• eufysecurity.ts:1081 onStopStationRTSPLivestream
node_modules/eufy-security-client/src/eufysecurity.ts:1081:33
• eufysecurity.ts:341 <anonymous>
node_modules/eufy-security-client/src/eufysecurity.ts:341:95
• events.js:400 emit
events.js:400:28
• station.ts:475 onStopRTSPLivestream
node_modules/eufy-security-client/src/http/station.ts:475:14
• station.ts:62 <anonymous>
node_modules/eufy-security-client/src/http/station.ts:62:81
• events.js:400 emit
events.js:400:28
• session.ts:1444 endRTSPStream
node_modules/eufy-security-client/src/p2p/session.ts:1444:18
• session.ts:561 _sendCommand
node_modules/eufy-security-client/src/p2p/session.ts:561:26
• session.ts:436 sendQueuedMessage
node_modules/eufy-security-client/src/p2p/session.ts:436:22
Steps
{"messageId": "start_rtsp_livestream", "command": "device.start_rtsp_livestream", "serialNumber": "T8113N63205018FC"}
rtsp livestream started
event{'type': 'event', 'event': {'source': 'device', 'event': 'rtsp livestream started', 'serialNumber': 'T8113N63205018FC'}}
rtsp livestream stopped
eventExpected behavior
Do not throw and error and fire rtsp livestream stopped
event to client
Versions:
Additional context
Related issue: fuatakgun/eufy_security#59
Hello,
I tried to set the guard mode "to geofencing control", but I did not find the right command.
Any hint ?
Thank you
wrong repo
The Eufy Security Websockets server allows a pretty large control over the used cameras. However, apart from setting the port and a permission limited eufy cloud user, there is no possibility to secure it. As it is also as a base for other projects I fear that security issues might arise.
Therefore, I ask for two new features:
Describe the bug
When attempting to add this repository to the custom HACS repositories an error is produced.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
An Error is produced:
Repostitory structure for 0.3.2 is not compliant
Versions:
Additional context
na
Hey,
Thanks for this tool, which I've just discovered.
What I want to achieve is running pan & tilt commands through SSH. I've successfully managed to run the server and the client, and the command to pan & tilt, using the client interface. Unfortunately, I haven't found a way to start the client and run a command automatically, without manual user input. What I'd like to do is something like eufy-security-client 'device.pan_and_tilt DEVICE_SN 0'
, so that it starts client and directly run said command, then exits. Is it something I can do with this tool?
Thanks! ✌️
Hi @bropat
I was trying to create a slider for the speaker volume control, but it doesn't work and I get an error. How can I solve?
service: eufy_security.send_message
data:
message: | -
{
"messageId": "cmdspeakerVolume",
"command": "device.set_property",
"serialNumber": "T8410PXXX",
"name": "speakerVolume",
"value": {{states (" input_number.eufy_camera_salone_speakervolume ") | round}}
}
Thanks
Describe the bug
when I run "src/bin/server.ts --config ./config.json"
get the following error:
(node:2519) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
/opt/eufy-security-ws/src/bin/server.ts:3
import { resolve } from "path";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Program should start
Screenshots & Logfiles
see errors above
Versions:
Additional context
Worked great yesterday. Awesome work. This morning... it won't startup.
Hi,
just installed the container and hopefully i'm doing something wrong. Server is up and i can connect at port 3000 but no device is showed.
When i look and the container log i see:
_currentUrl: 'https://mysecurity.eufylife.com/api/v1/passport/login',
[Symbol(kCapture)]: false
},
response: undefined,
isAxiosError: true,
toJSON: [Function: toJSON]
}
error stack:
• dns.js:71 onlookup
dns.js:71:26
2021-11-08 11:37:45.088 ERROR Status return code not 200
{
status: undefined,
statusText: undefined
}
2021-11-08 11:37:45.089 ERROR Token error
Can you please help?
Thank you!
I've tried to get it running with Docker but unfortunately i didn't get it work. I think the problem is that i have an Eufy EU Account which has a different API Uri.
Global API:
https://mysecurity.eufylife.com/api/v1/passport/login
EU API:
https://mysecurity.eufylife.com/apieu/v2/passport/login
It should be possible to configure this by environment variable.
Description
On all my cameras i have working mode set to "Optimal Battery Life". But when i leaving house or going to sleep it will be nice set all my cameras to "Optimal Surveillance" mode. But Eufy native global security modes (Home, Away ...) doesn't have this functionality.
Desired behavior
Ability to setup "working mode" (from Power Manager) per camera via HA services call. Then i can setup desired functionality with automation/node red.
P.S.: I dont know if Eufy API has capability for this functionality.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.