Now I’m trying to create buttons in Lovelace to take a snapshot or start recording video and save it to my local folder. Snapshot is working fine, but video recording shows and error of “failed to call service, camera does not support record service”. It’s strange because I’m able to start video recording via http://IPADDRESS:PORT or using the camera video recording switch (switch.entrance_video_recording). What is wrong with my code?
Create a rest command (start and stop recording) in the configuration.yaml, then you can call it as a service by pressing a button or a switch. Later an automation can save the recording to a local folder with HA downloader
## Rest command that start and stop video recording (when stopped the recording will be found on the android device)
rest_command:
video_recording_start:
url: 'http://user:[email protected]:port/startvideo?force=1'
method: POST
video_recording_stop:
url: 'http://user:[email protected]:port/stopvideo?force=1'
method: POST
## If you call this service, it's going to save the recording (previously saved on the android device) into your HA local download folder (you have to specify the location first in the configuarion.yaml)
service: downloader.download_file
data:
url: http://user:[email protected]:port/v//rec_2022-03-15_20-17.mp4
filename: rec_2022-03-15_20-17.mp4
Unfortunately, if you want to automatically save the recordings, you have to know the exact name of the created mp4. In my case it is always ‘rec_yyyy-mm-y_hh-mm.mp4’. The time is equal to that when you pushed the start button.
from what ive gathered the reason is because the stream service only works with x264/5 and not mjpeg streams.
if i run the command manually inside the container with a simple file name it works but as a shell command with the templated name i get the error. with the command quoted or not: