[{"id":"f32199e2.4d8208","type":"debug","z":"6b79cc41.b09ad4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":360,"wires":[]},{"id":"9a07f5c7.a90968","type":"tail","z":"6b79cc41.b09ad4","name":"","filetype":"text","split":"[\\r]{0,1}\\n","filename":"/config/www/snapshots/foran_detection_latest.jpg","inputs":0,"x":220,"y":360,"wires":[["f32199e2.4d8208","50ba0a87.571214"]]},{"id":"50ba0a87.571214","type":"split","z":"6b79cc41.b09ad4","name":"simulate images/msg","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":560,"y":400,"wires":[["badb8bc2.52b6e8"]]},{"id":"badb8bc2.52b6e8","type":"trigger","z":"6b79cc41.b09ad4","name":"","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"250","extend":true,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":760,"y":400,"wires":[["1cf1bb6f.eebf85","c583f4a0.30e3a8"]]},{"id":"1cf1bb6f.eebf85","type":"function","z":"6b79cc41.b09ad4","name":"Message prep","func":"var today = new Date();\nvar hour = ('0'+today.getHours()).slice(-2);\nvar min = ('0'+today.getMinutes()).slice(-2);\nvar sec = ('0'+today.getSeconds()).slice(-2);\ntoday = hour+':'+min+':'+sec;\nmsg.payload = \n{\n \"data\": \n {\n \"title\": \"Detection Foran!\", \n \"message\": \"Der blev fanget en eller flere personer foran! kl.\"+today,\n \"data\": {\n \"image\": \"/config/www/snapshots/foran_detection_latest.jpg\",\n \"sound\": {\n \"name\": \"default\",\n \"critical\": 1,\n \"volume\": 0\n },\n \"attachment\": {\n \"content-type\": \"jpg\"\n }\n }\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":860,"y":540,"wires":[["9f91f95c.e9da38"]]},{"id":"c583f4a0.30e3a8","type":"api-call-service","z":"6b79cc41.b09ad4","name":"Notify Detection Telegram","server":"392cba7b.806846","version":1,"debugenabled":false,"service_domain":"notify","service":"casahabot","entityId":"","data":"{\"message\":\"Detection Foran!\",\"data\":{\"photo\":[{\"file\":\"/config/www/snapshots/foran_detection_latest.jpg\",\"caption\":\"Der blev fanget en eller flere personer foran!\"}]}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1130,"y":480,"wires":[[]]},{"id":"15e97b2d.fd0795","type":"inject","z":"6b79cc41.b09ad4","name":"Test notification","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":620,"y":480,"wires":[["1cf1bb6f.eebf85","c583f4a0.30e3a8"]]},{"id":"9f91f95c.e9da38","type":"api-call-service","z":"6b79cc41.b09ad4","name":"Notify Detection Thomas","server":"392cba7b.806846","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mi_9t_pro","entityId":"","data":"{}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1130,"y":540,"wires":[[]]},{"id":"392cba7b.806846","type":"server","name":"Home Assistant","addon":true}]