Home Assistant 自定义集成:将 NEXT Push 接入为 notify 实体,使用 notify.send_message 服务发送消息。
- 基于 Home Assistant 新版 notify entity 模型
- 支持
notify.send_message - 支持配置默认
channel与render_mode - 支持在服务调用
data中覆盖:channel、token、url、render_mode、content - 配置流内置连接测试
custom_components/hass_push_nextrt/manifest.jsonconfig_flow.pynotify.pyapi.py
- 打开 HACS
- 进入 右上角菜单 -> 自定义仓库
- 添加本仓库 URL,分类选择 Integration
- 搜索并安装
hass_push_nextrt - 重启 Home Assistant
- 将
custom_components/hass_push_nextrt目录复制到 Home Assistant 配置目录下的custom_components - 重启 Home Assistant
- 进入 设置 -> 设备与服务 -> 添加集成
- 搜索
消息推送 - 填写:
name实体名称usernameNextRT Push 用户名tokenNextRT Push Tokenchannel默认通道 可选render_mode默认渲染模式 可选,推荐markdown
本集成仅支持新版实体通知服务,不再兼容旧式 notify.<service> 调用。
action:
- service: notify.send_message
target:
entity_id: notify.消息推送
data:
message: 设备在线action:
- service: notify.send_message
target:
entity_id: notify.消息推送
data:
title: Home Assistant 告警
message: 门磁已触发action:
- service: notify.send_message
target:
entity_id: notify.消息推送
data:
title: 每日摘要
message: 今日能耗 5.2kWh
data:
channel: email
render_mode: rawaction:
- service: notify.send_message
target:
entity_id: notify.消息推送
data:
message: 占位描述
data:
content: |
## 系统状态
- CPU 45%
- 内存 61%
channel: corp
render_mode: markdownnotify.send_message 顶层字段:
message必填title可选
data 扩展字段:
channel可选token可选,不建议常用url可选render_mode可选,markdown或raw或codecontent可选,建议与description语义二选一
- 配置保存失败:检查
username与token - 发送失败:检查通道名是否为你平台内已配置的通道名称
- 自动化调用失败:确认服务使用
notify.send_message且包含target.entity_id