EufyCam E : set security mode fom domoticz

Moderator: leecollings

multinet
Posts: 97
Joined: Friday 05 December 2014 22:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: EufyCam E : set security mode fom domoticz

Post by multinet »

Hello

On my side scripts still running well

Multinet
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
wishmaster84
Posts: 4
Joined: Thursday 25 October 2018 8:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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.
multinet
Posts: 97
Joined: Friday 05 December 2014 22:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: EufyCam E : set security mode fom domoticz

Post by multinet »

Do you run the scripts via dzventz ?
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
phyllox
Posts: 2
Joined: Thursday 28 January 2021 12:39
Target OS: Linux
Domoticz version:
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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
djalexnl
Posts: 18
Joined: Sunday 12 August 2018 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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....
phyllox
Posts: 2
Joined: Thursday 28 January 2021 12:39
Target OS: Linux
Domoticz version:
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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.
djalexnl
Posts: 18
Joined: Sunday 12 August 2018 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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...??
rudolfpi
Posts: 8
Joined: Monday 19 March 2018 18:17
Target OS: Linux
Domoticz version:
Contact:

Re: EufyCam E : set security mode fom domoticz

Post by rudolfpi »

Any instructions for installing it on Ubuntu?
HM31
Posts: 56
Joined: Friday 04 August 2017 16:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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
HM31
Posts: 56
Joined: Friday 04 August 2017 16:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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
Kyrille
Posts: 14
Joined: Sunday 19 January 2020 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.01
Location: France
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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
Raspberry Pi 4 (8GB) & 3B+ (buster) / Conbee II / Z-Stick Gen 5 / RFXCOM 433 XL / Domoticz 2020.02
Pi zero 2 ordered
Kyrille
Posts: 14
Joined: Sunday 19 January 2020 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.01
Location: France
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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.
Raspberry Pi 4 (8GB) & 3B+ (buster) / Conbee II / Z-Stick Gen 5 / RFXCOM 433 XL / Domoticz 2020.02
Pi zero 2 ordered
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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?
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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?
Hans
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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)

manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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.
Hans
Kyrille
Posts: 14
Joined: Sunday 19 January 2020 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.01
Location: France
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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.
Raspberry Pi 4 (8GB) & 3B+ (buster) / Conbee II / Z-Stick Gen 5 / RFXCOM 433 XL / Domoticz 2020.02
Pi zero 2 ordered
manjh
Posts: 708
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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...
Hans
Kyrille
Posts: 14
Joined: Sunday 19 January 2020 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.01
Location: France
Contact:

Re: EufyCam E : set security mode fom domoticz

Post 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...
Raspberry Pi 4 (8GB) & 3B+ (buster) / Conbee II / Z-Stick Gen 5 / RFXCOM 433 XL / Domoticz 2020.02
Pi zero 2 ordered
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests