Page 2 of 3

Re: EufyCam E : set security mode fom domoticz

Posted: Wednesday 27 January 2021 6:56
by multinet
Hello

On my side scripts still running well

Multinet

Re: EufyCam E : set security mode fom domoticz

Posted: Wednesday 27 January 2021 21:00
by wishmaster84
Thanks for the info. No idea why mine has stopped working but good to know it's not the scripts. I'll troubleshoot on my end.

Re: EufyCam E : set security mode fom domoticz

Posted: Thursday 28 January 2021 9:22
by multinet
Do you run the scripts via dzventz ?

Re: EufyCam E : set security mode fom domoticz

Posted: Thursday 28 January 2021 12:59
by phyllox
Hello

I am very grateful to everyone who participated in this solution to change the mode of Eufy cams. It works perfectly on my system. I am not using DomoticZ, but the French home automation software, Jeedom, but it has been very easy to adapt this great solution to Jeedom, since I am with a Debian 10 machine with therefore Python 3.7 preinstalled. I also tested DomoticZ before I started and hesitated between the 2 softwares during a long time.

As there is no support for Eufycams on Jeedom forum, I subscribed to this one, because I have a couple of questions.

1°) I would like to know if there is a way to have a script for a new specific mode I created with Eufy software, and is the most adapted to my needs. Let's say I called it Bill. I suppose that Eufy will not call it Bill, as I see there is no relationship between the mode name I see in the software (for me in French) and the one that is used in the script. Does somebody know if there is a way to know the name Eufy gave to a new created mode that could be used in a new script ?

2°) Although I fear there is no solution for this - and Eufy confirmed to me that they have no project to work on an open API for the moment - coult it exist a way to start live viewing fwith a script (or something similar), I mean from DomiticZ or Jeedom or whatever is the home automation software ?

Thanks in advance for a reply

Re: EufyCam E : set security mode fom domoticz

Posted: Friday 12 February 2021 0:07
by djalexnl
"""Create the aiohttp session and run the example."""
^
IndentationError: expected an indented block

Anyone knows how to fix this error?

Thanx from a python newbie....

Re: EufyCam E : set security mode fom domoticz

Posted: Friday 12 February 2021 10:50
by phyllox
Hello @djalexnl
I'am also a Python newbie, but I read and experimented that this message should occur when the code indentation is not correct. Python requests that Indentation be done with four spaces (8, 12, 16...) and NOT with tab. You should check each source line and check if indentation is done with spaces and is correct everywhere.

Re: EufyCam E : set security mode fom domoticz

Posted: Friday 12 February 2021 20:29
by djalexnl
I figured it out, the format of the code in the post was incorrect. After lots of reading i noticed it.

Code: Select all

import asyncio
import logging
import os

from aiohttp import ClientSession

from eufy_security import async_login
from eufy_security.types import GuardMode

logging.basicConfig(level=logging.ERROR)
# CRITICAL
# ERROR
# WARNING
# INFO
# DEBUG
# NOTSET

EUFY_EMAIL = "EUFY_EMAIL"
EUFY_PASSWORD = "EUFY_PASSWORD"

async def main() -> None:
	"""Create the aiohttp session and run the example."""
	async with ClientSession() as websession:
		# Create an API client:
		api = await async_login(EUFY_EMAIL, EUFY_PASSWORD, websession)

		for station in api.stations.values():
			print("--ARMEMENT DE LA MAISON : PASSAGE EN MODE ABSENT--")
			print(f"Station Name: {station.name}")
			print(f"Serial Number: {station.serial}")
			# print(f"Station params: {station.params}")
			print(f"Station type: {station.device_type}")

			async with station.connect() as session:
				await station.set_guard_mode(GuardMode.HOME, session)
				await asyncio.sleep(10)


asyncio.get_event_loop().run_until_complete(main())
Also you need to create a second account in the eufy app wich you use for changing the mode... this account without 2 steps authentication .. .otherwise you cannot login .... well it works now.... yeahhhhh

Only thing i run into when i run the python script is that it doesnt return to the prompt when it is started, its like its just sits there waiting... how can it automaticly return to the prompt...??

Re: EufyCam E : set security mode fom domoticz

Posted: Saturday 20 February 2021 13:56
by rudolfpi
Any instructions for installing it on Ubuntu?

Re: EufyCam E : set security mode fom domoticz

Posted: Tuesday 06 July 2021 18:25
by HM31
multinet wrote: Saturday 10 October 2020 15:19
diskhub wrote: Wednesday 30 September 2020 12:26 What's the enum value for the GeoFencing guard mode?
No but if you found it please share it
GEOFENCING = "47"

Found it in the more recent dev branch in file types.py (https://github.com/FuzzyMistborn/python ... y/types.py

Re: EufyCam E : set security mode fom domoticz

Posted: Tuesday 06 July 2021 18:30
by HM31
rudolfpi wrote: Saturday 20 February 2021 13:56 Any instructions for installing it on Ubuntu?
From my point of view, download the latest files in dev branch repository : https://github.com/FuzzyMistborn/python ... ds/dev.zip

Unzip in a folder named eufy_security and do a

Code: Select all

pip3 install eufy_security/
or

Code: Select all

sudo pip3 install eufy_security/
depending of the installation scope you want (user python cache or system wide).

I think i did it that way on Mint

Re: EufyCam E : set security mode fom domoticz

Posted: Wednesday 03 November 2021 0:52
by Kyrille
Awesome ! I have to try that !

By the way, to answer @phyllox it seems that your mode is called CUSTOM1 (or 2 or 3) when looking in this file: https://github.com/FuzzyMistborn/python ... y/types.py

Re: EufyCam E : set security mode fom domoticz

Posted: Wednesday 03 November 2021 13:58
by Kyrille
It is working like a charm, thank you very much !

I just needed to add async_generator package which was not there initially.

Re: EufyCam E : set security mode fom domoticz

Posted: Saturday 27 November 2021 15:14
by MikeF
Has anyone had any luck using the original python library here: https://github.com/FuzzyMistborn/python-eufy-security to capture RTSP streams from Eufy cams / doorbells? I'm currently using an Indoor Cam 2K and Indoor Cam 2K Pan & Tilt.

The python example runs, and for each camera it displays 'Starting RTSP Stream', followed by a stream URL, followed immediately by 'Stopping RTSP Stream'. When I load the URL into VLC it is of zero length. It appears as if the commands 'await camera.async_start_stream()' and 'await camera.async_stop_stream()' are ignored.

Any clues, please?

Re: EufyCam E : set security mode fom domoticz

Posted: Friday 30 December 2022 0:25
by Derik
Hi... Old topic..
Onlu i will buy a Eufycam.. [ or are there better solutions? ]

Perhaps some can tell me or all the types are working in Domoticz?
Without special options just settings and running?

Re: EufyCam E : set security mode fom domoticz

Posted: Thursday 08 June 2023 21:09
by manjh
Indeed, old topic, but since the Eufy system is getting more and more popular, I am surprised there is not more activity on this topic in the forum...

Anyone engaged in this?

Re: EufyCam E : set security mode fom domoticz

Posted: Friday 09 June 2023 18:12
by MikeF
Here's a bash script I wrote, which I've linked to a pushbutton switch in Domoticz.

It uses ffmpeg to capture a single frame (i.e., snapshot), saves it, and sends it as a notification to Pushover. The 'sleep 5' command is to allow time for the file to be saved (I've found that reducing it to 2 or 3 seconds doesn't work - I get a 6656 error). Replace the bits in <> brackets.
Spoiler: show

Code: Select all

#!/bin/bash

# Get snapshot

filename="/home/pi/devices/snapshots/eufy_P24_"$(date "+%Y_%m_%d_%H_%M_%S")".jpg"
user="<eufy camera username>"
password="<eufy camera password>"

ffmpeg -y -loglevel quiet -rtsp_transport tcp \
	-i rtsp://${user}:${password}@<camera IP address>/live0 -frames:v 1 ${filename}

sleep 5

# Send to Pushover

USERKEY="<Pushover user key>"
APIKEY="<Pushover API key>"
MSG="Front view"
SOUND="Doorbell"
IMAGE=$filename

STATUS=$(curl -s --form-string "token=$APIKEY" --form-string "user=$USERKEY" \
	--form-string "message=$MSG" --form-string "sound=$SOUND" \
	-F "attachment=@$IMAGE" \
	https://api.pushover.net/1/messages.json)


Re: EufyCam E : set security mode fom domoticz

Posted: Wednesday 16 August 2023 11:15
by manjh
I've tried to implement the method as mentioned, but it's not clear.
Any chance of someone posting a new, step-by-step, method?
I am not looking to link any camer's, just want to be able to set the appropriate security mode in the Eufy Homebase.

Re: EufyCam E : set security mode fom domoticz

Posted: Monday 21 August 2023 8:47
by Kyrille
Hello, I was using the approach/scripts from multinet but it is not maintened anymore.

It seems that we should be able to play with a newer client library via a websocket : https://bropat.github.io/eufy-security- ... ecurity-ws.

Re: EufyCam E : set security mode fom domoticz

Posted: Thursday 24 August 2023 17:21
by manjh
Kyrille wrote: Monday 21 August 2023 8:47 Hello, I was using the approach/scripts from multinet but it is not maintened anymore.

It seems that we should be able to play with a newer client library via a websocket : https://bropat.github.io/eufy-security- ... ecurity-ws.
I got past the install part, but am puzzled about the rest. There is a "try it out" part, but I can't see how this translates into commands for the Pi...

Re: EufyCam E : set security mode fom domoticz

Posted: Sunday 27 August 2023 23:20
by Kyrille
Yes, everybody is enjoying Eufy devices with Jeedom or HomeAssistant thanks to a good integration of bropat client & websocket packages, but nothing for Domoticz. :-(
Will try to investigate...