Jodur,
thank you for the detailed reply, makes perfect sense on all counts, I suspect I saw 2 issues simultaneously and jumped to the wrong conclusion. My setup now works great.
Also totally understand not wanting to update your code when the sun is shining!
For those following this thread Iâve also updated your picture-elements card example to add some additional buttons to run the backup script on demand, create a timelapse, reload the image list and show the current image count.
it looks a bit like this but you may need to adjust the position/color/size of the icons for your own use case and display size.
In lovelace this is produced with the code below
- type: picture-elements
entity: camera.frontcam_motion
camera_image: camera.frontcam_motion
camera_view: live
elements:
- type: icon
icon: mdi:cloud-upload
style:
background: rgba(255, 255, 255, 0.0)
left: 20px
bottom: 0px
color: rgba(50, 50, 200, 0.9)
tap_action:
action: call-service
service: script.cam_image_backup
service_data:
entity_id: script.cam_image_backup
- type: icon
icon: mdi:video-vintage
style:
background: rgba(255, 255, 255, 0.0)
left: 55px
bottom: 0px
color: rgba(50, 50, 200, 0.9)
tap_action:
action: call-service
service: script.cam_tl
service_data:
entity_id: script.cam_tl
- type: icon
icon: mdi:reload
style:
background: rgba(255, 255, 255, 0.0)
left: 90px
bottom: 0px
color: rgba(50, 50, 200, 0.9)
tap_action:
action: call-service
service: script.cam_upd
service_data:
entity_id: script.cam_upd
- type: state-label
entity: camera.frontcam_motion
attribute: imagecount
style:
left: 125px
bottom: '-12px'
color: rgba(50, 50, 200, 0.9)
font-size: 150%
- type: icon
icon: mdi:skip-previous
style:
background: rgba(255, 255, 255, 0.25)
right: 50px
bottom: 25px
tap_action:
action: call-service
service: imagedirectory.camera_prev_image
service_data:
entity_id: camera.frontcam_motion
- type: icon
icon: mdi:skip-next
style:
background: rgba(255, 255, 255, 0.25)
right: 0px
bottom: 25px
tap_action:
action: call-service
service: imagedirectory.camera_next_image
service_data:
entity_id: camera.frontcam_motion
- type: conditional
conditions:
- entity: camera.frontcam_motion
state: streaming
elements:
- type: icon
icon: mdi:pause
style:
background: rgba(255, 255, 255, 0.25)
bottom: 25px
right: 25px
tap_action:
action: call-service
service: imagedirectory.camera_toggle_pause
service_data:
entity_id: camera.frontcam_motion
- type: conditional
conditions:
- entity: camera.frontcam_motion
state: paused
elements:
- type: icon
icon: mdi:play
style:
background: rgba(255, 255, 255, 0.25)
bottom: 25px
right: 25px
tap_action:
action: call-service
service: imagedirectory.camera_toggle_pause
service_data:
entity_id: camera.frontcam_motion
As well as Jodurâs image_backup script this card also relies on 2 additional scripts .
cam_tl:
alias: "Create tl" #uses all images in the current image forlder
sequence:
- service: imagedirectory.create_gif_mp4
data:
sourcepath: /config/www/camimages
destinationpath: /config/www/camimages/archive
filename: frontcam_backup_{{(now()-timedelta(days=1)).strftime("%d_%m_%Y")}}
format: mp4
exclude: campic1.jpg
# begintimestamp: '{{begintime}}'
endtimestamp: '{{(now()).strftime("%d/%m/%Y")}} 23:59:59'
lasthours: 24.0
mode: single
cam_upd:
alias: "Update Image List"
sequence:
- service: imagedirectory.camera_update_image_filelist
data:
entity_id: camera.frontcam_motion
sourcepath: /config/www/camimages
mode: single
Hope this is helps someone in the future.
F