I got a new Z-Wave remote (Versternet 12 Button Remote) and I have programmed all my KeyPress events to various lights etc but I want to look at using KeyHold to brighten/dim the lights but this is where I am getting confused.
I can trigger based on the KeyHold events and then I am using a Loop until building block but I can’t seem to get it to pickup the KeyRelease event so it just continually brightens/dims.
Firstly, am I going about this the right way and if so what am I doing wrong?
You can’t really just “tweak” device actions/triggers/conditions manually. Generally the YAML they generate is for the UI, not for you to edit. What you’ve created is an invalid condition. The reason there’s no built-in condition for a scene event is because it’s impossible to do that, they are events, not state.
If you want to continue using device triggers, you would need a second trigger for the key release event, and then use that trigger to stop the automation.
Another approach is to use the event entities, assuming your device has those (it should have one for each scene). You can trigger off of those, and check their attributes values in a conditional. https://www.home-assistant.io/integrations/event/#event-types
A third approach is to use the zwave-js events directly as trigger, which is similar to the device triggers.
I’ve put together this approach using the UI - sharing in it’s raw, relatively untested, state for info and critique
.
It’s for the 2-button version of the same switch but should be relevant to the bigger switches.
I (currently) have two automations per button - one for the short press (ON or OFF) and one (this code) for the brightness (Increase or Decrease) adjusting the options in the pull downs appropriately.
Also, substitute 002, 003, 004 etc for the other buttons where this code has 001.