Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera feed not detected after setup. #10

Closed
apokha1 opened this issue Jul 18, 2021 · 80 comments
Closed

Camera feed not detected after setup. #10

apokha1 opened this issue Jul 18, 2021 · 80 comments
Assignees

Comments

@apokha1
Copy link

apokha1 commented Jul 18, 2021

I am working with a wired doorbell, T8200. After the installation, three new entities were added, person detector sensor, battery & wifi ssid power. The battery entity was unavailable, as it makes sens with the wired doorbell, there is no battery. wifi ssid sensor was unavailable too. And I had no luck getting the stream from the doorbell camera.

image

Some log lines:

2021-07-18 12:16:49 ERROR (MainThread) [custom_components.eufy_security] eufy_security - Exception in websocket - process_messages : 'battery' - traceback: Traceback (most recent call last): File "/config/custom_components/eufy_security/websocket.py", line 55, in process_messages await self.on_message(msg) File "/config/custom_components/eufy_security/websocket.py", line 66, in on_message await self.message_callback(message) File "/config/custom_components/eufy_security/coordinator.py", line 165, in on_message self.async_set_updated_data(self.data) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 287, in async_set_updated_data update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 453, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 425, in _stringify_state state = self.state File "/config/custom_components/eufy_security/sensor.py", line 86, in state return self.entity[self.key] KeyError: 'battery'

2021-07-18 12:12:43 ERROR (MainThread) [homeassistant.components.camera] Error while setting up eufy_security platform for camera Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/eufy_security/camera.py", line 34, in async_setup_entry _LOGGER.debug(f"{DOMAIN} - camera setup entries - {entities}") File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 803, in __repr__ return f"<Entity {self.name}: {self.state}>" File "/config/custom_components/eufy_security/camera.py", line 74, in state self.is_streaming = self.entity["rtspStream"] KeyError: 'rtspStream'

@fuatakgun
Copy link
Owner

yes, i am working on it, let's follow from here, i will publish an update tonight in EU time :)
#6

@fuatakgun fuatakgun reopened this Jul 18, 2021
@fuatakgun
Copy link
Owner

ops, let's reopen it to track battery and WIFI sensors

@apokha1
Copy link
Author

apokha1 commented Jul 18, 2021

Sure thing. Thank you, will keep an eye on this issue.

@dsjackson
Copy link

Just installed it today with the custom integration. Two cameras were detected and one doorbell. All of them have various sensors, etc. None of them show as having an entity ID as camera.XXX

BTW...excellent progress! Happy that I don't need to install a Docker.

@rpitera
Copy link

rpitera commented Jul 22, 2021

Same here; was happy to see that my 2k Floodlight cam was detected along with my cams, but no camera entities for any of them.

Still though; following the directions given, the install went great and the progress is amazing. Thanks for the work! Hoping this will replace ioBroker for my setup!

@apokha1
Copy link
Author

apokha1 commented Jul 22, 2021

I tried installing everything fresh again after your recent commit and followed the instruction there. The problem with the camera not being detected is still there along with wifi_rssi sensor being unavailable and the doorbell_battery sensor unavailable as well. (I have a wired version - T8200)
The only sensor that seems to populate after the installation of the integration is the Person Detection Sensor.

Here are my log files.

2021-07-22 08:33:00 ERROR (MainThread) [homeassistant.components.camera] Error while setting up eufy_security platform for camera
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/eufy_security/camera.py", line 76, in async_setup_entry
_LOGGER.debug(f"{DOMAIN} - camera setup entries - {entities}")
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 803, in __repr__
return f"<Entity {self.name}: {self.state}>"
File "/config/custom_components/eufy_security/camera.py", line 124, in state
self.entity["rtspStream"] == True
KeyError: 'rtspStream'



2021-07-22 08:33:00 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform eufy_security
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 666, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 453, in _async_write_ha_state
state = self._stringify_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 425, in _stringify_state
state = self.state
File "/config/custom_components/eufy_security/sensor.py", line 86, in state
return self.entity[self.key]
KeyError: 'battery'



2021-07-22 08:33:00 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up eufy_security platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 258, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 666, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 453, in _async_write_ha_state
state = self._stringify_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 425, in _stringify_state
state = self.state
File "/config/custom_components/eufy_security/sensor.py", line 86, in state
return self.entity[self.key]
KeyError: 'battery'
2021-07-22 08:33:01 ERROR (MainThread) [custom_components.eufy_security] eufy_security - Exception - process_messages : 'battery' - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/websocket.py", line 65, in process_messages
await self.on_message(msg)
File "/config/custom_components/eufy_security/websocket.py", line 81, in on_message
await self.message_callback(message)
File "/config/custom_components/eufy_security/coordinator.py", line 170, in on_message
self.async_set_updated_data(self.data)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 287, in async_set_updated_data
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 453, in _async_write_ha_state
state = self._stringify_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 425, in _stringify_state
state = self.state
File "/config/custom_components/eufy_security/sensor.py", line 86, in state
return self.entity[self.key]
KeyError: 'battery'



2021-07-22 08:33:01 ERROR (MainThread) [homeassistant.components.binary_sensor] eufy_security: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 432, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 601, in async_device_update
await task
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 336, in async_update
await self.coordinator.async_request_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 141, in async_request_refresh
await self._debounced_refresh.async_call()
File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 78, in async_call
await task
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 165, in async_refresh
await self._async_refresh(log_failures=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 453, in _async_write_ha_state
state = self._stringify_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 425, in _stringify_state
state = self.state
File "/config/custom_components/eufy_security/sensor.py", line 86, in state
return self.entity[self.key]
KeyError: 'battery'

@fuatakgun fuatakgun self-assigned this Jul 22, 2021
@fuatakgun fuatakgun added the bug label Jul 22, 2021
@jbrukardt
Copy link

Adding some log data to this. Eufy 2k indoor cameras

Logger: homeassistant.components.stream.worker
Source: components/stream/worker.py:215
Integration: Stream (documentation, issues)
First occurred: 3:55:58 PM (42 occurrences)
Last logged: 4:05:54 PM

Error opening stream None

No stream under any circumstances, including when start stream service command is issued.

@fuatakgun
Copy link
Owner

Adding some log data to this. Eufy 2k indoor cameras

Logger: homeassistant.components.stream.worker
Source: components/stream/worker.py:215
Integration: Stream (documentation, issues)
First occurred: 3:55:58 PM (42 occurrences)
Last logged: 4:05:54 PM

Error opening stream None

No stream under any circumstances, including when start stream service command is issued.

can you confirm that you have enabled rtsp stream from camera? i believe supports rtsp.

@jbrukardt
Copy link

Adding some log data to this. Eufy 2k indoor cameras

Logger: homeassistant.components.stream.worker
Source: components/stream/worker.py:215
Integration: Stream (documentation, issues)
First occurred: 3:55:58 PM (42 occurrences)
Last logged: 4:05:54 PM

Error opening stream None

No stream under any circumstances, including when start stream service command is issued.

can you confirm that you have enabled rtsp stream from camera? i believe supports rtsp.

Confirmed

Setting screenshot: https://i.imgur.com/j51XPp4.png

@fuatakgun
Copy link
Owner

fuatakgun commented Jul 22, 2021

After you call camera.turn_on or start_livestream, can you also check the logs of Add On which is used mainly communication with devices.

if you can enable excessive logging for the integration and share the logs, i could have a deep dive investigation.

logger:
  default: warning
  logs:
    custom_components.eufy_security: debug
    haffmpeg.core: debug
    ffmpeg: debug

@dsjackson
Copy link

See attached logs
logs.txt

@fuatakgun
Copy link
Owner

See attached logs
logs.txt

Can you confirm you have the latest codebase?

@dsjackson
Copy link

Installed everything 21 July...certainly can update to make sure code is current.

@jbrukardt
Copy link

Latest codebase here (f948623) please see attached log.

Issued the service call to start streams on all devices at 2021-07-23 10:38:26. Something very obviously changed when that was issued as the logging blew up (truncated the log slightly after that for size), but still no livestream.

log:
home-assistant.txt

Installed everything 21 July...certainly can update to make sure code is current.

ancient history by fuat's coding speed :D i think theres been three revs since then.

@apokha1
Copy link
Author

apokha1 commented Jul 23, 2021

Finally, with the latest update, I was able to get the camera entity along with Motion Sensor, Person Detector Sensor, Ringing Sensor. But, the camera entity fails to start the live stream. I do get a still image when there is an event, but unable to start the live feed.

There seem to be tons of eufy_security strings in the log file.

image

File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
BrokenPipeError: [Errno 32] Broken pipe
2021-07-23 11:50:43 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:43 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:43 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:43 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream eufy_security-T8200N001939068F.m3u8
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:44 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (Thread-22) [pychromecast.socket_client] [Play Area speaker(192.168.11.25):8009] Failed to connect to service ServiceInfo(type='mdns', data='Google-Home-Mini-53650d3cd8b0a82b5c01e1e7b6d47b9b._googlecast._tcp.local.'), retrying in 5.0s
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:45 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:46 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:46 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:46 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:46 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:46 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:46 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:46 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:46 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:46 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:47 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:47 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:47 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:47 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:47 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:47 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file
2021-07-23 11:50:47 ERROR (MainThread) [custom_components.eufy_security] eufy_security Exception in video : I/O operation on closed file - traceback: Traceback (most recent call last):
File "/config/custom_components/eufy_security/camera.py", line 240, in process_frames
self.ffmpeg.process.stdin.write(frame_bytes)
ValueError: I/O operation on closed file

The log goes on and on with similar data, I am assuming whenever I am trying to start the stream, this is happening.

Please let me know if I am doing anything wrong, or if I need to do anything on my end to help identify and solve the bug if it is one.

@dsjackson
Copy link

Will confirm...latest update shows cameras (and static images). Live stream fails. All-in-all, excellent progress!

@rpitera
Copy link

rpitera commented Jul 23, 2021

Seconded @dsjackson findings - same here. Also same on progress - getting from no cameras to semi working was fast!

@fuatakgun
Copy link
Owner

fuatakgun commented Jul 23, 2021

Please confirm you have enabled ffmpeg in your setup.

  • FFMPEG is a required integration to make this thing working, double check your configuration.yaml file if it is enabled. More information: https://www.home-assistant.io/integrations/ffmpeg/
  • give me more information about your home assistant setup (os, installation method), as live stream functionality is creating a file on main directory of home assistant, it might be related to your setup.
  • as a last resort, i am ready to spare time to connect your local add on if you can expose your IP address temporarily to me, so we can nail down the issue faster.

@rpitera
Copy link

rpitera commented Jul 23, 2021

Install: Home Assistant OS 6.1 / core-2021.7.4 / supervisor-2021.06.8 Running on Virtualbox on a dedicated Win10 Pro workstation. I could provide access to the server via SplashTop if it would help or provide a login to the HA instance.

System Health

version core-2021.7.4
installation_type Home Assistant OS
dev false
hassio true
docker true
virtualenv false
python_version 3.9.5
os_name Linux
os_version 5.10.45
arch x86_64
timezone America/New_York
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 5000
Installed Version 1.13.2
Stage running
Available Repositories 856
Installed Repositories 63
AccuWeather
can_reach_server ok
remaining_requests 42
Home Assistant Cloud
logged_in true
subscription_expiration August 16, 2021, 8:00 PM
relayer_connected true
remote_enabled true
remote_connected true
alexa_enabled true
google_enabled true
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 6.1
update_channel stable
supervisor_version supervisor-2021.06.8
docker_version 20.10.6
disk_total 30.8 GB
disk_used 17.7 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Terminal & SSH (9.1.3), ADB - Android Debug Bridge (0.8.0), ESPHome (1.20.0), Visual Studio Code (3.6.0), Let's Encrypt (4.11.0), Node-RED (9.2.1), Home Assistant Google Drive Backup (0.104.3), MariaDB (2.4.0), Check Home Assistant configuration (3.8.0), Glances (0.12.3), Bitwarden (Vaultwarden) (0.12.0), Portainer (1.5.1), Tautulli (2.3.0), phpMyAdmin (0.4.3), php-nginx Docker Image (latest), rest980 Docker Image (20200205), ioBroker (0.8.0), eufy_security_addon (latest)
Lovelace
dashboards 2
resources 48
views 28
mode storage

I'm using FFMPEG with other cameras (Like Wyze RTSP streams) and they are currently working so I believe I have FFMPEG installed and running correctly.

ffmpeg:

is confirmed in my configuration.yaml. Also RTSP is set on all of my compatible eufycams; it has been for months as I was testing out the other options (Fuzzy's custom component, MQTT, ioBroker, etc.). The account I'm using for your component/add on pair are not is use anywhere else. That's about all I can think of off the top of my head.

@rpitera
Copy link

rpitera commented Jul 23, 2021

Also was wondering about this - In the dev service screen, the start/top llivestream service shows targets (devices/entities) as shown here:

stream

but the start/stop RTSP services doesn't show any options for selecting a target at all:

rtsp

Is this as expected or does this indicate an issue on my end?

@jbrukardt
Copy link

Please confirm you have enabled ffmpeg in your setup.

  • FFMPEG is a required integration to make this thing working, double check your configuration.yaml file if it is enabled. More information: https://www.home-assistant.io/integrations/ffmpeg/
  • give me more information about your home assistant setup (os, installation method), as live stream functionality is creating a file on main directory of home assistant, it might be related to your setup.
  • as a last resort, i am ready to spare time to connect your local add on if you can expose your IP address temporarily to me, so we can nail down the issue faster.
  1. Confirmed that ffmpeg is enabled in my configuration.yaml, and installed on my base system.

  2. Home assistant supervised install on debian 10.

  3. If it helps you troubleshoot for everyone, im glad to create a user for you, but you definitely should not feel obligated to offer me personalized tech support

@jbrukardt
Copy link

Install: Home Assistant OS 6.1 / core-2021.7.4 / supervisor-2021.06.8 Running on Virtualbox on a dedicated Win10 Pro workstation. I could provide access to the server via SplashTop if it would help or provide a login to the HA instance.

System Health

version core-2021.7.4
installation_type Home Assistant OS
dev false
hassio true
docker true
virtualenv false
python_version 3.9.5
os_name Linux
os_version 5.10.45
arch x86_64
timezone America/New_York
Home Assistant Community Store
AccuWeather
Home Assistant Cloud
Home Assistant Supervisor
Lovelace
I'm using FFMPEG with other cameras (Like Wyze RTSP streams) and they are currently working so I believe I have FFMPEG installed and running correctly.

ffmpeg:

is confirmed in my configuration.yaml. Also RTSP is set on all of my compatible eufycams; it has been for months as I was testing out the other options (Fuzzy's custom component, MQTT, ioBroker, etc.). The account I'm using for your component/add on pair are not is use anywhere else. That's about all I can think of off the top of my head.

I have had similar issues on all those other implementations to the issues im having here, did you get streams working on any of them? The only one i got to work was the webRTC of the actual RSTP stream the cam is spitting out, but CPU usage was way too high even on my i5 NUC to maintain it.

@rpitera
Copy link

rpitera commented Jul 23, 2021

I have had similar issues on all those other implementations to the issues im having here, did you get streams working on any of them?

It's been a while, but I remember getting a couple of cams to work with those components, not 100% reliably but enough times to know that it worked.

@apokha1
Copy link
Author

apokha1 commented Jul 24, 2021

I am assuming it is related to the file created in the main directory of the Home Assistant Install. I have re-installed the latest version, most of the prior error logs have vanished, but the stream does not seem to work.

My installation is docker HA installed on the dedicated Ubuntu LTS 20.04 Desktop. ffmpeg: is enabled in my configuration.yaml file.

Here is the server info:

System Health

version core-2021.7.4
installation_type Home Assistant Container
dev false
hassio false
docker true
virtualenv false
python_version 3.9.5
os_name Linux
os_version 5.8.0-63-generic
arch x86_64
timezone America/Chicago
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4876
Installed Version 1.13.2
Stage running
Available Repositories 850
Installed Repositories 7
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Lovelace
dashboards 4
resources 1
views 33
mode storage

The only errors I see on the log file are

2021-07-24 09:48:39 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None
2021-07-24 09:48:49 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None
2021-07-24 09:49:09 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None
2021-07-24 09:49:39 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None
2021-07-24 09:50:19 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None
2021-07-24 09:51:09 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream None

@fabianluque
Copy link

I’ve got the stream to work. Something is wrong when the integration starts with my 2K indoor camera with RTSP enabled.

In order for the stream to work I have to call the Camera Turn Off service followed by the Camera Turn On service. After that, stream starts working properly.

I’ve had a few instances where the stream will stop working due to “demuxing errors” and wasn’t able to recover by itself forcing me to redo the above steps.

@rpitera
Copy link

rpitera commented Jul 24, 2021

I can confirm the same as @fabianluque on my system. (Brilliant find BTW! Thanks!!) Turned off then on and the stream came up right away. Tested with two of my cams, both worked the same.

@fuatakgun
Copy link
Owner

any logs you can share?

@jbrukardt
Copy link

@fuatakgun Updated to latest, my T8400 camera (2K IndoorCam with RTSP enabled) became unavailable. I reinstalled the integration and now my camera entity is gone, I still have all the sensors though. eufy_security_addon also updated to version 0.3.3.

Ive had weirdness as well. The camera entity is only showing up for 2 of my 8 cams (the 2 with SD cards in them, but also rstp enabled). The other devices are all there, and all their sensors are functioning, but no camera entity.

Same versions.

No errors in logs, and all devices are detected by the addon as shown in the logs. I think its something with the auto-creation of entities by the integration

@fabianluque
Copy link

fabianluque commented Jul 28, 2021

@fuatakgun Here are some logs:

Removed.

@fuatakgun
Copy link
Owner

can you double check that you have enabled notifications with picture? There is no picture URL her to show as a placeholder and I am intentionally skipping these entities. I can try to find another way of doing this but you will have no still image.

@jbrukardt
Copy link

Double checked on mine that "thumbnail included" is present on all cameras for notification mode.

I think this a 2c vs 2k thing. The 2c's all store last thumbnail on the home base. The 2k's dont store last thumbnail anywhere persistent UNLESS you have an SD card in them. Id hypothesize thats why my two cameras with sd cards in them are working but the others arent. In previous versions of the integration I would get no-picture-url placeholders for the cams without sd cards in them, and then as motion events were triggered on that cam, they would update the lovelace card.

@fuatakgun
Copy link
Owner

fuatakgun commented Jul 28, 2021

ok, let's fix it, I will release a fix tonight in EU time zone (in couple of hours)

@fabianluque
Copy link

@fuatakgun @jbrukardt Can confirm the thumbnail behavior. Before the update I would get no image until there were some events triggered.

@fuatakgun
Copy link
Owner

can you share your device for testing purposes with admin rights?
if you are located in EU, use my account: fuatakgun@gmail.com
if you are located in US, use test account: eufydeveloper@gmail.com

@jbrukardt
Copy link

be aware that if you're testing on my "basement" device @fuatakgun that one does have an SD card in it, so it may not be good for testing this issue.

@fuatakgun
Copy link
Owner

be aware that if you're testing on my "basement" device @fuatakgun that one does have an SD card in it, so it may not be good for testing this issue.

which one I should rely? :)

@jbrukardt
Copy link

eeek... i dont have any I can share with you that dont have an sd card in em. Theyre all in my living spaces.

You could eject the card in app i guess? i think you can do that as an admin.

@fuatakgun
Copy link
Owner

i can only format but not eject, so you dont have sutaible camera to share. let's wait @fabianluque 's response than

@fabianluque
Copy link

fabianluque commented Jul 28, 2021

i can only format but not eject, so you dont have sutaible camera to share. let's wait @fabianluque 's response than

Just shared one my 2K cameras with you, admin rights. Let me know if it works for you.

@fuatakgun
Copy link
Owner

fuatakgun commented Jul 28, 2021

please get latest codebase (1 min ago) and you will have camera. There is also one good improvement for you, picture will be updated while streaming automatically. Please resolve if it is done.

No update on add on, just integration

While i was connected, i confirmed that integration is automatically noticing that RTSP is on and trying to generate image. RTSP would not work if home assistant instance is not in the same network, so I switched to p2p live stream and validated that stream and live image is working fine.

@fabianluque
Copy link

@fuatakgun Awesome, let me update and test.

@jbrukardt
Copy link

waiting for the update to show up in hacs and then ill do it.

@fabianluque
Copy link

@fuatakgun Confirmed, fix works beautifully! Thanks so much! Removing access until next time. :)

@fuatakgun
Copy link
Owner

Let's hope we dont need it anymore :-) @jbrukardt , can you also validate with your cameras?

@jbrukardt
Copy link

can do. Just waiting for HA. Its hanging on restart waiting for something :/

@fuatakgun
Copy link
Owner

fuatakgun commented Jul 28, 2021

Do you see what keeps it hanging? Normally, it should mention which integration is holding it. I hope it is not about this one :-)

@jbrukardt
Copy link

ok, all cameras are detected again and have snapshots.

Streams working too!

@jbrukardt
Copy link

jbrukardt commented Jul 28, 2021

Do you see what keeps it hanging? Normally, it should mention which integration is holding it. I hope it is not about this one :-)

Honestly, it is this the integration sometimes :p but lets let that sleeping dog lie for now. We'll go for functionality first, then stability.

@fuatakgun
Copy link
Owner

There are many stuff happening at startup, i can definitely improve them.

@dsjackson
Copy link

After the latest code update (thanks for the frequent updates and improvements), wired doorbell no longer shown (Generates error: This entity is currently unavailable and is an orphan to a removed, changed or dysfunctional integration or device.) and the 2c's I have show the snapshot with RTSP-Streaming (before, just Streaming) but no longer stream.

@fuatakgun
Copy link
Owner

fuatakgun commented Jul 28, 2021

I know the issue about doorbell but i am not sure about 2c, any luck you can share it?

Update: published another version of integration, please check if you have latest version of integration and 0.3.3 version of add on.

I just wanted to separate streaming-rtsp vs streaming-p2p as it is difficult most of the time for users what is happening, so state is fine.

@jbrukardt
Copy link

Great enhancement to add the tag for streaming type. Thats really handy for troubleshooting the streaming method. All mine show rstp (as they should)

@dsjackson
Copy link

I know the issue about doorbell but i am not sure about 2c, any luck you can share it?

Update: published another version of integration, please check if you have latest version of integration and 0.3.3 version of add on.

I just wanted to separate streaming-rtsp vs streaming-p2p as it is difficult most of the time for users what is happening, so state is fine.

Confirmed that the 2C's now work as expected. Wired doorbell shows "Streaming - p2p" but no snapshot and no streaming. An earlier version (a few days ago...I will I had the version number) worked fine...a version before you added the streaming type tag.

@fuatakgun
Copy link
Owner

fuatakgun commented Jul 29, 2021

@dsjackson please create a separate issue, this became unmanageable. And share logs with it. And you can share your camera with admin rights following readme file and let me know the name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants