1
Completed

Power disconnect as an event

Follow-up to this: https://tasker.helprace.com/i559-power-connected-as-event

I want to realize a warning if I get off from my car and forgot to take my mobile.
For this i want to use the BT connection, but this isn't enough because BT activates with unlocking the car und stays on for a while after locking.
So i thougt i can use the power connection. The phone charges wireless or wired, but every time the power for this will be switched off when I switch-Off the car (there is a start/stop-button).

When I use the power state (inverted) the task starts when i unlock the car (BT connected + no power) - this is unwanted. I just need the trigger if the power turns off.

3 replies

MW

Thanks, that helps. Maybe it would be easier to have power discannection directly as a state ;)

In a german forum we did it in a similar way:
https://www.android-hilfe.de/forum/automatisierung-tasker.493/warnton-von-tasker-telefon-im-auto-nicht-vergessen.1079639-page-2.html#post-13786731

Try DeepL for translation.

You can have a disconnected state by using the Invert option in the state :)

MW

I'll try ;)

- Mobile is (wireless) connected to Car Audio system via BT & AA Wireless (and away from my eyes) and is charged during this time (Charging wireless or via cable if car is "On")
- If i arrive and switch off the car, I want to realize a warning "Don't forget your phone"
- BT stays on for a while after leaving the car

I want to realize a profile that triggers a warning task (notify + beep, works).
At the moment I use the states "BT connected" + "Charging Off" but this results in a message before I have a chance to get the mobile charged (Car BT starts with unlock) and I need to accept this message before I get a new one. With an event that indicates "Charging off" i would be able to avoid this.

Oh, I see what you mean :)

You can have a separate profile that is using the charging state just "When Charging > Set %Charging to 1; When Not Charging > Clear Variable %Charging".

Then in your existing profile use the Variable Cleared Event with the %Charging variable.

Something like this:

Project: State To Event

Profiles
Profile: Set Charging Variable
State: Power [ Source:Any ]

Enter Task: Anon

A1: Variable Set [
Name: %Charging
To: 1
Structure Output (JSON, etc): On ]

Exit Task: Anon

A1: Variable Clear [
Name: %Charging ]

Profile: When Taken Off Charge And Connected to Bluetooth Remind Not To Forget Phone
Event: Variable Cleared [ Variable:%Charging User Variables Only:Off ]
State: BT Connected [ Name:* Address:* ]

Enter Task: Anon

A1: Say [
Text: Don't forget your phone!
Engine:Voice: default:default
Stream: 3
Pitch: 5
Speed: 5
Respect Audio Focus: On ]

Hope this helps!

Sorry, I don't understand in what situation that would would better with an event. Can you please clarify? Thanks in advance!