I keep getting the following error:
Can’t send file with kwargs: {‘file’: ‘/var/lib/motion/20-20180423100425.avi’, ‘caption’: ‘Garage Camera’}
2:15 PM components/telegram_bot/init.py (ERROR)
‘/var/lib/motion/20-20180423100425.avi’ are not secure to load data from!
2:15 PM components/telegram_bot/init.py (WARNING)
The directory is white listed.
whitelist_external_dirs:
- /var/lib/motion
I think you might be right, it looks like even though its inheriting the group from the parent folder, its still creating the file under the motion user - which seems to be causing the problem.
Public and the home-assistant group of read to the newly created files, but it doesn’t seem enough.
It looks like it’ll only work if the home assistant user owns the file - if another user owns the file it doesn’t work…even if the group and public are given full access to the file.
After trying various combinations - this seems to be the least restrictive to get it working…764. Only problem is I can’t get motion to create files with those permissions.
Thanks - running Rasbiaan at the moment, but might change in the future.
I got it working with 764 - and then when I changed it to use the below I started getting the error again, if I changed to a hardcoded file name of the one derived from the event, it worked.
action:
My work-around, which worked, was to assigned the value to a input_text field - then use the input_text field as the input for above action. Not the neatest solution, but its working.
I now need to just get the correct encoding for Telegram to play the video in app. mpeg and mp4 aren’t working
Interesting problem, home-assistant grabs the file and sends it while it’s being recorded - so you only get a few seconds on the video - I think when I get back from leave I’ll have to have it write to a location, then somehow have it picked up and moved on completion to the location home-assistant monitors.
Then - still can’t get Telegram to natively play the video - tried various codecs, same error - but at least they all open in VLC.
In Telegram? Interesting - maybe it has something to do with the motion settings - I’ve set the video to the size specified in the telegram api docs. Tried on both my tablet and phone - neither play the video in app. I just get a blank video.