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}]```
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.
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.
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.
Hello everybody. I’m trying to do this automation in node-red, but I’m not succeeding. I receive the notification, but it is blank (no photo or video). It only appears to me with the title I wrote. What could I be doing wrong?
{
"title": "Deteção na Porta de Entrada",
"message": "your message here",
"data":{
"image":"http://ip:8123/api/frigate/notifications/" & payload.after.id & "/snapshot.jpg",
"ttl":0,
"priority":"high",
"color": "#F1C232"
}
}
If I access this link, a “404: Not Found” message appears. Is it normal?