Echanges sur Frigate

Comment fais tu cette partie?

Normalement, suivant MQTT | Frigate il est publié le snapshot sur frigate/<camera_name>/<object_name>/snapshot#

Après, il « suffit » de le récupérer dans NodeRed et de l’ajouter dans l’appel à Telegram.
Cette partie là dépend du noeud d’interface avec telegram choisi.

Bonsoir,

Désolé pour ma réponse tardive mais je n’avais pas vu la votre.
Pour le moment c’est très basique :
[{"id":"0f79f01865322611","type":"api-call-service","z":"aa35e85bb4c621a6","name":"Notification","server":"349b30c3.ad274","version":5,"debugenabled":false,"domain":"notify","service":"telegram_groupe_alarm","areaId":[],"deviceId":[],"entityId":[],"data":"{\"title\":\"Alarme\",\"message\":\"Intrusion detectée\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":530,"y":440,"wires":[[]]},{"id":"b35860999e5ebf54","type":"server-state-changed","z":"aa35e85bb4c621a6","name":"Si mouvement caméra coté entrée","server":"349b30c3.ad274","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.entree_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":260,"wires":[["daf4012fa382a56c"],[]]},{"id":"daf4012fa382a56c","type":"api-current-state","z":"aa35e85bb4c621a6","name":"Si mode nuit ou alarme","server":"349b30c3.ad274","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"input_boolean.mode_presence","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":330,"y":360,"wires":[["0f79f01865322611"],[]]},{"id":"349b30c3.ad274","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

Je crois que je suis mal barré… Je ne vois même pas comment afficher le snapshot pour obtenir ces infos :frowning:

Bonjour,

il faut utiliser une fonction et le service send_photo de telegram.
je te donne le flow qui fonctionne bien, a toi de changer l’entitée caméra :

[{"id":"02cfc8d39d27b4e4","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"24a6e02763fc909d","type":"server-state-changed","z":"02cfc8d39d27b4e4","name":"Camera 01 Motion","server":"2c5088ebae4d463e","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.camera_01_cell_motion_detection","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":190,"y":140,"wires":[["7dd5f71775cfdced"],[]]},{"id":"7dd5f71775cfdced","type":"api-current-state","z":"02cfc8d39d27b4e4","name":"Armed away?","server":"2c5088ebae4d463e","version":3,"outputs":2,"halt_if":"armed_away","halt_if_type":"str","halt_if_compare":"is","entity_id":"alarm_control_panel.alarmo","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":440,"y":140,"wires":[["4792c2346dfcbc18"],[]]},{"id":"4792c2346dfcbc18","type":"api-call-service","z":"02cfc8d39d27b4e4","name":"Snapshot Cam01","server":"2c5088ebae4d463e","version":5,"debugenabled":false,"domain":"camera","service":"snapshot","areaId":[],"deviceId":["6c139e0f85a17fd981b3581ef9500122"],"entityId":["camera.camera_01"],"data":"{\t   \"filename\": \"/config/www/cam01_snapshot.jpg\"\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":690,"y":140,"wires":[["a22c85f9542552f0"]]},{"id":"a22c85f9542552f0","type":"function","z":"02cfc8d39d27b4e4","name":"Msg Cam01","func":"msg.filename = '/config/www/cam01_snapshot.jpg';\nmsg.payload = { \n data: {\n type: 'photo',\n file: '/config/www/cam01_snapshot.jpg',\n caption: 'Snapshot from camera.' }\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":930,"y":140,"wires":[["3d65b0edf8628b7d"]]},{"id":"3d65b0edf8628b7d","type":"api-call-service","z":"02cfc8d39d27b4e4","name":"Envoi Telegram","server":"2c5088ebae4d463e","version":5,"debugenabled":false,"domain":"telegram_bot","service":"send_photo","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1160,"y":140,"wires":[[]]},{"id":"2c5088ebae4d463e","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

cela donne ça :


de mon coté, je joue aussi sur le boolean de detection de la caméra dans un autre flow afin d’envoyer quand même une notif si par exemple l’alarme est bien désactivée mais que tu veux quand même recevoir tes snap, ou l’inverse, pour une raison X ta caméra fait des faux positif et t’envoi plein de snap, tu peux positionner un boolean pour empecher l’envoi des snap sans pour autant désactiver la caméra.
image

Bonjour,

Merci je partais vraiment pas dans le bon sens !!
Bon là, ça fonctionne. Ca prend donc un snapshot et ça me l’envoie bien…
Donc un grand merci !!
Aucun soucis pour mon alarme… elle s’active et se coupe automatiquement… Hyper fiable depuis quasi 2 ans.

Par contre, je vois certains récupérer directement les snapshot dans frigate, les liens vers la vidéo etc…
Si quelqu’un peut me mettre sur la piste je suis preneur…

Il faut capturer l’event de frigate en passant par une détection MQTT, il te faut donc MQTT pour le faire, et ensuite capturer le flux vidéo ou le snap et l’envoyer, la aussi, ce sont des fonctions a créer.

Bonjour et merci pour l’aide.

J’ai avancé ce week end mais ça bloque encore :slight_smile:

J’arrive bien à trigger les Frigate/envents et à en extraire les données … eventid, zone,URL etc.
l’URL obtenue ressemble à ça :

localhost:5000/api/events/1674391899.192138-w5sl6f/thumbnail.jpg

Si je me rends sur

Url-frigate:5000/api/events/1674391899.192138-w5sl6f/thumbnail.jpg
(Là où pointe Frigate) j’ai bien ma miniature…

Mon soucis c’est que dans Telegram j’ai besoin de fournir le chemin du fichier… Si je donne l’URL ça fonctionne pas…

Le chemin du fichier il est censé ressembler à quoi ?

Merci pour vos lumières…