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

While-pressed and/or On-release trigger for the custom buttons. #234

Closed
maxi1134 opened this issue Dec 2, 2021 · 6 comments · Fixed by #286
Closed

While-pressed and/or On-release trigger for the custom buttons. #234

maxi1134 opened this issue Dec 2, 2021 · 6 comments · Fixed by #286

Comments

@maxi1134
Copy link

maxi1134 commented Dec 2, 2021

Is your feature request related to a problem? Please describe.
I am looking for a way to control my PTZ camera from within the stream.

Describe the solution you'd like
To do so, I need a way of sending a start movement signal ( On-press trigger on the button ) and a stop motion signal ( On-release trigger), This way you get to have it move until you stop pressing ( When then sends the signal to stop motion)

Describe alternatives you've considered
I currently use pre-defined points with a single rest call:
image
(Top right corner )

@dermotduffy
Copy link
Owner

dermotduffy commented Dec 4, 2021

The standard approach to handling mouse/touch interaction in Home Assistant does not support actions on down/release (i.e. you couldn't do this in a stock picture elements card). I can play around and see if I can trick it into complying though ;-)

What would you like it to call? i.e. is there a HA service or equivalent you'd configure it to call?

@dermotduffy
Copy link
Owner

I'll add that I'm not sure this is a good idea? There could be quite a bit of latency if you're away from home, and I could imagine the UX being poor: "Forward a bit, no, too much, back a bit, no! Too much, back the other way! Arg!".

Maybe a "Move 3% left" button would be better that could be just repeatedly tapped? At least that's controllable/predictable.

@maxi1134
Copy link
Author

maxi1134 commented Dec 4, 2021

is there a HA service or equivalent you'd configure it to call?
I'd set it to call a my script.ptz_left on press and script.ptz_stop on release

: "Forward a bit, no, too much, back a bit, no! Too much, back the other way! Arg!".
I got used to that delay pretty quick on the Reolink app!
Eventually you can guesstimate how long you need to press to get somewhere!

@dermotduffy
Copy link
Owner

@maxi1134 Investigated this a bit more. I have working code that adds start_tap and end_tap actions. The issue is that I can only attach this code to controls that I render.

So it will work in these cases:

  • Frigate card Menu icons
  • Menu submenus (this is new dropdown menu functionality not yet released)
  • Card-level actions (e.g. clicking on the main views of the frigate card itself)

But it cannot work in these cases:

  • Any stock picture element (e.g. icons rendered on a card, state labels, or anything else here).

=> With that limitation, is it still useful?

@maxi1134
Copy link
Author

Hey @dermotduffy,
Thanks for putting in effort for this idea!

Just to be sure that I understood, when you say "Frigate card Menu icons".
You mean the icons on top right?

If so, I think it would still be usefull!

I would not be able to place them in a cross pattern, but having them side by side work as well!

@dermotduffy
Copy link
Owner

dermotduffy commented Jan 27, 2022

Just to be sure that I understood, when you say "Frigate card Menu icons".
You mean the icons on top right?

Well, you can put the menu anywhere you want, but yeah the menu bar along the side! Just not the elements rendered 'onto' the card.

I would not be able to place them in a cross pattern, but having them side by side work as well!

Yup. OK! In general I'm not a huge fan of these kind of random (to a user) limitations, but lets see how this goes. I'll make it clear in the documentation that this is only partial support.

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

Successfully merging a pull request may close this issue.

2 participants