Home Assistant + pushplus:智能家居事件推到微信
效果:自动化触发(门磁、漏水、设备离线)后,微信收到通知。推荐用 Apprise 集成。
前置条件
- 一个 pushplus token(官网扫码获取)
- Home Assistant,能装集成或改
configuration.yaml
方式一:Apprise 集成(推荐)
- 安装 Apprise 集成(或 HACS 中的 Apprise)。
- 通知 URL 填
pushplus://你的token。详见 Apprise。 - 在自动化的 Action 里调用
notify.apprise(服务名以实际集成为准)。
方式二:RESTful notify
configuration.yaml:
notify:
- name: pushplus
platform: rest
resource: https://www.pushplus.plus/send
method: POST
headers:
Content-Type: application/json
message_param_name: content
title_param_name: title
data:
token: !secret pushplus_token
template: markdown
把 token 放进 secrets.yaml 的 pushplus_token,不要提交到 git。
自动化示例:
action:
- service: notify.pushplus
data:
title: "门磁告警"
message: "大门已打开"
验证
开发者工具 → 服务,调用上述 notify;或:
curl -X POST "https://www.pushplus.plus/send" \
-H "Content-Type: application/json" \
-d '{"token":"你的token","title":"Home Assistant 配置测试","content":"token 可用","template":"markdown"}'
常见问题
服务找不到? 改完 yaml 要重启 Home Assistant,并确认配置检查通过。
通知太勤? 在自动化加条件与冷却(for / mode: single)。