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

 找回密码
 立即注册
查看: 2272|回复: 13

[求助] nodered 手机通知怎么调用变量

[复制链接]

24

主题

209

帖子

2458

积分

论坛技术达人

积分
2458
金钱
2244
HASS币
30
发表于 2022-9-9 16:28:06 | 显示全部楼层 |阅读模式
WX20220909-162446@2x.png WX20220909-162502@2x.png


我怎么才可以调用上一步输入的变量 msg.payload
回复

使用道具 举报

10

主题

1332

帖子

4254

积分

论坛元老

Rank: 8Rank: 8

积分
4254
金钱
2922
HASS币
0
发表于 2022-9-9 19:40:42 | 显示全部楼层
{“message”:msg.payload}试试
回复

使用道具 举报

3

主题

154

帖子

1764

积分

金牌会员

Rank: 6Rank: 6

积分
1764
金钱
1610
HASS币
10
发表于 2022-9-9 20:26:11 | 显示全部楼层
加个Function节点
回复

使用道具 举报

24

主题

209

帖子

2458

积分

论坛技术达人

积分
2458
金钱
2244
HASS币
30
 楼主| 发表于 2022-9-9 20:57:30 | 显示全部楼层
yc0209 发表于 2022-9-9 20:26
加个Function节点

加了也不行呀 主要不知道怎么加变量
回复

使用道具 举报

3

主题

154

帖子

1764

积分

金牌会员

Rank: 6Rank: 6

积分
1764
金钱
1610
HASS币
10
发表于 2022-9-9 21:21:58 | 显示全部楼层
[{"id":"f36b42b1197fad53","type":"api-call-service","z":"43b729ab12e4b506","name":"","server":"86de6f7c.81985","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_yang_chao_de_iphone","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":260,"y":340,"wires":[["cee431d2635982e7"]]},{"id":"86de6f7c.81985","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]



看下是不是这样的
回复

使用道具 举报

24

主题

209

帖子

2458

积分

论坛技术达人

积分
2458
金钱
2244
HASS币
30
 楼主| 发表于 2022-9-10 00:03:02 | 显示全部楼层
yc0209 发表于 2022-9-9 21:21
看下是不是这样的

这个组件里面没有json的参数呀
回复

使用道具 举报

6

主题

261

帖子

3614

积分

论坛元老

Rank: 8Rank: 8

积分
3614
金钱
3353
HASS币
0
发表于 2022-9-10 17:44:04 | 显示全部楼层
[{"id":"6cd593d7665e454a","type":"tab","label":"流程 1","disabled":false,"info":"","env":[]},{"id":"0aa7169163dd2b81","type":"api-call-service","z":"6cd593d7665e454a","name":"消息推送","server":"4041b4ce.e6700c","version":5,"debugenabled":true,"domain":"notify","service":"mobile_app_iphone12","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":740,"y":280,"wires":[[]]},{"id":"623d420325974b81","type":"function","z":"6cd593d7665e454a","name":"APP","func":"var message = \"目前的位置是\" ;\nvar image = \"https://github.com/home-assistant/assets/blob/master/logo/logo.png?raw=true\"\n//msg.payload = {};\n//msg.payload.data = {\"message\":message};\n//msg.payload.data.message.data = { \"image\": image };\nmsg.payload = {};\nmsg.payload.data = {\n                    \"message\": message,\n                    \"data\": { \"image\": image }\n                    }\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":280,"wires":[["0aa7169163dd2b81"]]},{"id":"bd137f1a885431d6","type":"inject","z":"6cd593d7665e454a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":350,"y":280,"wires":[["623d420325974b81"]]},{"id":"4041b4ce.e6700c","type":"server","name":"HASS","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]
回复

使用道具 举报

24

主题

209

帖子

2458

积分

论坛技术达人

积分
2458
金钱
2244
HASS币
30
 楼主| 发表于 2022-9-10 19:35:05 | 显示全部楼层
erj002 发表于 2022-9-10 17:44
[{"id":"6cd593d7665e454a","type":"tab","label":"流程 1","disabled":false,"info":"","env":[]},{"id":" ...

按住弹出信息框关闭怎么弹出来
回复

使用道具 举报

6

主题

261

帖子

3614

积分

论坛元老

Rank: 8Rank: 8

积分
3614
金钱
3353
HASS币
0
发表于 2022-9-10 19:36:38 | 显示全部楼层
758639304 发表于 2022-9-10 19:35
按住弹出信息框关闭怎么弹出来

没明白你的意思
回复

使用道具 举报

24

主题

209

帖子

2458

积分

论坛技术达人

积分
2458
金钱
2244
HASS币
30
 楼主| 发表于 2022-9-10 19:40:53 | 显示全部楼层
erj002 发表于 2022-9-10 19:36
没明白你的意思

现在安装这个消息 弹出来的是图片的信息 怎么看他弹出两个信息框 确定 取消
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 14:48 , Processed in 0.514930 second(s), 34 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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