Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95380

Camera.record Stream/record not ending/saving

$
0
0

@djansen1987 wrote:

Hi All,

I used to have an automation what send an photo via Telegram whenever the door opens.
This work great, only issue is that it is way to quick so i did not see who walked in as the photo was already taken.

So now i read some blogs and the advice was to use camera.record instead of camera.snapshot. Only i can’t get it to work. First issue was i did not install Stream and additional packages. But those are fixed. Now when i run my automation it doesn’t do anything (for what i can see). When i run the automation again it tells me it is already recording.

I already changed the duration time to “2” to make sure i was not to quick. But no joy.

Error log shows me:

Log Details (ERROR)
Sun Nov 10 2019 14:55:24 GMT+0100 (Central European Standard Time)
Error while executing automation automation.voordeur_notificatie. Unknown error for call_service at pos 2:
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/automation/init.py”, line 437, in action
await script_obj.async_run(variables, context)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/script.py”, line 190, in async_run
await self._handle_action(action, variables, context)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/script.py”, line 274, in _handle_action
await self._actions[_determine_action(action)](action, variables, context)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/script.py”, line 357, in _async_call_service
context=context,
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py”, line 97, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py”, line 1236, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py”, line 1261, in _execute_service
await handler.func(service_call)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py”, line 213, in handle_service
self._platforms.values(), func, call, service_name, required_features
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py”, line 348, in entity_service_call
future.result() # pop exception if have
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py”, line 372, in _handle_service_platform_call
await func(entity, data)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/camera/init.py”, line 712, in async_handle_record_service
DOMAIN_STREAM, SERVICE_RECORD, data, blocking=True, context=call.context
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py”, line 1236, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py”, line 1261, in _execute_service
await handler.func(service_call)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/stream/init.py”, line 132, in async_record
await async_handle_record_service(hass, call)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/stream/init.py”, line 237, in async_handle_record_service
raise HomeAssistantError(f"Stream already recording to {recorder.video_path}!")
homeassistant.exceptions.HomeAssistantError: Stream already recording to /home/homeassistant/.homeassistant/secure/voordeur.mp4!

My automation is not so exciting but here is the config.

- id: test123
  alias: Voordeur Notificatie
  trigger:
  - entity_id: binary_sensor.door_window_sensor_158d0002e8b414
    from: 'off'
    platform: state
    to: 'on'
  action:
  - data:
      message: '{{now().strftime("%H:%M %Y-%m-%d")}}: Voor deur is open geweest.'
      title: '*Voordeur sensor is getriggerd*'
    service: notify.telegramdaniel
  - data:
      duration: 2
      entity_id: camera.gang
      filename: /home/homeassistant/.homeassistant/secure/voordeur.mp4
    service: camera.record

The path where it saves is my secure path:

homeassistant:
  # Name of the location where Home Assistant is running
  # name: Home
  # Location required to calculate the time the sun rises and sets
  # latitude: 52.028213
  # longitude: 5.046502
  # Impacts weather/sunrise data (altitude above sea level in meters)
  # elevation: 0
  # metric for Metric, imperial for Imperial
  # unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  # time_zone: Europe/Amsterdam
  # Customization file
  customize: !include customize.yaml
  whitelist_external_dirs:
    - /home/homeassistant/.homeassistant/secure
# lovelace:
#   mode: yaml

Hope anyone can see where i am going wrong.
Thanks!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95380

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>