esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

ESP32Cam camera.record #318

Closed leoMehlig closed 5 years ago

leoMehlig commented 5 years ago

Operating environment/Installation (Hass.io/Docker/pip/etc.):

Hass.io v0.93.0

ESP (ESP32/ESP8266, Board/Sonoff):

ESP32 Cam

Affected component:

ESP32 Cam

Description of problem: The camera component works fine in home assistant, but when trying to record the stream it displays an error, that that is not supported.

Did I do something wrong or is that just not supported?

Problem-relevant YAML-configuration entries:

PASTE YAML FILE HERE
esphome:
  name: hallway_cam
  platform: ESP32
  board: esp-wrover-kit

wifi:
  ssid: "***"
  password: "***"

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: '***'

ota:
  password: '***'

esp32_camera:
  external_clock:
    pin: GPIO0
    frequency: 20MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22
  power_down_pin: GPIO32
  # test_pattern: true
  name: "Hallway Camera"

Traceback (if applicable):

Additional information and things you've tried:

PS. Thanks for the great work here!!!

brandond commented 5 years ago

Can you update to show the actual error message that you're getting?

leoMehlig commented 5 years ago

Here is the error log from an Automation that calls the service

Error while executing automation automation.start_camera_on_front_door_opened. Unknown error for call_service at pos 1:
Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/homeassistant/components/automation/__init__.py", line 378, in action await script_obj.async_run(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/helpers/entity_component.py", line 194, in handle_service required_features File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 316, in entity_service_call future.result()  # pop exception if have File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 339, in _handle_service_platform_call await func(entity, data) File "/usr/local/lib/python3.7/site-packages/homeassistant/components/camera/__init__.py", line 653, in async_handle_record_service .format(camera.entity_id)) homeassistant.exceptions.HomeAssistantError: camera.hallway_camera does not support record service

Sent from my iPhone

On 18. May 2019, at 02:15, Brandon Davidson notifications@github.com wrote:

Can you update to show the actual error message that you're getting?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

nickrout commented 5 years ago

I shall test mine tonight.

pmaciocia commented 5 years ago

Also seeing this issue:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  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/helpers/entity_component.py", line 194, in handle_service
    required_features
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 316, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 339, in _handle_service_platform_call
    await func(entity, data)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/camera/__init__.py", line 653, in async_handle_record_service
    .format(camera.entity_id))
homeassistant.exceptions.HomeAssistantError: camera.my_camera does not support record service
pmaciocia commented 5 years ago

@leoMehlig you might want to remove your wifi & api credentials from the yaml file you have posted there

leoMehlig commented 5 years ago

Oh... thanks @pmaciocia

OttoWinter commented 5 years ago

Yes this is correct, ESPHome uses something similar to MJPEG, and thus does not support the HA stream component. That includes HA's record service.

There was a longer discussion about this (I think HA's discord, somewhere in #beta maybe).

Anyway, this would need to be solved on the HA side (namely an MJPEG to RTSP converter)