Tasker

How to arm Pubby from Tasker, MacroDroid or Automate

Pubby answers one intent. Send it and the guard arms exactly as if you had tapped the button in the app, the Quick Settings tile or the widget – from a Tasker profile, a MacroDroid macro, an Automate flow, or adb on your desk.

There is no way back, though – it simply cannot be stopped like this. That is deliberate, and the last section explains exactly why.

The intent specification (what exactly to send)

  • Action. com.aquasoup.pubby.action.ARM
  • Target. An activity. Not a service and not a broadcast – Android has not let an app start a foreground service from the background since version 12, so a broadcast would be cut off by the system and your rule would do nothing at all.
  • Package and class. Fill these in only if your automation app insists on an explicit target: com.aquasoup.pubbylite and com.aquasoup.pubby.automation.ArmActivity. Most do not need them.
  • Extras. None. Anything you send on top of this, Pubby simply throws away.
  • What you see. Nothing at all. The activity has no window: it starts the guard and is gone before the screen has a chance to change.
  • Sending it twice. Harmless. A guard that is already running stays running, and nothing restarts.

Tasker, step by step

  1. Make a task and add an action: System → Send Intent.
  2. Action: com.aquasoup.pubby.action.ARM
  3. Target: Activity.
  4. Leave Cat, Mime Type, Data, Extra, Package and Class empty.
  5. Attach the task to whichever profile you want. Four that earn their keep are below.

And then do not forget the one thing that is not set in Tasker at all: go into Android's settings and give Tasker the “Display over other apps” permission. Without it, newer versions of Android may not let it start an activity while the screen is off or another app is in front, and the rule would fire into nothing. This is by far the most common reason an automation looks dead.

The same thing elsewhere

  • MacroDroid. An action of type Send Intent, with the same action string and the target set to an activity.
  • Automate. The block that starts an activity (App start): copy the string above into its Action field and leave the rest empty.
  • Home Assistant. The companion app can start an activity on the phone from a notification command; the action string is the only thing it needs from us. Its own documentation has the syntax.
  • The command line. For testing before you build any logic around it: adb shell am start -a com.aquasoup.pubby.action.ARM

Four rules worth building

  • The café's Wi-Fi. Connected to that network, arm. It is the rule most people build first, because it fires in the exact place the app is for and needs nothing from you at the table.
  • Favourite places (geofence). Any location trigger your automation app can do. This is worth saying plainly: Pubby itself never asks for location permission and does not want to know where you are. Your automation holds the geofence, and all Pubby ever hears is “arm”.
  • Plugged in, away from home. Power connected, and not on your home Wi-Fi. Close to what you would do by hand, without the part where you forget.
  • Lights out at the hostel. Eleven o'clock, when the phone is already in a socket across the room.

So why can it not switch the guard off as well?

The whole protection stands on one sentence: the siren can only be silenced inside the app, and the app is behind your lock screen. That is why the guarding notification has no button, why the Quick Settings tile makes you unlock the phone before it disarms but not before it arms, and why the widget has no off state at all.

An exported action that stopped the guard would undo all three at once. Any app on the phone could send it, and so could anybody holding your phone while it is unlocked. So this road runs one way: automations can arm Pubby, and only you can quiet him.

When it does not work

  • Nothing happens at all. The sending app is not allowed to start anything from the background. Grant it “display over other apps”. On Xiaomi, Oppo and their relatives, look in the battery settings for an extra “background start” or “auto start” permission as well.
  • Pubby opens on the VIP screen. Arming from an automation is a VIP feature, and rather than fail silently the rule brings you here to say so. A silent no-op would be the worst thing an automation could do.
  • It armed, but nothing screamed. Then all is well – nothing was stolen. The guard watches one single event, the charging cable coming out, so the phone does have to be charging for there to be a cable to pull.