frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Simple automation trigger for Timer events

Open karwosts opened this issue 1 year ago • 7 comments

Proposed change

I like using timer helpers for automations, but I think the experience leaves something to be desired. Even as an experienced user I still have to go review the documentation every time I want to use one, to remember how to structure the necessary manual events. I think this could be somewhat difficult for new users as well, given that the manual event trigger describes itself as an "advanced concept".

As an alternative, I propose a simpler UI "Timer trigger", which just has an entity id picker, and a select to choose a timer event to listen for. I believe this would be much more accessible than having to setup a manual event trigger.

I debated if this would need to be a "real" trigger in the backend, or if we could just wrap the existing event with a new UI, and not really need any core changes. I decided to try the latter for now, as the former sounded somewhat more difficult, and possibly unnecessary.

This change does require a one line change in core to allow the validator to accept and ignore the metadata field for triggers, similar to how we have done in other areas. I can try an additional PR for that if we think this approach is favorable.

image

image

Type of change

  • [ ] Dependency upgrade
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [x] New feature (thank you!)
  • [ ] Breaking change (fix/feature causing existing functionality to break)
  • [ ] Code quality improvements to existing code or addition of tests

Example configuration


Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • [x] The code change is tested and works locally.
  • [x] There is no commented out code in this PR.
  • [ ] Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

karwosts avatar Jan 03 '24 00:01 karwosts

This is great and exactly what I am working on making a plan for right now! More specific triggers. Because of that I don't think we should add this at this point but wait for that plan to be finished, as it likely will include core and work slightly different.

bramkragten avatar Jan 03 '24 09:01 bramkragten

I think it might make sense to make the Event multi selectable, i.e. checkboxes. I can think of several occasions where I'd want to trigger an automation for different timer events, and having to "multiply" the trigger definition wouldn't make sense.

Don't know how this relates to bramkragten's comment, though...

chammp avatar Feb 19 '24 19:02 chammp

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] avatar May 19 '24 21:05 github-actions[bot]

This is great and exactly what I am working on making a plan for right now! More specific triggers. Because of that I don't think we should add this at this point but wait for that plan to be finished, as it likely will include core and work slightly different.

I haven't seen many changes yet in that area so I assume that plan isn't finished as of now?

silamon avatar Jun 21 '24 16:06 silamon

I haven't seen many changes yet in that area so I assume that plan isn't finished as of now?

We are currently in the design process of the automation editor, it is a long process though, I'll discuss with product if we should hold this that long.

bramkragten avatar Jul 19 '24 08:07 bramkragten