robmarkcole / HASS-Sighthound

Beta features for Home Assistant Sighthound integration
https://www.home-assistant.io/integrations/sighthound/
MIT License
34 stars 10 forks source link

[feature request] Add option to always save image #19

Closed fabiocaseri closed 3 years ago

fabiocaseri commented 3 years ago

Is it possible to add a configuration option (boolean true/false) to always save the image, even when no vehicle/people is found? At the moment the image is written only if detections are greater than zero.

I use the generated image as a local_file camera in HA, so it can be useful to use the latest image to show the updated situation (in a picture-glance card).

robmarkcole commented 3 years ago

I agree I also found it confusing seeing the last image with a detection, rather than the last processed image.

This is a good suggestion, do you want to raise a PR adding the feature?

fabiocaseri commented 3 years ago

Sure, I'll try in my spare time. Is it better to always save last processed image or enable that feature with an additional option?

robmarkcole commented 3 years ago

Add an additional config arg: always_save_latest_jpg which defaults to False, but when True will save the image even if there are zero detections

alexandrechoske commented 3 years ago

Add an additional config arg: always_save_latest_jpg which defaults to False, but when True will save the image even if there are zero detections

can you share how to config this? I tried to set this to my configs but got an error.

- platform: sighthound
  api_key: !secret sighthound_key
  save_file_folder: /config/tmp
  save_timestamped_file: True
  always_save_latest_jpg: True
  source:
    - entity_id: camera.garagem  

Invalid config for [image_processing.sighthound]: [always_save_latest_jpg] is an invalid option for [image_processing.sighthound]. Check: image_processing.sighthound->always_save_latest_jpg. (See ?, line ?).

fabiocaseri commented 3 years ago

It's not merged to the official integration, I made a pull request. If you want to try it you have to download the code from my fork (always-save-latest-jpg branch), put the folder custom_components/sighthound in your HA /config/custom_components directory and restart Home Assistant.

arboeh commented 2 years ago

I have a problem if always_save_latest_jpg isn't set. Default behaviour if it isn't set should override existing latest pic with detection pic, correct? But if it isn't set, nothing is overidden, I have to set it explicitely to "false", so I have the latest motion detected pic.