Hello guys,
I’m trying to notify my phone when the door ring with the snap of the camera.
I made a flow, but the image sent to my phone appears to be saved on cache and it wasn’t the last that was created.
So I modified the flow, and include the File Access and File Delete nodes, to verify if the snap was created before send the notification and after that, delete the snap, but it didn’t solve my problem
Now I included a counter to change the file name of the snap, but now, the notification is coming with no images.
Can you help me?
[{"id":"da9a461e2c75968c","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"7ac03e9b868b597a","type":"api-call-service","z":"da9a461e2c75968c","name":"","server":"574882af.002ebc","version":5,"debugenabled":false,"domain":"camera","service":"snapshot","areaId":[],"deviceId":[],"entityId":["camera.rua_esq"],"data":"{\"filename\": filename}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":410,"y":180,"wires":[["b9c47819c37dbee1"]]},{"id":"3f8c38fcf378d71d","type":"api-call-service","z":"da9a461e2c75968c","name":"Notify","server":"a86c4410.e2a568","version":5,"debugenabled":true,"domain":"notify","service":"mobile_app_pedrao_iphone","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"title\":\"Campainha\",\t \"message\":\"Campainha foi tocada!\",\t \"data\":{\t \"image\": msg.filename,\t \"priority\":\"high\",\t \"channel\":\"Doorbell\"\t }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":970,"y":180,"wires":[[]]},{"id":"b9c47819c37dbee1","type":"fs-ops-access","z":"da9a461e2c75968c","name":"","path":"path","pathType":"msg","filename":"file","filenameType":"msg","read":true,"write":true,"throwerror":true,"x":630,"y":180,"wires":[["e3546535493a0c63"],["e7235d121839b19e"]]},{"id":"9af32bfbfec0fcba","type":"fs-ops-delete","z":"da9a461e2c75968c","name":"","path":"path","pathType":"msg","filename":"file","filenameType":"msg","x":1310,"y":180,"wires":[[]]},{"id":"78240ffb3a18de63","type":"delay","z":"da9a461e2c75968c","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1140,"y":180,"wires":[["9af32bfbfec0fcba"]]},{"id":"55d626dfaffdc3a4","type":"counter","z":"da9a461e2c75968c","name":"","init":"0","step":"1","lower":"","upper":"","mode":"increment","outputs":"1","x":280,"y":80,"wires":[["9b0c1198994540e2"]]},{"id":"9b0c1198994540e2","type":"function","z":"da9a461e2c75968c","name":"Create file name","func":"msg.path = \"/config/www/imgs/cameras/\"\nmsg.file = \"rua_esq\" + msg.count +\".jpg\"\nmsg.filename = msg.path + msg.file\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":80,"wires":[["7ac03e9b868b597a"]]},{"id":"e3546535493a0c63","type":"delay","z":"da9a461e2c75968c","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":810,"y":180,"wires":[["3f8c38fcf378d71d"]]},{"id":"e7235d121839b19e","type":"delay","z":"da9a461e2c75968c","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":620,"y":280,"wires":[["b9c47819c37dbee1"]]},{"id":"ae8811c08d782ab8","type":"inject","z":"da9a461e2c75968c","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":80,"wires":[["55d626dfaffdc3a4"]]},{"id":"574882af.002ebc","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},{"id":"a86c4410.e2a568","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}]