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 selection using query params fails with generic cameras #1244

Closed
2 tasks done
Neonox31 opened this issue Aug 12, 2023 · 4 comments
Closed
2 tasks done

Camera selection using query params fails with generic cameras #1244

Neonox31 opened this issue Aug 12, 2023 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@Neonox31
Copy link

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
5.2.0

Browser and Operating System:
Google Chrome 114.0.5735.198
Linux 6.4.2-arch1-1 x86_64

Description of problem:

First, thanks for this awesome card 👍

I've setup the frigate card with mixed camera types (2 frigates one and a generic one) and when I try to use query parameters in my browser with the camera_select action it works with frigate cameras but not with generic ones, the first frigate camera is always displayed in place of the generic one.

I tried to setup the dev environment to debug this situation, I was able to reproduce the bug but unfortunately I didn't succeed to debug it correctly.

Frigate card diagnostic information

{
  "ha_version": "2023.8.2",
  "card_version": "5.2.0",
  "browser": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
  "date": "2023-08-12T15:17:47.597Z",
  "frigate_version": {
    "a1aa42ac95b4a226543a397bdf61ce98": "4.0.0-rc1/0.12.1-367d724"
  },
  "lang": "en",
  "timezone": "Europe/Paris",
  "git": {
    "build_version": "5.2.0-main+g8e3a7b6",
    "build_date": "Sat, 12 Aug 2023 12:20:47 GMT",
    "commit_date": "Sat, 22 Jul 2023 08:10:42 -0700"
  },
  "config": {
    "type": "custom:frigate-card",
    "name": "Frigate Card with Frigate Camera",
    "debug": {
      "logging": true
    },
    "cameras": [
      {
        "camera_entity": "camera.garden_intercom",
        "title": "Interphone",
        "live_provider": "go2rtc",
        "frigate": {
          "url": "http://frigate:5000"
        }
      },
      {
        "camera_entity": "camera.garden_patio",
        "title": "Interphone",
        "live_provider": "go2rtc",
        "frigate": {
          "url": "http://frigate:5000"
        }
      },
      {
        "camera_entity": "camera.poulailler",
        "title": "Poulailler"
      }
    ]
  }
}

Additional information:

As I could see, frigate cards seems to send an additional event which trigger the correct view :
When selecting a generic camera using http://127.0.0.1:8123/lovelace/basic?frigate-card-action:camera_select=camera.poulailler:

card.ts:129  FRIGATE-HASS-CARD  Version 5.2.0 (Sat, 12 Aug 2023 12:20:47 GMT)
debug.ts:5 Frigate Card CameraManager initialized (Cameras:  Map(3) {'camera.garden_intercom' => {…}, 'camera.garden_patio' => {…}, 'camera.poulailler' => {…}} , Duration: 0.064s, )
debug.ts:5 Frigate Card view change:  [default]
debug.ts:5 Frigate Card view change:  View {view: 'live', camera: 'camera.poulailler', query: null, queryResults: null, context: null}
debug.ts:5 Frigate Card CameraManager request [Input queries: 1 , Cached output queries: 0 , Total output queries: 1 , Duration: 0.03s, , Queries: [{…}] , Results: Map(1) {{…} => {…}} ]
debug.ts:5 Frigate Card view change:  View {view: 'live', camera: 'camera.garden_intercom', query: EventMediaQueries, queryResults: MediaQueriesResults, context: {…}}
debug.ts:5 Frigate Card media load:  {width: 1280, height: 720, player: frigate-card-live-go2rtc.hidden, capabilities: {…}}

When selecting a frigate camera using http://127.0.0.1:8123/lovelace/basic?frigate-card-action:camera_select=camera.garden_patio:

card.ts:129  FRIGATE-HASS-CARD  Version 5.2.0 (Sat, 12 Aug 2023 12:20:47 GMT)
debug.ts:5 Frigate Card CameraManager initialized (Cameras:  Map(3) {'camera.garden_intercom' => {…}, 'camera.garden_patio' => {…}, 'camera.poulailler' => {…}} , Duration: 0.134s, )
debug.ts:5 Frigate Card view change:  [default]
debug.ts:5 Frigate Card view change:  View {view: 'live', camera: 'camera.garden_patio', query: null, queryResults: null, context: null}
debug.ts:5 Frigate Card CameraManager request [Input queries: 1 , Cached output queries: 0 , Total output queries: 1 , Duration: 0.091s, , Queries: [{…}] , Results: Map(1) {{…} => {…}} ]
debug.ts:5 Frigate Card view change:  View {view: 'live', camera: 'camera.garden_patio', query: EventMediaQueries, queryResults: MediaQueriesResults, context: {…}}
debug.ts:5 Frigate Card CameraManager request [Input queries: 1 , Cached output queries: 0 , Total output queries: 1 , Duration: 0.112s, , Queries: [{…}] , Results: Map(1) {{…} => {…}} ]
debug.ts:5 Frigate Card view change:  View {view: 'live', camera: 'camera.garden_intercom', query: EventMediaQueries, queryResults: MediaQueriesResults, context: {…}}
debug.ts:5 Frigate Card media load:  {width: 1280, height: 720, player: frigate-card-live-go2rtc.hidden, capabilities: {…}}
@Neonox31 Neonox31 added the bug Something isn't working label Aug 12, 2023
@dermotduffy
Copy link
Owner

Firstly, thank you for the bug report with all the right information, even debug logging. Really helpful.

I can reproduce this on my end, I'll get to the bottom of it. Thanks!

@felipecrs
Copy link
Contributor

I did not check the logs, but maybe you need to set an id for the camera for this to work, have you tried?

@dermotduffy
Copy link
Owner

dermotduffy commented Oct 7, 2023

The query string handling logic has been substantially refactored, and I can now verify this as working with a generic camera in the latest dev branch. Will be in the next build.

@Neonox31
Copy link
Author

Neonox31 commented Oct 8, 2023

Thanks a lot @dermotduffy !

@github-actions github-actions bot locked and limited conversation to collaborators Oct 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants