『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 699|回复: 0

[流程系列] 求助:ha服务无法发送到node red

[复制链接]

34

主题

189

帖子

896

积分

高级会员

Rank: 4

积分
896
金钱
707
HASS币
0
发表于 2024-5-25 12:37:32 | 显示全部楼层 |阅读模式
一、ha中:
configuration.yaml配置文件:
rest_command:
  send_message_to_nodered:
    url: "http://192.168.8.148:1880/endpoint"
    method: "post"
    payload: '{"message": "{{ message }}"}'
开发都工具→服务→调用服务,测试:
service: rest_command.send_message_to_nodered
data:
  message: "这是一条测试消息"
测试,响应:
content: |
  <!DOCTYPE html>
  <html lang="en">
  <head>
  <meta charset="utf-8">
  <title>Error</title>
  </head>
  <body>
  <pre>Cannot GET /endpoint/</pre>
  </body>
  </html>
status: 404
日志详细信息( WARNING )
日志: homeassistant.components.rest_command
来源: components/rest_command/__init__.py:158
集成: RESTful Command (文档, 问题)
首次发生: 12:36:35 (1 全部发生)
上次记录: 12:36:35

Error. Url: http://192.168.8.148:1880/endpoint/. Status code 404. Payload: b'{"message": "\xe8\xbf\x99\xe6\x98\xaf\xe4\xb8\x80\xe6\x9d\xa1\xe6\xb5\x8b\xe8\xaf\x95\xe6\xb6\x88\xe6\x81\xaf"}'


二、node red流程:
Snipaste_2024-05-25_12-31-57.png
flow如下:
[{"id":"25d5623ef98687a6","type":"tab","label":"流程 1","disabled":false,"info":"","env":[]},{"id":"c1c7436248f13d55","type":"http in","z":"25d5623ef98687a6","name":"","url":"/endpoint","method":"post","upload":false,"swaggerDoc":"","x":230,"y":180,"wires":[["d1c91cb40045f788"]]},{"id":"d1c91cb40045f788","type":"debug","z":"25d5623ef98687a6","name":"debug 245","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":450,"y":180,"wires":[]}]



如位大佬帮忙看看,问题出在哪,怎么解决。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-12-22 12:12 , Processed in 0.047021 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表