Advertisement
nvsch

NodeRED snapshot to CIFS/SMB

Jan 18th, 2023
1,011
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 3.06 KB | None | 0 0
  1. [{"id":"fad0a437dfd69534","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"df58a7cbfd68c08e","type":"api-call-service","z":"fad0a437dfd69534","name":"Camera snapshot","server":"4132d2c5.c71f6c","version":5,"debugenabled":true,"domain":"camera","service":"snapshot","areaId":[],"deviceId":[],"entityId":["camera.dbo_substream"],"data":"{\"filename\":\"/config/www/img/dbo_snap.jpg\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"all","x":630,"y":300,"wires":[["f93a0363a5f45fc5"]]},{"id":"f93a0363a5f45fc5","type":"exec","z":"fad0a437dfd69534","command":"ssh -i /config/ssh_keys/ssh_host_rsa_key -o StrictHostKeyChecking=accept-new hassio@192.168.3.2 'cd /config/bash && sudo ./copysnap.sh'","addpay":"","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"Snap to NAS","x":910,"y":380,"wires":[["96566d6297fe9b82"],["96566d6297fe9b82"],["96566d6297fe9b82"]]},{"id":"96566d6297fe9b82","type":"debug","z":"fad0a437dfd69534","name":"Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":930,"y":580,"wires":[]},{"id":"1136738a9bae4d0b","type":"comment","z":"fad0a437dfd69534","name":"Camera snapshot is configured to save a copy of snap to HA local folder","info":"The Camera Snapshop node is configured to save a copy of the snapshot to HA's ","x":790,"y":260,"wires":[]},{"id":"997b8da604a4baf3","type":"comment","z":"fad0a437dfd69534","name":"Snap to NAS runs connects to the HA server using SSH and executes a shell script stored in HA config folder.","info":"The Camera Snapshop node is configured to save a copy of the snapshot to HA's ","x":1210,"y":340,"wires":[]},{"id":"d7918b32d6d372c3","type":"comment","z":"fad0a437dfd69534","name":"READ ME!","info":"My NAS is mounted to Home Assistant using a shell_script in configuration.yaml\n\nthe IP in nvr_cmd is the IP of the NAS\n\nThe nvr_cmd command runs on HA startup. Using a simple native automation.\n\n\nNOTE: Indentation of yaml gets messed up by NodeRED for some reason, pay attention when copying :)_\nconfiguration.yaml:\n\nshell_command:\n  mount_nvr: !secret nvr_cmd\n\nsecrets.yaml:\n\nnvr_cmd: \"mkdir -p /mnt/NVR && mount -t cifs -o username=USER,password=***** //192.168.1.6/NVR /mnt/NVR\"\n\n\n\nThe Copysnap.sh script executed by the Snap to NAS node contains the following:\n\n#! /bin/bash\n\ntimestr=$( date '+%F_%H%M' )\n\nsnapshot='/mnt/NVR/Doorbell/Snapshots/'$timestr'.jpg'\n\ncp /config/www/img/dbo_snap.jpg $snapshot;","x":440,"y":260,"wires":[]},{"id":"4132d2c5.c71f6c","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}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement