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

Reolink sub stream capturing snapshots from main stream #90792

Closed
angrycatmeowmeow opened this issue Apr 4, 2023 · 9 comments · Fixed by #90591
Closed

Reolink sub stream capturing snapshots from main stream #90792

angrycatmeowmeow opened this issue Apr 4, 2023 · 9 comments · Fixed by #90591

Comments

@angrycatmeowmeow
Copy link

angrycatmeowmeow commented Apr 4, 2023

The problem

I do not have any main stream entities enabled for any of my reolink cameras, but when executing a service call - service: camera.snapshot, the image is from the main stream.

The main stream on my Reolink Trackmix is 3840x2160, and the substream is 896x512. If I look at the image in my file editor, it is around 1mb and 3840x2160. If it was coming from the substream it would be 896x512.

I see the same behavior on my E1 Zoom, E1 Outdoor, WiFi Doorbell and Trackmix cameras. They all produce snapshots the resolution of the main stream.

I also enabled the snapshots stream for the Trackmix, and it gives me snapshots of the main stream.

What version of Home Assistant Core has the issue?

core-2023.3.6

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

reolink

Link to integration documentation on our website

https://www.home-assistant.io/integrations/reolink/

Diagnostics information

home-assistant_reolink_2023-04-04T17-20-26.511Z.log

Example YAML snippet

alias: Notification - Driveway Motion
description: ""
trigger:
  - type: turned_on
    platform: device
    device_id: 1d2dcf7f3300e122b6b7a7fc21a2150d
    entity_id: binary_sensor.driveway_person
    domain: binary_sensor
  - type: turned_on
    platform: device
    device_id: 1d2dcf7f3300e122b6b7a7fc21a2150d
    entity_id: binary_sensor.driveway_pet
    domain: binary_sensor
  - type: turned_on
    platform: device
    device_id: 1d2dcf7f3300e122b6b7a7fc21a2150d
    entity_id: binary_sensor.driveway_vehicle
    domain: binary_sensor
condition:
  - type: is_not_open
    condition: device
    device_id: 99c9d9eda13e2a8e1657d1ecdb14d405
    entity_id: binary_sensor.pressure_washer_sensor_contact
    domain: binary_sensor
action:
  - service: camera.snapshot
    data:
      filename: /config/www/images/driveway.jpg
    target:
      entity_id:
        - camera.driveway_sub
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: notify.only_phones
    data:
      message: Driveway Motion
      data:
        image: /local/images/driveway.jpg
        ttl: 0
        priority: high
        action: URI
        title: Open Reolink
        uri: app://com.mcu.reolink
        clickAction: app://com.mcu.reolink
      title: Tap to open Reolink app
  - service: notify.living_room_tv_notifications
    data:
      message: Driveway Motion
      data:
        duration: 10
        fontsize: max
        position: top-left
        image:
          path: /config/www/images/driveway.jpg
        timeout: 30
  - delay:
      hours: 0
      minutes: 3
      seconds: 0
      milliseconds: 0
mode: single

Anything in the logs that might be useful for us?

No response

Additional information

The cameras are connected to an NVR, but the NVR is not connected to HA. The Reolink integration connects directly to the cameras. As there is a limit on the number of main streams, I think this might be why my cameras freeze up or won't load when I try to view the stream in HA. I think HA is pulling the main stream somehow which is clogging up the NVR and direct connection to the cameras.

@home-assistant
Copy link

home-assistant bot commented Apr 4, 2023

Hey there @starkillerOG, mind taking a look at this issue as it has been labeled with an integration (reolink) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of reolink can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign reolink Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


reolink documentation
reolink source
(message by IssueLinks)

@starkillerOG
Copy link
Contributor

@angrycatmeowmeow you are right, I have already fixed this in this PR: #90591
That is under review and will most likely only be included in HA 2023.5, so unfortunately it seems you will have to wait a while, but the fix is comming!

@starkillerOG
Copy link
Contributor

If you appreciate the reolink integration and want to support its development, please consider sponsering the upstream library.

@angrycatmeowmeow
Copy link
Author

@starkillerOG awesome thank you. I noticed in the PR that it says the autotrack stream is already available when the camera is directly connected to HA, yet I don't have this stream on my Trackmix. Is this an upcoming feature in 2023.4?

I'm also curious about the video streams. I don't have the snapshots entity enabled for any of the cameras, I am just using the call service camera.snapshot to get a picture from camera.doorbell_sub for example. So it seems the sub stream in HA is actually the main stream. Will this be fixed w/ your PR or does that PR only apply to the snapshots entity?

@starkillerOG
Copy link
Contributor

@angrycatmeowmeow yes that is new in HomeAssistant 2023.4 wich has just been released, enjoy the update :)

Snapshots are not generated from the stream but are requested from the camera seperately, even when calling camera.snapshot it will not use the stream.

The mentioned PR will fix the snapshot commands such that the sub stream entity will also use the low resolution snapshot, currently the high resolution snapshot is always used.
Note that some models of camera's do not support low resolution snapshots and will always return high resolution snapshots, if that is the case for your model you will have to ask reolink support to fix this in their firmware.

@angrycatmeowmeow
Copy link
Author

Great news, thank you for the explanation and awesome integration.

All of this came up because I am sending a snapshot of motion using the nfandroidtv integration, and the high res snapshots cause my automation to error out and stop when sending them to my CC w/ GTV. Even though the image is sent and the automation works, apparently there is some limitation on file size for the NFATV app that causes an HTTP timeout to occur, and continue on error is not supported there.

@starkillerOG
Copy link
Contributor

I will close this now, since a fix is comming.

If you appreciate the reolink integration and want to support its development, please consider sponsering the upstream library.

@starkillerOG
Copy link
Contributor

@home-assistant close

@home-assistant home-assistant bot closed this as completed Apr 7, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 7, 2023
@starkillerOG
Copy link
Contributor

The fix will be included in HA 2023.6 that will be released in about a week.

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

Successfully merging a pull request may close this issue.

2 participants