-
Please use Proper formatting. Read this:
How to help us help you - or How to ask a good question -
It looks like the file gets created. Have you tried “hardcoding” one picture?
Fore example mycamera_20231017-150638.jpg ?
3:
I dont want to judge your project/plan but now you want to:
- Get photo from your cam
- Save photo locally on your homeassistant with a timestamp
- View/save the picture through the internet/web (why?!), fetch it again and send it with telegram
also there are two, maybe three flaws I want to make you aware:
- minor: Your Bandwith gets stressed unneccessarily (you download/upload too much than needed)
- EVERYONE can access your pictures when they are saved in /config/www !
- potentially: your Harddrive gets full after some time when you dont keep an eye on the saved pictures
Instead you could:
- Get photo from your cam (homenetwork/LAN)
- Save photo locally on your homeassistant with a timestamp on /media/picture.jpg
- Fetch it from harddrive locally with a timestamp from /media/picture.jpg
See my Automation which works similiar. Maybe you can use this for your project:
alias: super_nice_alias
description: "when something triggers this, pictures get sent"
trigger:
- type: opened
platform: device
device_id: 1234
entity_id: whatever.entity.should.trigger.this
domain: whatever.domain
condition:
- condition: not
conditions:
- condition: state
entity_id: device_tracker.whatever.condition.you.use
state: home
action:
- data:
message: door opened
service: telegram_bot.send_message
- service: camera.snapshot
data:
filename: /media/door_opened_1.jpg
target:
device_id: 1234
- service: camera.snapshot
data:
filename: /media/door_opened_2.jpg
target:
device_id: 1234
- service: camera.snapshot
data:
filename: /media/door_opened_3.jpg
target:
device_id: 1234
- service: camera.snapshot
data:
filename: /media/door_opened_4.jpg
target:
device_id: 1234
- service: camera.snapshot
data:
filename: /media/door_opened_5.jpg
target:
device_id: 1234
- service: telegram_bot.send_photo
data:
authentication: digest
caption: "1"
file: /media/door_opened_1.jpg
- service: telegram_bot.send_photo
data:
authentication: digest
caption: "2"
file: /media/door_opened_2.jpg
- service: telegram_bot.send_photo
data:
authentication: digest
caption: "3"
file: /media/door_opened_3.jpg
- service: telegram_bot.send_photo
data:
authentication: digest
caption: "4"
file: /media/door_opened_4.jpg
- service: telegram_bot.send_photo
data:
authentication: digest
caption: "5"
file: /media/door_opened_5.jpg
mode: single
What are the upsides on this?
- Pictures are not accessible through the internet by ANYONE.
- it saves 5 pictures with a static filename (filename1-5). When it retriggers it overwrites the pictures it did before, keeping your harddrivespace clean. The pictures are archived in your telegram anyway.