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: Ability to use yaml code for hardware button actions #989

Open
sparkydave1981 opened this issue Aug 22, 2023 · 7 comments
Labels
Enhancement For suggestions that add new features or improve existing functionalities.

Comments

@sparkydave1981
Copy link

I realise that we can enter code for the long press of the hardware buttons but I'd like to be able to do that for a short press as well.

None of my NS Panels have anything hard-wired to the relays so I only use the hardware buttons for making things happen via HA. It would be really nice if we could code the action for a short press such that we could even use the choose: function as per normal scripts / automations. This way we could fire different actions based on a set of conditions whenever the button is pressed..

@edwardtfn
Copy link
Collaborator

You can create a script in Home Assistant and assign that script to a button, so that will be your custom short press... 😉
Or you can assign nothing and then create your own automatiin using the button as a trigger, although in this case you won't see the visual feedback in the screen.

@edwardtfn edwardtfn added the Enhancement For suggestions that add new features or improve existing functionalities. label Aug 22, 2023
@sparkydave1981
Copy link
Author

sparkydave1981 commented Aug 22, 2023

create a script in Home Assistant and assign that script to a button, so that will be your custom short press...

Ah ok thanks. I just assumed (wrongly) that since it was "switching" something, that it had to be a straight on/off entity.
image

I'll give it a try.

@sparkydave1981
Copy link
Author

I tested this work-around and it does do the job however 'natively' being able to enter the code within the Blueprint would definitely be nicer.

Also, since the button now calls a script, there is no feedback to the NS Panel to be able to turn on the coloured bar above the button to show current status. If we could use the state of a separate entity to control that bar I could get around this.

@MichaelHeimann
Copy link
Contributor

MichaelHeimann commented Jan 18, 2024

I tested this work-around and it does do the job however 'natively' being able to enter the code within the Blueprint would definitely be nicer.

Also, since the button now calls a script, there is no feedback to the NS Panel to be able to turn on the coloured bar above the button to show current status. If we could use the state of a separate entity to control that bar I could get around this.

Here's how I did it:
Call the Service <name of NSPanel>_send_command_printf and set cmd to home.left_bt_pic.val=1 to enable the blue bar. 0 to turn it off.

@sparkydave1981
Copy link
Author

Call the Service <name of NSPanel>_send_command_printf and set cmd to home.left_bt_pic.val=1 to enable the blue bar. 0 to turn it off.

Just seeing this now, but the issue will remain when the light is turned on/off via another method such as an automation. The NS Panel won't get updated unless that command was added to all automations.

@MichaelHeimann
Copy link
Contributor

Call the Service <name of NSPanel>_send_command_printf and set cmd to home.left_bt_pic.val=1 to enable the blue bar. 0 to turn it off.

Just seeing this now, but the issue will remain when the light is turned on/off via another method such as an automation. The NS Panel won't get updated unless that command was added to all automations.

... Or you add a single automation to call that service when the light turns on...

@sparkydave1981
Copy link
Author

Or you add a single automation to call that service when the light turns on...

...sure, but this is still a work-around for something that should be simple to implement. It's literally just enabling the same config options for single click as what have been created for long press. Such an easy solution instead of changing automations with work-arounds for the sake of one piece of hardware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For suggestions that add new features or improve existing functionalities.
Projects
None yet
Development

No branches or pull requests

3 participants