ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

Home assistant推送通知到企业微信群

Home assistant推送通知到企业微信群 第一步编辑homeassistant的configuration.yaml直接在末尾添加rest_command:wechat_bot_send:url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?keyxxxxxxxx# 上面的XXXX请打开企业微信群右上角三个点找到“消息推送”获取连接# 注意只有企业微信内部群才有“消息推送”功能method: POSTheaders:Content-Type: application/jsonpayload: {msgtype: text,text: {content: {{ message }}}}第二步编辑homeassistant的scripts.yamlwechat_bot_send:alias: 企业微信推送description: 发送消息到企业微信群机器人fields:title:name: 标题description: 消息标题required: trueexample: 设备状态提醒selector:text:message:name: 内容description: 消息正文required: trueexample: 客厅灯已打开selector:text:multiline: truesequence:- service: rest_command.wechat_bot_senddata:message: -【{{ title }}】{{ message }}第三步重启HA。这样就能在HA里的自动化处理里直接使用了如下图
返回列表