Frigate notifications

So this seems to sort of work. I don’t get the snapshot thumbnail on my notification to my phone, but when I press on the notification it takes me to the live feed. Another issue is that I keep getting notifications even though detect, motion, snapshot and record are all turned off on my phone.

The address you are using is https? I’m not sure why it is opening to a steam. Is click action defined in the message node?

There is likely other messages about the camera coming through the mqtt node that is creating the additional messages. Change the switch node with this one.

[{"id":"d6f11728161eb111","type":"switch","z":"60f2d2277843c698","name":"","property":"payload.after.has_snapshot","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":1560,"wires":[["d93a88c7cd6bf9e7"]]}]
[{"id":"72fc9b88ff77ba83","type":"debug","z":"e7bece7af5886e7c","name":"debug 30","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":590,"y":1760,"wires":[]},{"id":"e2c2a8ab2eb5bcae","type":"mqtt in","z":"e7bece7af5886e7c","name":"frigate/events","topic":"frigate/events/#","qos":"0","datatype":"auto-detect","broker":"d26be3a7998dd963","nl":false,"rap":false,"inputs":0,"x":130,"y":1760,"wires":[["eea4dbebd9feb764"]]},{"id":"5af1ff7724532f89","type":"api-call-service","z":"e7bece7af5886e7c","name":"send pic text","server":"6b1110b5.183a4","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_iphone_126","areaId":[],"deviceId":[],"entityId":[],"data":"{\t   \"title\": \"your title here\",\t   \"message\": \"your message here\",\t   \"data\":{\t       \"image\":\"https://192.168.0.5:8123/api/frigate/notifications/\" & payload.after.id & \"/snapshot.jpg\",\t       \"ttl\":0,\t       \"priority\":\"high\",\t       \"color\": \"#2DF56D\"\t   }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":410,"y":1760,"wires":[["72fc9b88ff77ba83"]]},{"id":"eea4dbebd9feb764","type":"switch","z":"e7bece7af5886e7c","name":"","property":"payload.after.has_snapshot","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":270,"y":1760,"wires":[["5af1ff7724532f89"]]},{"id":"d26be3a7998dd963","type":"mqtt-broker","name":"","broker":"core-mosquitto","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"TETETE","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"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}]```

I get this message when I try to look at the attachment.

When you access frigate do you use an https address or http? If http remove the s. If it is https, trigger a snapshot text. Look for https path that the call service sends. Copy it and try to open it in a browser.

So that seemed to work. The thumbnail shows up when the message is sent. When I press on the the notification, it doesn’t seem to take me to the snapshot. Also. the MQTT node keeps firing off. How do I reign this in? Here is the MQTT node.

[{"id":"e2c2a8ab2eb5bcae","type":"mqtt in","z":"e7bece7af5886e7c","name":"frigate/events","topic":"frigate/events/#","qos":"0","datatype":"auto-detect","broker":"d26be3a7998dd963","nl":false,"rap":false,"inputs":0,"x":170,"y":1840,"wires":[[]]},{"id":"d26be3a7998dd963","type":"mqtt-broker","name":"","broker":"core-mosquitto","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"TETETE","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]```

I take my own snapshots, when I receive the message, I am only able to see the snapshot in the text notification when it is expanded. Add a click action to the data section that points to the snapshot address. This should let you click the text and have it take you to the snapshot. Use the same address for both image and clickAction.

{
   "title": "your title",
   "message": "your message",
   "data":{
       "image": "https://192.168.0.5:8123/api/frigate/notifications/" & payload.after.id & "/snapshot.jpg",
       "clickAction": "https://192.168.0.5:8123/api/frigate/notifications/" & payload.after.id & "/snapshot.jpg"
   }
}

The mqtt node, this is going to be active catching all the frigate events. The switch is what will be used to “tame” the messages. Using the change node, I posted above, that looks for has_snapshot, you still get additional mesages?

Should I be putting the switch node after the notification node?

It should be the 2nd node in the flow after the event node.

image

Okay, so that’s how I have it set up currently. I am getting constantly pinged with this notification to the point that I had to turn it off.

I’m trying to work off the docs and from what I see here payload.type can have a value of new. You can try that as a filter in the switch node instead.

image

If it doesn’t work, you’ll need to compare a message that should get through vs what shouldn’t. Somewhere in this list there should be a distinct difference that you can filter by. You can have more than one switch if you need to filter a second time.

EDIT!!!
Hello, I’m trying to do this automation using node-red but I’m not succeeding. I receive the message but I don’t receive a photo. in the node-red debug it doesn’t show me any error, it even shows the “id” that was created on the frigate, but I don’t receive the photo. What could it be?
Another question is the following, I see this command “/api/frigate/notifications/” a lot, has this been replaced by “/api/events”?
Because if I enter the frigate url in the browser with https://ip_frigate:port_firgate/api/nameofcamera/latest.jpg" I can see the last pic.

image

{
   "title": "Deteção na Porta de Entrada",
   "message": "your message here",
   "data":{
       "image":"https://ip_frigate:port_frigate/api/frigate/notifications/" & payload.after.id & "/snapshot.jpg",
       "ttl":0,
       "priority":"high",
       "color": "#F1C232"
   }
}

I use the watch node to do this this flow attaches a jpeg and sending it to pushover and send an email

[{“id”:“2c5b0dcb3ce6fa96”,“type”:“change”,“z”:“6b144625619dd9e6”,“name”:“attach to payload”,“rules”:[{“t”:“set”,“p”:“attachments”,“pt”:“msg”,“to”:“payload”,“tot”:“msg”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:1590,“y”:260,“wires”:[[“97efda29d4abd029”]]}]

I can’t add the code to my node-red. It gives an error, could you check again? obliged

Hi Sorry for the delay busy weekend

[{“id”:“87b467f6ce6de380”,“type”:“change”,“z”:“eec7fef294f27667”,“name”:“”,“rules”:[{“t”:“set”,“p”:“topic”,“pt”:“msg”,“to”:“Photo from Landing”,“tot”:“str”},{“t”:“set”,“p”:“description”,“pt”:“msg”,“to”:“Landing Cam”,“tot”:“str”},{“t”:“set”,“p”:“filename”,“pt”:“msg”,“to”:“Landing.jpg”,“tot”:“str”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:1320,“y”:220,“wires”:[]},{“id”:“43cf640a5cf2572d”,“type”:“change”,“z”:“eec7fef294f27667”,“name”:“attach to payload”,“rules”:[{“t”:“set”,“p”:“attachments”,“pt”:“msg”,“to”:“payload”,“tot”:“msg”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:1110,“y”:240,“wires”:[[“87b467f6ce6de380”]]},{“id”:“9016efbacfca7674”,“type”:“file in”,“z”:“eec7fef294f27667”,“name”:“”,“filename”:“filename”,“filenameType”:“msg”,“format”:“”,“chunk”:false,“sendError”:false,“encoding”:“none”,“allProps”:false,“x”:940,“y”:240,“wires”:[[“43cf640a5cf2572d”]]},{“id”:“64d474ed94b5cbdb”,“type”:“delay”,“z”:“eec7fef294f27667”,“name”:“”,“pauseType”:“rate”,“timeout”:“5”,“timeoutUnits”:“seconds”,“rate”:“1”,“nbRateUnits”:“1”,“rateUnits”:“minute”,“randomFirst”:“1”,“randomLast”:“5”,“randomUnits”:“seconds”,“drop”:true,“allowrate”:false,“outputs”:1,“x”:750,“y”:240,“wires”:[[“9016efbacfca7674”]]},{“id”:“0211257ba816569f”,“type”:“filter”,“z”:“eec7fef294f27667”,“name”:“Landing”,“property”:“payload”,“propertyType”:“msg”,“asArray”:false,“itemProperty”:“payload”,“itemPropertyType”:“item”,“rules”:[{“t”:“regex”,“v”:“Porch|front|Hall|tmp|back|frontporch|png|webp”,“vt”:“str”,“case”:true,“output”:1},{“t”:“else”,“output”:2}],“checkall”:“false”,“outputs”:2,“x”:560,“y”:240,“wires”:[,[“64d474ed94b5cbdb”]]},{“id”:“0d3a429ef3eefbd2”,“type”:“watch”,“z”:“eec7fef294f27667”,“name”:“”,“files”:“/media/frigate/clips/”,“recursive”:false,“x”:330,“y”:240,“wires”:[[“0211257ba816569f”]]}]

Doesn’t work :thinking:

have you set your own config for it ?

When I entered your code, it appears to me that there is no node-red.

[{"id":"33a47436221e93ee","type":"file in","z":"273dcb0f60fd2417","name":"","filename":"filename","filenameType":"msg","format":"","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":980,"y":340,"wires":[["9f77e0a04f80ad04"]]},{"id":"9f77e0a04f80ad04","type":"change","z":"273dcb0f60fd2417","name":"attach to payload","rules":[{"t":"set","p":"attachments","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":200,"wires":[["cebca2335b7c9bf8"]]},{"id":"cebca2335b7c9bf8","type":"change","z":"273dcb0f60fd2417","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"Photo from Landing","tot":"str"},{"t":"set","p":"description","pt":"msg","to":"Landing Cam","tot":"str"},{"t":"set","p":"filename","pt":"msg","to":"Landing.jpg","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1280,"y":200,"wires":[["e73da8f1fd7d1c98"]]},{"id":"1a101e3551130b74","type":"watch","z":"273dcb0f60fd2417","name":"","files":"/media/frigate/clips/","recursive":false,"x":670,"y":200,"wires":[["edeb10b4c235ff33"]]},{"id":"e73da8f1fd7d1c98","type":"e-mail","z":"273dcb0f60fd2417","server":"smtp.gmail.com","port":"465","authtype":"BASIC","saslformat":false,"token":"","secure":true,"tls":true,"name":"","dname":"","x":1570,"y":200,"wires":[]},{"id":"edeb10b4c235ff33","type":"filter","z":"273dcb0f60fd2417","name":"Landing","property":"payload","propertyType":"msg","asArray":false,"itemProperty":"payload","itemPropertyType":"item","rules":[{"t":"regex","v":"Porch|front|Hall|tmp|back|frontporch|png|webp","vt":"str","case":true,"output":1},{"t":"else","output":2}],"checkall":"false","outputs":2,"x":840,"y":280,"wires":[["33a47436221e93ee"],[]]}]
1 Like

now it works friend. Thank you very much for your attention