Tasker + pushplus:安卓自动化事件推到微信
效果:Tasker 的 Profile 被触发后(电量、短信、到家、Wi-Fi 变化等),用 HTTP Request 把标题和正文 POST 到 pushplus。
token 放在 Tasker 变量里,不要写死在多个任务中。
前置条件
- 一个 pushplus token(官网扫码获取)
- 已安装 Tasker(建议 6+,自带 HTTP Request)
配置步骤
- Tasker → Vars,新增全局变量
%PUSHPLUS_TOKEN,值为你的 token。 - 新建任务,例如命名为
Notify_pushplus。 - 添加动作 Net → HTTP Request:
- Method:
POST - URL:
https://www.pushplus.plus/send - Headers:
Content-Type=application/json - Body:
- Method:
{
"token": "%PUSHPLUS_TOKEN",
"title": "%title",
"content": "%content",
"template": "txt"
}
- 在需要推送的任务里,先
Variable Set:%title、%content(可用%BATT、%SMSRB、%LOCN等上下文变量),再Perform Task调用Notify_pushplus。 - 用一个空 Profile 或长按任务点播放,先发一条测试。
旧版 Tasker 没有 HTTP Request 时,可用 HTTP Post,MIME Type 填 application/json,正文同上。
验证
curl -X POST "https://www.pushplus.plus/send" \
-H "Content-Type: application/json" \
-d '{"token":"你的token","title":"Tasker 配置测试","content":"token 可用","template":"markdown"}'
返回 JSON 的 code 为 200,且手机收到消息,说明 token 没问题。再在 Tasker 里跑一次任务。
常见问题
任务成功但没消息? 看 HTTP Request 的返回码和响应体。content 不能为空;变量未赋值时会变成空字符串。
token 写在任务里不方便改? 只用 %PUSHPLUS_TOKEN 这一处。备份 Tasker 数据时注意不要把备份发到公开网盘。
通知太勤? 在 Profile 上加冷却(Cooldown)或电量/时间条件,避免循环触发刷额度。见 接口限制。