Bonjour,
Je possède depuis plus d’un an les excellente caméra Eufycam E et il existe enfin un moyen de les intégrer à Jeedom à l’aide de scripts python. Par contre l’intégration permet juste de choisir le mode de sécurité des caméras (Absent, Maison, Désarmé & Programme), mais c’est déjà bien et suffisant pour moi. De plus en intégrant le flux RTSP dans le plugin Motion, Jeedom détecte l’activation des caméras et exécute ensuite des scenarios ou envoie des notifications par sms ou par mail avec photo.
Donc pour faire l’intégration des caméras, j’ai suivi la solution expliquée sur le forum Domoticz https://www.domoticz.com/forum/viewtopic.php?t=33241, que je rappel ci-dessous en adaptant à Jeedom:
1- Installer python version 3.6 mini. J’ai installé la version 3.7.3 en suivant le tuto suivant https://community.jeedom.com/t/recherche-dev-pour-un-nouveau-plugin-lg-smart/2932/88
2- Avec Putty, se connecter à la box Jeedom et télécharger la bibliothèque python eufy security avec la commande:
wget https://github.com/keshavdv/python-eufy-security/archive/p2p.zip
3- Extraire le fichier zip par la commande:
unzip p2p.zip
4- lancer l’installation à l’aide des 2 commandes :
sudo pip3 install python-eufy-security
sudo pip3 install -r requirements_test.txt
5- Aller dans le dossier /usr/local/lib/python3.7/site-packages/ et renomer le dossier eufy_security en eufy_security.OLD
6- Copier le dossier eufy_security de l’archive de l’étape 3 dans le dossier /usr/local/lib/python3.7/site-packages/ avec la commande :
cp -R /"chemin du dossier telecharger"/eufy_security /usr/local/lib/python3.7/site-packages
7- Copier le dossier eufy_security de l’archive de l’étape 3 dans le dossier /usr/local/lib/python3.7/dist-packages (j’ai créer le dossier dist-packages car il n’éxistait pas chez moi, du coup je doute que cette étape soit indispensable)
8- Créer les scripts de sécurité des caméras et les copier dans le dossier /home/Eufy par exemple. Pour chaque script, précisé l’adresse mail et mot de passe d’un compte invité Eufy lié à votre compte principale Eufy.
**** Script Maison.py
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.DEBUG)
EUFY_EMAIL = "your_email_eufy"
EUFY_PASSWORD = "your_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("------------------")
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())
**** Script Absent.py
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.DEBUG)
EUFY_EMAIL = "your_email_eufy"
EUFY_PASSWORD = "your_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("------------------")
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.AWAY, session)
await asyncio.sleep(10)
asyncio.get_event_loop().run_until_complete(main())
**** Script Desarme.py
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.DEBUG)
EUFY_EMAIL = "your_email_eufy"
EUFY_PASSWORD = "your_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("------------------")
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.DISARMED, session)
await asyncio.sleep(10)
asyncio.get_event_loop().run_until_complete(main())
**** Script Programme.py
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.DEBUG)
EUFY_EMAIL = "your_email_eufy"
EUFY_PASSWORD = "your_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("------------------")
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.SCHEDULE, session)
await asyncio.sleep(10)
asyncio.get_event_loop().run_until_complete(main())
9- Dans le plugin Script de Jeedom créer 4 scripts type action/defaut pointant sur les 4 scripts de sécurité:
absent.sh : /usr/local/bin/python3.7 /home/Eufy/absent.py
maison.sh : /usr/local/bin/python3.7 /home/Eufy/maison.py
desarme.sh : /usr/local/bin/python3.7 /home/Eufy/desarme.py
programme.sh : /usr/local/bin/python3.7 /home/Eufy/programme.py
Et voilà, avec ça vous êtes en mesure de choisir le mode de sécurité des caméras.
N’y connaissant rien en programmation, j’ai bien galéré à faire l’intégration mais au final ça marche et j’en suis bien content car ça fait un moment que je cherchais une solution.