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

 找回密码
 立即注册
查看: 7307|回复: 5

[教程系列] 如何给子流程中的节点传递一个参数?www-request节点的url

[复制链接]

35

主题

153

帖子

1078

积分

金牌会员

Rank: 6Rank: 6

积分
1078
金钱
925
HASS币
10
发表于 2020-5-12 18:30:03 | 显示全部楼层 |阅读模式
家中多个摄像机用于人体识别。把这个步骤做成了一个子流程。
但是多个摄像机如何选择呢?
配置基本一样。就是IP不同
YY截图20200512182707.png
回复

使用道具 举报

15

主题

158

帖子

1368

积分

论坛技术达人

积分
1368
金钱
1200
HASS币
40
发表于 2020-5-12 19:31:45 | 显示全部楼层
var ip = `10.0.0.222`;
msg.url = `http://${ip}:11110/picture/1/current/`;
return msg;


改ip变量就行了吧
回复

使用道具 举报

27

主题

2143

帖子

8926

积分

论坛元老

Rank: 8Rank: 8

积分
8926
金钱
6778
HASS币
30

论坛元老

发表于 2020-5-13 08:37:16 | 显示全部楼层
最简单的摄像头节点,并联多个不就好了
回复

使用道具 举报

35

主题

153

帖子

1078

积分

金牌会员

Rank: 6Rank: 6

积分
1078
金钱
925
HASS币
10
 楼主| 发表于 2020-5-14 16:03:53 | 显示全部楼层
minions123 发表于 2020-5-12 19:31
改ip变量就行了吧

使用这个方法后。提示
"Warning: msg properties can no longer override set node properties. See bit.ly/nr-override-msg-props"

。。
回复

使用道具 举报

15

主题

158

帖子

1368

积分

论坛技术达人

积分
1368
金钱
1200
HASS币
40
发表于 2020-5-14 22:43:23 | 显示全部楼层
boyyao 发表于 2020-5-14 16:03
使用这个方法后。提示
"Warning: msg properties can no longer override set node properties. See bit. ...
[{"id":"67feb8bf.586aa8","type":"http request","z":"ee7843f9.faf64","name":"","method":"GET","ret":"bin","paytoqs":false,"url":"","tls":"","proxy":"","authType":"","x":660.5000076293945,"y":201.00000381469727,"wires":[["fb85ae96.07e4a"]]},{"id":"fb85ae96.07e4a","type":"image","z":"ee7843f9.faf64","name":"","width":"250","data":"payload","dataType":"msg","thumbnail":false,"active":true,"x":836.5000076293945,"y":203.00000381469727,"wires":[]},{"id":"ffc97c93.b24a6","type":"inject","z":"ee7843f9.faf64","name":"","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":116.5,"y":182.00000476837158,"wires":[["223ee519.8b765a"]]},{"id":"caf92a66.5c69a8","type":"function","z":"ee7843f9.faf64","name":"","func":"\nmsg.url = `http://10.0.0.222:11110/picture/${msg.num}/current/`;\nreturn msg;","outputs":1,"noerr":0,"x":521.6000022888184,"y":200.00000381469727,"wires":[["67feb8bf.586aa8"]]},{"id":"223ee519.8b765a","type":"change","z":"ee7843f9.faf64","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"num","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":313.6000061035156,"y":205.0000057220459,"wires":[["caf92a66.5c69a8"]]},{"id":"fbd5fef0.a2ddb","type":"inject","z":"ee7843f9.faf64","name":"","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":118,"y":240.0000057220459,"wires":[["223ee519.8b765a"]]}]


我不知道你输入节点数据类型,我这个流程是输入摄像头序号来拍照的,你看看有没有帮助呢
回复

使用道具 举报

35

主题

153

帖子

1078

积分

金牌会员

Rank: 6Rank: 6

积分
1078
金钱
925
HASS币
10
 楼主| 发表于 2020-5-19 00:55:46 | 显示全部楼层
minions123 发表于 2020-5-14 22:43
我不知道你输入节点数据类型,我这个流程是输入摄像头序号来拍照的,你看看有没有帮助呢 ...

非常感谢。已经搞定了。可能是之前的http request是其他流程导入的关系。不起作用。重新拉了个http request就ok了。。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-21 21:52 , Processed in 0.716680 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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