Snapshot caméra dans un même mail ?
Snapshot caméra dans un même mail ?
Bonjour,
J'ai ajouté mes 6 caméras sur Domoticz, et dans un événement blocky je veux recevoir un snapshot de celles-ci mais c'est un mail par caméra soit 6 mails, et t'il possible de les regrouper pour avoir les 6 captures dans un seul mail ?
Merci
J'ai ajouté mes 6 caméras sur Domoticz, et dans un événement blocky je veux recevoir un snapshot de celles-ci mais c'est un mail par caméra soit 6 mails, et t'il possible de les regrouper pour avoir les 6 captures dans un seul mail ?
Merci
Dernière modification par titis14 le 15 janv. 2019, 20:29, modifié 1 fois.
Re: Snapshot caméra dan un même mail ?
C'est vrais que ce serais pratique
De base non, ce n'est pas possible : 1 photo par cam et par mail
Maintenant, il y a surement moyen de le faire en script Lua, si quelqu'un a une idée, merci.
De base non, ce n'est pas possible : 1 photo par cam et par mail
Maintenant, il y a surement moyen de le faire en script Lua, si quelqu'un a une idée, merci.
Domoticz Stable V4.9700 sur Synology DSM 6.2 / 2 x RFlink V48.4 - 433.92MHz(Dio/Chacon) & 433.42MHz(RTS) / Script en LUA & Blocky
Re: Snapshot caméra dans un même mail ?
Oui si quelqu'un à une base
car perso les scripts je suis pas très bon en codage.
Merci
Merci
Re: Snapshot caméra dans un même mail ?
Le script DZvents suivant envoie un mail avec la liste des PIRs et 3 photos en PJ récupérées sur MotionEye.titis14 a écrit : 15 janv. 2019, 20:29 Oui si quelqu'un à une basecar perso les scripts je suis pas très bon en codage.
Merci
Code : Tout sélectionner
return {
active = true,
on = {
devices =
{'Alarme'},
},
execute = function(domoticz,alarme)
if alarme.state == 'On' then
domoticz.log("Activation de l'alarme", LOG_INFO)
pirs = ""
domoticz.devices().forEach(function(device)
if (string.find(device.name,"PIR") or string.find(device.name,"REED")) then
pirs = pirs .. device.name.." "..device.state..", \n"
end
end)
domoticz.log("Etat pir "..pirs, LOG_INFO)
os.execute('wget -O "/var/tmp/cam1.jpg" http://192.168.15.1:8765/picture/1/current/')
os.execute('wget -O "/var/tmp/cam2.jpg" http://192.168.15.1:8765/picture/2/current/')
os.execute('wget -O "/var/tmp/cam3.jpg" http://192.168.15.1:8765/picture/3/current/')
os.execute('(echo '..pirs..' && uuencode /var/tmp/cam1.jpg cam1.jpg && uuencode /var/tmp/cam2.jpg cam2.jpg && uuencode /var/tmp/cam3.jpg cam3.jpg )| mail -s "ALARME" "monadresse@caramail.com" &')
else
domoticz.log("Désactivation de l'alarme", LOG_INFO)
end
end
}
Si ça peut vous aider
Re: Snapshot caméra dans un même mail ?
Merci, je vais regarder ça, on a maintenant une base.
Re: Snapshot caméra dans un même mail ?
Bonjour,
Je me suis remis sur ça, j'ai bien mis le script et activé mon Device Alarme, dans les logs tout à l'air bon, mais je n'ai pas reçu le mail avec les photos.
J'ai bien installer uuencode qui s’installe par sharutils.
Voici les logs et script si vous avez une idée merci.
Je me suis remis sur ça, j'ai bien mis le script et activé mon Device Alarme, dans les logs tout à l'air bon, mais je n'ai pas reçu le mail avec les photos.
J'ai bien installer uuencode qui s’installe par sharutils.
Voici les logs et script si vous avez une idée merci.
Code : Tout sélectionner
2019-01-28 09:50:29.190 OpenZWave: Domoticz has send a Switch command! NodeID: 2 (0x02)
2019-01-28 09:50:29.197 (OpenZwave) Light/Switch (Alarme)
2019-01-28 09:50:29.190 Status: User: sebr initiated a switch command (125/Alarme/On)
2019-01-28 09:50:29.259 Status: dzVents: Info: Handling events for: "Alarme", value: "On"
2019-01-28 09:50:29.259 Status: dzVents: Info: ------ Start internal script: Alarme_cam: Device: "Alarme (OpenZwave)", Index: 125
2019-01-28 09:50:29.259 Status: dzVents: Info: Activation de l'alarme
2019-01-28 09:50:29.271 Status: dzVents: Info: Etat pir
2019-01-28 09:50:31.449 Status: dzVents: Info: ------ Finished Alarme_cam
2019-01-28 09:50:41.049 OpenZWave: Domoticz has send a Switch command! NodeID: 2 (0x02)
2019-01-28 09:50:41.056 (OpenZwave) Light/Switch (Alarme)
2019-01-28 09:50:41.048 Status: User: sebr initiated a switch command (125/Alarme/Off)
2019-01-28 09:50:41.119 Status: dzVents: Info: Handling events for: "Alarme", value: "Off"
2019-01-28 09:50:41.119 Status: dzVents: Info: ------ Start internal script: Alarme_cam: Device: "Alarme (OpenZwave)", Index: 125
2019-01-28 09:50:41.119 Status: dzVents: Info: Désactivation de l'alarme
2019-01-28 09:50:41.119 Status: dzVents: Info: ------ Finished Alarme_camreturn {
active = true,
on = {
devices =
{'Alarme'},
},
execute = function(domoticz,alarme)
if alarme.state == 'On' then
domoticz.log("Activation de l'alarme", LOG_INFO)
pirs = ""
domoticz.devices().forEach(function(device)
if (string.find(device.name,"PIR") or string.find(device.name,"REED")) then
pirs = pirs .. device.name.." "..device.state..", \n"
end
end)
domoticz.log("Etat pir "..pirs, LOG_INFO)
os.execute('wget -O "/var/tmp/cam1.jpg" http://192.168.1.24:80/jpg/image.jpg')
os.execute('wget -O "/var/tmp/cam2.jpg" http://192.168.1.25:80/jpg/image.jpg')
os.execute('(echo '..pirs..' && uuencode /var/tmp/cam1.jpg cam1.jpg && uuencode /var/tmp/cam2.jpg cam2.jpg )| mail -s "ALARME" "mail@outlook.com" &')
else
domoticz.log("Désactivation de l'alarme", LOG_INFO)
end
end
}
Re: Snapshot caméra dans un même mail ?
Il faut que la commande mail fonctionne.
http://www.ced-info.com/administration- ... avec-ssmtp
http://www.ced-info.com/administration- ... avec-ssmtp
Re: Snapshot caméra dans un même mail ?
Merci à toi je vais tester cela.Neutrino a écrit : 28 janv. 2019, 10:21 Il faut que la commande mail fonctionne.
http://www.ced-info.com/administration- ... avec-ssmtp
Re: Snapshot caméra dans un même mail ?
Le fichier de config à changé, je ne peux pas entrer les identifiants pour l'authentification.
Si je veux installe mailx apparement il faut choisir entre 3 paquets# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=postmaster
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=ssl0.ovh.net:465
# Where will the mail seem to come from?
#rewriteDomain=
# The full hostname
hostname=debian
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
#FromLineOverride=YES
user@debian:~$ sudo apt-get install mailx
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
Package mailx is a virtual package provided by:
mailutils 1:2.99.98-2
heirloom-mailx 12.5-4
bsd-mailx 8.1.2-0.20141216cvs-2
You should explicitly select one to install.
Re: Snapshot caméra dans un même mail ?
C'est bon j'ai réussi, j'ai ajouté les infos à la main.
Quand je reçois le mail l'expéditeur c'est "root" on peux changer ça ?
j'ai regardé dans les fichiers de config on peux autoriser le changement, du coup dans le script j'ai trouvé ceux-ci pour ajouter from
Merci
Quand je reçois le mail l'expéditeur c'est "root" on peux changer ça ?
j'ai regardé dans les fichiers de config on peux autoriser le changement, du coup dans le script j'ai trouvé ceux-ci pour ajouter from
Mais quand j'ajoute l'option -r ça ne fonctionne plus.5. Specify From name and address
To specify a "FROM" name and address, use the "-r" option. The name should be followed by the address wrapped in "<>".
$ echo "This is message body" | mail -s "This is Subject" -r "Harry<harry@gmail.com>" someone@example.com
Merci
Dernière modification par titis14 le 28 janv. 2019, 16:40, modifié 1 fois.