一、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流程:
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":[]}]
如位大佬帮忙看看,问题出在哪,怎么解决。
|