New name for every picture

You can use JSONata in the file write node path input. So you can append a datetime.
e.g.

[{"id":"9ca58ffd6eb64591","type":"file","z":"da8a6ef0b3c9a5c8","name":"Save Picture","filename":"\"/media/Pictures/picture\" & $moment().format(\"YYYYMMDD_HHmmss\") & \".jpg\"","filenameType":"jsonata","appendNewline":false,"createDir":false,"overwriteFile":"false","encoding":"none","x":960,"y":4660,"wires":[[]]},{"id":"d9daf7507bf38e9f","type":"http request","z":"da8a6ef0b3c9a5c8","name":"Get Picture","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://192.168.50.60:8080/photo.jpg","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"basic","senderr":false,"headers":[],"credentials":{"user":"","password":""},"x":780,"y":4660,"wires":[["9ca58ffd6eb64591"]]},{"id":"48db04f7d334901b","type":"function","z":"da8a6ef0b3c9a5c8","name":"Take Picture","func":"msg.payload = {\n    \"data\": \"http://192.168.50.60:8080/shot.jpg\"\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":4660,"wires":[["d9daf7507bf38e9f"]]},{"id":"ddcf9a5fdc523cf8","type":"switch","z":"da8a6ef0b3c9a5c8","name":"Value > 60?","property":"data.new_state.state","propertyType":"msg","rules":[{"t":"gt","v":"60","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":440,"y":4660,"wires":[["48db04f7d334901b"]]},{"id":"4416b46d00b74e1d","type":"server-state-changed","z":"da8a6ef0b3c9a5c8","name":"Motion Sensor","server":"30307a46.24469a","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.192_168_50_60_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"2","forType":"num","forUnits":"seconds","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":270,"y":4660,"wires":[["ddcf9a5fdc523cf8"]]}]
2 Likes