3
Declined

Power Connected as Event

I request for another feature that, like the new Bluetooth Connected Event, please add a Power Connected and Disconnected Event to Tasker. I know a connected State already exists but I request for an Event too. Thanks again. 

2 replies

@Nathan, my question is something similar to that. Like if I want to play a sound when the power connects and play another when disconnects, would it be better an Event than a State? Since the task (the sound) needs to be played only once when it just connects and doesn't needs to be running till disconnection, the Event would be better than the State, I think. 

NS

Based on João's response below (which I didn't see until today--sorry!), this should work just as you want it to, so long as you set the entry/exit tasks accordingly! Yay!

My understanding of Tasker's behavior with regard to states was incorrect, as corrected by the man himself (thank you, by the way!). That said, should you notice any behavior that seems counterintuitive to what you believe should be happening when you try to do what you've stated, I wouldn't hesitate to update this.

Hope it works out for you!

What would you be able to do with the event that you can't already do with the state?

NS

I can't speak to the intent or needs of the OP, but based on my own observations and (limited) readings of comments on reddit about this, I could see the following concern:

With a state detection, the task is constantly running. While I'm unclear on tasker's low-level implementations, I could see that being unideal for battery (but please correct me if I'm wrong). Of course I could possibly see some more advanced things that rely on timing or incrementation or something that might be hard with the states alone, but I feel they'd probably still be possible with some smart variable and logic wrangling.

I personally get around the (presumed possible) battery issue by simply having one profile for charging, then have an exit task to do the thing I want on the event of unplugging. I don't mind the constant profile running when it's charging, after all.

With a state the task is not always running :) It simply runs the entry task when the condition turns true and runs the exit task when it is false.