Need help with a trigger (Hold power button)

Post your questions and help other users.

Moderator: Martin

Post Reply
Jkutkut
Posts: 16
Joined: 20 Jul 2016 14:10

Need help with a trigger (Hold power button)

Post by Jkutkut » 28 Feb 2017 15:55

Good evening:

I'm working in a new flow and I need your help. What I basically need is a way to execute a flow when I hold press the power button. I saw the trigger "command" but I think that only works if you press the button (And I need to hold-press).
I have the 6.0.1 android version.

If somebody knows how to help me, I'll be very thankful.

Thanks

Jkutkut

bogdyro
Posts: 241
Joined: 04 Apr 2015 15:14

Re: Need help with a trigger (Hold power button)

Post by bogdyro » 28 Feb 2017 16:37

This should work
Trigger command output
In 'command' field you should enter this:

while true;do getevent -l -c 1 /dev/input/event0;done
Matches glob *KEY_POWER*UP*
Event0 might be device dependent. You can watch the log to find out what's the right event by leaving an empty condition

Jkutkut
Posts: 16
Joined: 20 Jul 2016 14:10

Re: Need help with a trigger (Hold power button)

Post by Jkutkut » 01 Mar 2017 15:31

Thanks!! It works perfectly!
I changed the event number as you said and that's it.

Thanks again!

Jkutkut

Post Reply