Hello.
I’ve integrated an onvif camera. Image works well!
After writing this script:
ptz_tilt_up:
sequence:
- service: camera.onvif_ptz
entity_id: 'camera.onvif'
data:
tilt: 'UP'
ptz_tilt_down:
sequence:
- service: camera.onvif_ptz
entity_id: 'camera.onvif'
data:
tilt: 'DOWN'
ptz_pan_left:
sequence:
- service: camera.onvif_ptz
entity_id: 'camera.onvif'
data:
pan: 'LEFT'
ptz_pan_right:
sequence:
- service: camera.onvif_ptz
entity_id: 'camera.onvif'
data:
pan: 'RIGHT'
ptz_zoom_in:
sequence:
- service: camera.onvif_ptz
entity_id: 'camera.onvif'
data:
zoom: 'ZOOM_IN'
ptz_zoom_out:
sequence:
- service: camera.onvif_ptz
entity_id: 'camera.onvif'
data:
zoom: 'ZOOM_OUT'
when calling the script I get this error:
Error executing service <ServiceCall script.ptz_tilt_down (c:f7ce3c0440f14f45a295ecc64937e622)>
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1150, in _safe_execute
await self._execute_service(handler, service_call)
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1163, in _execute_service
await handler.func(service_call)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/script/init.py”, line 114, in service_handler
context=service.context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/script/init.py”, line 172, in async_turn_on
kwargs.get(ATTR_VARIABLES), context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/script.py”, line 131, in async_run
await self._handle_action(action, variables, context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/script.py”, line 210, in _handle_action
action, variables, context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/script.py”, line 299, in _async_call_service
context=context
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 89, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1141, in async_call
self._execute_service(handler, service_call))
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1163, in execute_service
await handler.func(service_call)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/onvif/camera.py”, line 84, in async_handle_ptz
entity_ids = extract_entity_ids(hass, service)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 99, in extract_entity_ids
async_extract_entity_ids(hass, service_call, expand_group), hass.loop
File "/usr/local/lib/python3.7/site-packages/homeassistant/util/async.py", line 138, in run_coroutine_threadsafe
raise RuntimeError(‘Cannot be called from within the event loop’)
RuntimeError: Cannot be called from within the event loop
Any ideas?
cheers