Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Last button event does not refresh if same button is pressed again #12

Open
mikesalz opened this issue Apr 17, 2020 · 6 comments
Open

Comments

@mikesalz
Copy link

mikesalz commented Apr 17, 2020

On the Philips Hue Dimmer Switch, the last button event seems to "stick" until a different button is pressed. This prevents the user from pressing the button a second time, even if hours later. Can we add an option clear the last event immediately after (or shortly after) a button press?

Example:
I use the 3_click_up event (fan off button) to turn off a fan. Let's say I used the button to turn off the fan three hours ago. Then I later turn the fan back on by some means other than the remote. I now cannot use the 3_click_up event to turn off the fan because the last registered button event is still the 3_click_up from three hours ago. If I press the button, no new "to" 3_click_up event is registered now.

This is demonstrated in the screenshot below. The 3_click_up event triggered 3 hours ago, so I cannot trigger it again unless I click another button first.

image

@iamcagn
Copy link

iamcagn commented Apr 18, 2020

Hey @mikesalz,

To work around this, set the trigger as state without any to/from. Then, set a condition for the button, e.g.

condition: state
entity_id: remote.bedroom_switch
state: 1_click_up

While the button doesn't update, the time pressed does. This means the trigger will always fire, and if the correct condition is met (e.g. button = 1_click_up) then it will run the actions. Pressing the button multiple times will work now.

Additional conditions/checks may need to be made, see: #14

@mikesalz
Copy link
Author

Hi @iamcagn - Thanks for responding! I tested that change this morning and it does seem to work.

@iamcagn
Copy link

iamcagn commented Apr 19, 2020

@mikesalz I was having the same issue when I started using the original custom component, and found that tip on the HA community forums. I saw your ticket when I went to create mine, and thought I should pass the knowledge on. I'm glad it worked for you.

@robmarkcole
Copy link
Owner

The official integration fires events on each button press, which is the correct way to implement a remote in HA.

@mikesalz
Copy link
Author

@robmarkcole While I agree that is what SHOULD happen, it does not appear to be working correctly as per my description above.

@robmarkcole
Copy link
Owner

This is basically the same issue as #14

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants