Hello HA community!
I just had a quick question.
I am trying to add recordings to my camera outputs (currently just do images).
I tried to output with two file paths so that I can have a “latest” and also a time stamp version.
Unfortunately I am doing something wrong, or it just isn’t supported (yet).
This is what I tried in the service tab:
service:
camera.record
entity:
camera.backporch
service data:
{
"entity_id": "camera.backporch",
"filename":["/.../backporch_{{ now().strftime('%Y%m%d_%H%M%S') }}.mp4",
"/.../backporch_latest.mp4"],
"duration":"10"
}
If I do one or the other it works, just not both.
I first tried using this, but got an error for duplicate keys:
{
"entity_id": "camera.backporch",
"filename":"/.../backporch_{{ now().strftime('%Y%m%d_%H%M%S') }}.mp4",
"filename":"/.../backporch_latest.mp4",
"duration":"10"
}
So after some reading I found out you can wrap multiple values for a key in [ ], but this is giving an error as well:
template value should be a string for dictionary value @ data['filename']
Traceback (most recent call last):
File "/usr/src/app/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
connection.context(msg))
File "/usr/src/app/homeassistant/core.py", line 1130, in async_call
processed_data = handler.schema(service_data)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 267, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 589, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 427, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: template value should be a string for dictionary value @ data['filename']
If anyone has experience and can help me figure out the right way to call the service - or simply know that it cannot be done this way, I would appreciate it.
Cheers!
DeadEnd