dermotduffy / frigate-hass-card

A Lovelace card for Frigate in Home Assistant
MIT License
551 stars 59 forks source link

When camera unavailable json data will be displayed #1649

Open kevin07042002 opened 1 week ago

kevin07042002 commented 1 week ago

Checklist:

[REQUIRED] Card diagnostic information: Card diagnostics. Please review for confidential information prior to sharing

{
  "ha_version": "2024.10.1",
  "card_version": "5.2.0",
  "browser": "Mozilla/5.0 (X11; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0",
  "date": "2024-10-16T15:09:08.544Z",
  "frigate_version": {
    "2695236f61dad4a7afd8c1885ce62792": "5.4.0/0.14.1-f4f3cfa"
  },
  "lang": "en",
  "timezone": "Europe/Berlin",
  "git": {
    "build_version": "5.2.0-HEAD+g69249b6",
    "build_date": "Fri, 23 Jun 2023 15:26:26 GMT",
    "commit_date": "Thu, 22 Jun 2023 09:21:26 -0600"
  },
  "config": {
    "type": "custom:frigate-card",
    "cameras": [
      {
        "camera_entity": "camera.carport",
        "live_provider": "go2rtc",
        "go2rtc": {
          "modes": [
            "webrtc"
          ]
        }
      }
    ],
    "elements": [
      {
        "type": "conditional",
        "conditions": [
          {
            "condition": "state",
            "entity": "switch.gs308ep_1_poe_power",
            "icon": "mdi:toggle-switch",
            "state": "on"
          }
        ],
        "elements": [
          {
            "type": "custom:frigate-card-menu-state-icon",
            "entity": "switch.gs308ep_1_poe_power",
            "icon": "mdi:toggle-switch-off",
            "style": {
              "state": "on",
              "color": "rgb(0, 255, 0)"
            },
            "tap_action": {
              "action": "toggle"
            }
          }
        ]
      },
      {
        "type": "conditional",
        "conditions": [
          {
            "condition": "state",
            "entity": "switch.gs308ep_1_poe_power",
            "icon": "mdi:toggle-switch",
            "state": "off"
          }
        ],
        "elements": [
          {
            "type": "custom:frigate-card-menu-state-icon",
            "entity": "switch.gs308ep_1_poe_power",
            "icon": "mdi:toggle-switch",
            "style": {
              "state": "off",
              "color": "rgb(255, 0, 0)"
            },
            "tap_action": {
              "action": "toggle"
            }
          }
        ]
      }
    ],
    "live": {
      "show_image_during_load": true,
      "preload": false
    }
  }
}
´´´

<!--
On the card, hold down the Default/Frigate menu button for a few seconds then paste the diagnostics below. No help can be provided without this
-->

A snippet from the frontend config:

```yaml
square: true
columns: 2
type: grid
cards:
  - type: custom:frigate-card
    cameras:
      - camera_entity: camera.carport
        live_provider: go2rtc
        go2rtc:
          modes:
            - webrtc
    elements:
      - type: conditional
        conditions:
          - condition: state
            entity: switch.gs308ep_port_1_poe_power
            icon: mdi:toggle-switch
            state: "on"
        elements:
          - type: custom:frigate-card-menu-state-icon
            entity: switch.gs308ep_port_1_poe_power
            icon: mdi:toggle-switch-off
            style:
              state: "on"
              color: rgb(0, 255, 0)
            tap_action:
              action: toggle
      - type: conditional
        conditions:
          - condition: state
            entity: switch.gs308ep_1_poe_power
            icon: mdi:toggle-switch
            state: "off"
        elements:
          - type: custom:frigate-card-menu-state-icon
            entity: switch.gs308ep_1_poe_power
            icon: mdi:toggle-switch
            style:
              state: "off"
              color: rgb(255, 0, 0)
            tap_action:
              action: toggle
    live:
      show_image_during_load: true
      preload: false

[REQUIRED] Description of problem: I integrated a button in the frontend to shutdown / reboot the cameras over a poe switch. When the camera is off the string is "camera is unavailable" is displayed on top of the view followed by json data. Expected would be only a view of the string without the json output

[OPTIONAL] Last working release (if known):

[OPTIONAL] Javascript errors shown in the web inspector:

[OPTIONAL] Additional information:

dermotduffy commented 1 week ago

Firstly, recommend changing to the latest beta which changes some of how unavailable cameras are handled: https://github.com/dermotduffy/frigate-hass-card/releases/tag/v6.0.0-beta.8

integrated a button in the frontend to shutdown / reboot the cameras over a poe switch. When the camera is off the string is "camera is unavailable" is displayed on top of the view followed by json data. Expected would be only a view of the string without the json output

Can you include a screenshot of what appears? You want the diagnostics message to not appear? The issue here is of course that it is hard for the card to tell the difference between:

tootai commented 6 days ago

Hi, same request here, I would that if cameras are disabled in frigate they don't appear in birdseye or just their name. At this time we see: Capture d’écran du 2024-10-21 16-46-33

dermotduffy commented 6 days ago

@tootai The card cannot control what does or does not show up in birdseye, that is decided by the Frigate backend. I'd recommend you update to the latest beta (linked in my previous comment on this issue), as it changes how an unavailable camera behaves (does not block the whole card the way it does in v5.20).