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

Trigger issue (or documentation unclear) #1856

Closed
nappa85 opened this issue Jan 25, 2025 · 4 comments
Closed

Trigger issue (or documentation unclear) #1856

nappa85 opened this issue Jan 25, 2025 · 4 comments

Comments

@nappa85
Copy link

nappa85 commented Jan 25, 2025

I'm trying to configure the card to switch live camera on trigger. I don't have a frigate server, I'm using vanilla HA. From the documentation is stated that only frigate cameras have built-in motion trigger. But I can use binary sensors, documentation states it works for frigate and non-frigate cameras.

Config example

type: custom:frigate-card
cameras:
  - camera_entity: camera.a
    triggers:
      entities:
        - binary_sensor.a_motion
        - input_boolean.motion_a
  - camera_entity: camera.b
    triggers:
      entities:
        - binary_sensor.b_motion
        - input_boolean.motion_b
  - camera_entity: camera.c
    triggers:
      entities:
        - binary_sensor.c_motion
        - input_boolean.motion_c
view:
  default: live
  triggers:
    filter_selected_camera: false
    actions:
      trigger: live
      untrigger: none
      interaction_mode: all
automations:
  - conditions:
      - condition: triggered
        triggered:
          - camera.a
    actions:
      - action: custom:frigate-card-action
        frigate_card_action: camera_select
        camera: camera.a
      - action: custom:frigate-card-action
        frigate_card_action: log
        message: a
        level: error
  - conditions:
      - condition: triggered
        triggered:
          - camera.b
    actions:
      - action: custom:frigate-card-action
        frigate_card_action: camera_select
        camera: camera.b
      - action: custom:frigate-card-action
        frigate_card_action: log
        message: b
        level: error
  - conditions:
      - condition: triggered
        triggered:
          - camera.c
    actions:
      - action: custom:frigate-card-action
        frigate_card_action: camera_select
        camera: camera.c
      - action: custom:frigate-card-action
        frigate_card_action: log
        message: c
        level: error

With this config I would expect, when I trigger a camera, to have at least an error log in browser's console, but nothing happens.
Automations have been added after default view trigger configuration did not work.

The two kind of sensors are:

  • binary_sensor._motion is the built-in motion sensor, it works but it goes off quite quickly
  • input_boolean.motion_ is a boolean sensor I manage with a timer to keep it on for at least 1 minute

Those sensors are working correctly in another dashboard where all cameras built-in HA live view are present, but I control each one visibility via those boolean sensors.

Am I doing something wrong or does triggers not work without a frigate server?

@dermotduffy
Copy link
Owner

dermotduffy commented Jan 27, 2025

I don't have a frigate server, I'm using vanilla HA. From the documentation is stated that only frigate cameras have built-in motion trigger. But I can use binary sensors, documentation states it works for frigate and non-frigate cameras.

Correct!

Am I doing something wrong or does triggers not work without a frigate server?

I don't think you're doing anything wrong. I took your config, just changed the camera and entity names (replacing your entities with a simple switch), and it all appears to work fine: it changes to the selected camera, and outputs a log line. So not sure why it's not working for you.

Perhaps first suggest ruling out something weird with the trigger entities, maybe try (as above) to use a single simple switch that you can toggle in one HA dashboard whilst watching the card in another, and see what happens?

Also be good to know exactly what version of the card you're on.

@dermotduffy
Copy link
Owner

dermotduffy commented Jan 27, 2025

BTW: If your goal is simply to change to the live view for for the triggered camera (and not to log lines or take other actions), you don't need that entire automations block. Useful for debugging, though -- but the view/camera changing should/does work without any of that automation when you have the trigger action set to live (like you do).

@nappa85
Copy link
Author

nappa85 commented Jan 27, 2025

Sorry, I was using latest version at the time, 6.3.8. My HA is on docker, so I've simply downloaded "Zip distribution" from tag page and placed under HA's www folder, then manually added the resource.

Now I've just updated to 6.4.0 and, without touching the config, it seems to work

@dermotduffy
Copy link
Owner

Glad it's working, although nothing in the trigger logic has changed recently, so either there's still some unresolved issue here or something went a bit strange with your setup. In any case, I hope it stays working. Good luck.

@dermotduffy dermotduffy closed this as not planned Won't fix, can't repro, duplicate, stale Jan 28, 2025
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

2 participants