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 Connect and Disconnect events in the time line and triggers #3910

Open
bagobones opened this issue Sep 23, 2022 · 14 comments
Open

Camera Connect and Disconnect events in the time line and triggers #3910

bagobones opened this issue Sep 23, 2022 · 14 comments
Labels
enhancement New feature or request pinned

Comments

@bagobones
Copy link

Describe what you are trying to accomplish and why in non technical terms
Connect and Disconnect events should show up in the timeline and should be available in home assistant

Describe the solution you'd like
Building on #3846 I think it should be standard to show these in the events timeline send notices (maybe optional) as disconnected cameras both can be a major event and can sometimes be just a nuisance for WiFi cameras that do it often.

Maybe some additional filter settings like offline for x that would ignore the offline and online event if it was short.. The timer would start when the camera goes off, then if it is back on before the end no offline or online event is made.

IE I want to ignore short 5 min blips on a WiFi camera but want to know if a camera has completely been offline for 10 min when it went offline and when it came back.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Building on ignoring distortion it is important to know WHEN the cameras stopped recording so you know what time periods where missed. Especially if you are doing motion or object only recording as it will not be obvious.

@bagobones bagobones added the enhancement New feature or request label Sep 23, 2022
@NickM-27
Copy link
Collaborator

I'm adding support for that to show up in the notifications on the frontend: #3243

not sure I personally see it making sense showing it in the current events page but will be curious to see what others think

@bagobones
Copy link
Author

In particular for me it serves to track if an unreliable camera goes offline, it also ties in to the reconnect garbage / distortion that sometimes happens when a camera reconnects.

Most of these requests come from issues with cheaper cameras / cameras on WiFi but are common features.. (surveillance station and most other NVRs report camera disconnects as a significant event.)

My WiFi doorbell sometimes just stops working after months of being fine.

My cheap Wyze v2 running RTSP firmware sometimes just drops reconnects and distorts for a while.

My Reolink cameras seems fine now after changing to RTMP but on RTSP they would regularly distort for several seconds after a reconnect.

Having the event would help explain the recording / any false detections in that moment.

@NickM-27
Copy link
Collaborator

Yeah that makes sense, not sure if it'll go into the current event list but some sort of camera timeline would be nice.

@bagobones
Copy link
Author

Yeah that makes sense, not sure if it'll go into the current event list but some sort of camera timeline would be nice.

A camera timeline would be more clean, but the events allowing triggers in HA etc would still be important.

@NickM-27
Copy link
Collaborator

Adding it to the event timeline or a separate timeline wouldn't have any effect on its ability to be sent as an event under a new MQTT topic (either way wouldn't make sense to include it in the existing topic)

@bagobones
Copy link
Author

Ya not problem, I am fine with it being separate but I wanted to be clear the EVENT is what I want.. In particular I would like to send an HA notification if it has been down but not back up for X for example.

Just want it to clearly show up as a time line looking back.

This could even be used as a filter condition on other detection events which would be nice, sine I have had notifications when the garbage during startup gets sent as a bunch of false positives.

@NickM-27
Copy link
Collaborator

I think this will probably get broken into two parts. The MQTT events / HASS integration sensor will be a lot easier to implement and I may work on that soon, the frontend timeline will likely take more time.

@bagobones
Copy link
Author

Probably a separate request but detecting a camera that is UP (IP and stream) but displaying all black, all green, all purple or the majority of pixels are an unnatural color indicating the feed is down is also highly desirable and not something other NVRs tend to do.

@shrung
Copy link

shrung commented Sep 26, 2022

Following! I have some outdoor PoE cameras and have had a GFCI trip shut them off a couple times. It's not often, but I would love to be able to set up a notification in HA when the cameras go offline.

@Syco54645
Copy link

I too vote for a notification somewhere. Trying out different devices right now and it would be really nice to see that data before I settle on something.

@shrung
Copy link

shrung commented Feb 24, 2023

For now, I am using a Home Assistant automation to watch the FPS of each camera, and it has worked well as an offline detector. My freezer and cameras run on the same GFCI, and this has helped me catch it when it trips (rare, but important to know when it happens!).

I can post the automation if interested, basically just checks for fps <1 for over 1 minute.

@Syco54645
Copy link

For now, I am using a Home Assistant automation to watch the FPS of each camera, and it has worked well as an offline detector. My freezer and cameras run on the same GFCI, and this has helped me catch it when it trips (rare, but important to know when it happens!).

I can post the automation if interested, basically just checks for fps <1 for over 1 minute.

Oh yes please, that would be awesome! I am still messing with Frigate and am in the early phases. I currently only have 2 Wyze cameras (I know...) so I have not messed with the automations that I can build.

@shrung
Copy link

shrung commented Feb 24, 2023

Here is my automation for monitoring camera status, as I said, I use the FPS sensor at 0 as an indication that a camera is disconnected. You'll need to of course change "sensor.back_camera_fps" to match your camera's fps sensor name in home assistant:

alias: Camera FPS alert
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.back_camera_fps
    for:
      hours: 0
      minutes: 1
      seconds: 0
    below: 1
  - platform: numeric_state
    entity_id: sensor.front_camera_fps
    for:
      hours: 0
      minutes: 1
      seconds: 0
    below: 1
  - platform: numeric_state
    entity_id: sensor.side_camera_fps
    for:
      hours: 0
      minutes: 1
      seconds: 0
    below: 1
condition: []
action:
  - service: notify.notify_apps
    data:
      title: Camera Disconnected?
      message: Check that the cameras and freezer have power
      data:
        color: "#FF8800"
        notification_icon: mdi:cctv-off
mode: single

@Syco54645
Copy link

Syco54645 commented Feb 24, 2023

Here is my automation for monitoring camera status, as I said, I use the FPS sensor at 0 as an indication that a camera is disconnected.

Thank you. This put me in the right direction. I changed it to send a message any time any of my cameras drop and then sends an alert saying which camera. The entity ID in automations is incredibly powerful, so glad they added it.

Thank you for sharing, this will be a great stopgap fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned
Projects
None yet
Development

No branches or pull requests

4 participants