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

[Feature Request]: Provide option to trigger additional actions #69

Closed
bmck0118 opened this issue Aug 4, 2023 · 29 comments
Closed

[Feature Request]: Provide option to trigger additional actions #69

bmck0118 opened this issue Aug 4, 2023 · 29 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@bmck0118
Copy link

bmck0118 commented Aug 4, 2023

Describe what you are trying to accomplish and why in non technical terms
I want to be able to trigger additional actions on run so that I can send a message to google home or turn on a light based on occupacy for example

Describe the solution you'd like
Add an extra option to trigger a service / action or even a script in addition to sending a notification

Describe alternatives you've considered
Can't think of any while being able to utilise the benefits of this blueprint configuration. Option used currently is to create a separate automation triggered by the camera occupancy status but that doesn't easily provide the same filtering and options unless they are fully specified manually.

Additional context
Add any other context or screenshots about the feature request here.

@bmck0118 bmck0118 added the enhancement New feature or request label Aug 4, 2023
@SgtBatten
Copy link
Owner

There is a seperate branch called custom action. I built in months ago as many people requested this. But no-one is providing feedback on it.

Please try it and let me know what can be improved for your use case

@bmck0118
Copy link
Author

bmck0118 commented Aug 5, 2023

Perfect. I'll check it out and let you know. Thanks.

@reesion
Copy link

reesion commented Aug 12, 2023

There is a seperate branch called custom action. I built in months ago as many people requested this. But no-one is providing feedback on it.

Please try it and let me know what can be improved for your use case

Hi,

I am using the custom action branch but am unable to see the additional options. Am i missing anything?

@SgtBatten
Copy link
Owner

Please use the beta

@SgtBatten SgtBatten added the Awaiting Response Further information is requested label Aug 17, 2023
@SgtBatten
Copy link
Owner

SgtBatten commented Aug 24, 2023

Any feedback @reesion ?

@SgtBatten SgtBatten added Implemented Implemented and awaiting user confirmation and removed Awaiting Response Further information is requested labels Aug 24, 2023
@reesion
Copy link

reesion commented Aug 25, 2023

Any feedback @reesion ?

Hi, unfortunately I am unable to get it to work. I added a condition for after sunset and before sunrise to trigger a light switch but it doesn’t seem to work.

@SgtBatten
Copy link
Owner

it doesn’t seem to work.

It had been a while since I created it so after reviewing the code, I have reworked it just now. You will see 3 custom action fields now with some guidance

@reesion
Copy link

reesion commented Aug 25, 2023

C

I have reworked it just now.

can’t seem to find the beta codes.
Is this the correct url?
https://github.com/SgtBatten/HA_blueprints/blob/beta/Frigate%20Camera%20Notifications/Beta ?

@SgtBatten
Copy link
Owner

@reesion
Copy link

reesion commented Aug 26, 2023

https://github.com/SgtBatten/HA_blueprints/blob/custom_action/Frigate%20Camera%20Notifications/Beta

this doesn’t seem to work. I am using the ‘Auto trigger’ and have removed the conditions to eliminate the issue and just put a service Switch: Toggle to turn on a switch but still not working.

@SgtBatten
Copy link
Owner

Okay I will try to test soon

The manual trigger is working for me. Tested that yesterday to toggle a light

@reesion
Copy link

reesion commented Aug 28, 2023

The manual trigger is working for me. Tested that yesterday to toggle a light

I have tested the manual trigger and can confirm it worked as well. Just couldn't get the 'Auto trigger' working

@krystiancharubin
Copy link

krystiancharubin commented Aug 28, 2023

I've also been trying to get auto actions working but they are not triggering. Commented out most of the conditions leaving jus the length condition and it seems to still evaluate to false. Also tried to redefine it as a sequence variable since blueprint inputs are said to not work in template, but that also evaluated to false.

- alias: "Custom Action Auto"
  choose:
  - conditions:
      - "{{ custom_action_auto |length}}"
      # - "{{ not zone_only or (not zone_multi and zones|select('in', entered_zones)|list|length > 0) or (zone_multi and entered_zones|length > 0 and zones |reject('in', entered_zones) |list |length == 0) }}"
      # - "{{ not initial_home }}"
      # - "{{ not state_only or states(input_entity) in states_filter }}"
    sequence: !input "custom_action_auto"

@SgtBatten
Copy link
Owner

SgtBatten commented Aug 28, 2023

I haven't had a chance to try yet. When looking at the trace tree and clicking on the conditions step for this does it say condition 0 is false?

@krystiancharubin
Copy link

krystiancharubin commented Aug 28, 2023

Executed: August 28, 2023 at 7:58:28 AM
Result:
result: false
conditions/0
Executed: August 28, 2023 at 7:58:28 AM
Result:
result: false
entities: []

Creating action_auto variable from the input and changing the conditions to the following seems to make it enter the branch but it still did not seem to fire the action properly.

conditions:
  - '{{ action_auto |length > 0 }}'

btw this is the custom action I am trying to execute.

custom_action_auto:
  - service: notify.alexa_media
    data:
      message: Person detected at Front Door
      title: Frigate
      target:
        - media_player.living_room
      data:
        type: tts

EDIT: Retested with the variable and its working now.

@SgtBatten SgtBatten added bug Something isn't working and removed Implemented Implemented and awaiting user confirmation labels Aug 28, 2023
@SgtBatten
Copy link
Owner

SgtBatten commented Aug 28, 2023

Oh I know what it is.

Edit; you were on to it. I wasn't reading the input before testing how long it was. So always false as the variable didn't exist. I'll fix it later today.

@SgtBatten
Copy link
Owner

Updated the custom action branch.

I have the looped action working fine now implementing a version of your fix @krystiancharubin so thanks.

@krystiancharubin
Copy link

Confirmed the new beta is working. Merging of variables in the custom action appears to work as well.

@reesion
Copy link

reesion commented Aug 29, 2023

Confirmed the new beta is working for me as well. Thank you

@rroller
Copy link

rroller commented Sep 12, 2023

I just tested this, works great and is exactly what I need. Would greatly appreciate it if this was merged back into main. Thanks for this!

@SgtBatten
Copy link
Owner

Thanks for the feedback all. Will merge when I get a minute. Hopefully not long

@rroller
Copy link

rroller commented Sep 12, 2023

Does the custom action fire after the notification is sent or before?
I'm asking because I'd like to make sure the custom action is fired as quickly as possible and am wondering if there's any delay currently because of the execution order?

@SgtBatten
Copy link
Owner

Before from memory

@SgtBatten
Copy link
Owner

closed with #96

@rroller
Copy link

rroller commented Oct 5, 2023

Looks like there's no new release created?

@SgtBatten
Copy link
Owner

The releases don't do anything, it's just a snapshot in time.

@rroller
Copy link

rroller commented Nov 4, 2023

Will this be merged to the stable branch?

@SgtBatten
Copy link
Owner

Yes I've been meaning to for a long time. I need to not merge all the beta functions but most are stable now.

@rroller
Copy link

rroller commented Nov 5, 2023

I copied it into my local stable copy and it works fine.

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

No branches or pull requests

5 participants