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

 找回密码
 立即注册
查看: 5676|回复: 6

[流程系列] 高手帮忙看看,搞晕了

[复制链接]

46

主题

641

帖子

4413

积分

元老级技术达人

积分
4413
金钱
3742
HASS币
120
发表于 2020-9-3 20:35:22 | 显示全部楼层 |阅读模式
本帖最后由 evantalk 于 2020-9-3 23:16 编辑

捕获.PNG
[{"id":"4a6266e9.7dd058","type":"tab","label":"公共照明开灯","disabled":false,"info":""},{"id":"4b7d25f9.027d9c","type":"server-events","z":"4a6266e9.7dd058","name":"获取无线开关事件","server":"b5a42f15.0fc0c","event_type":"xiaomi_aqara.click","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":170,"y":120,"wires":[["80debcb.400b64"]]},{"id":"80debcb.400b64","type":"switch","z":"4a6266e9.7dd058","name":"筛选出特定的开关","property":"payload.entity_id","propertyType":"msg","rules":[{"t":"eq","v":"binary_sensor.switch_158d0002908722","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":220,"wires":[["2decac5a.ad9624"]]},{"id":"2decac5a.ad9624","type":"switch","z":"4a6266e9.7dd058","name":"判断是否单击","property":"payload.event.click_type","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":440,"y":320,"wires":[["af2fa9ce.e60938"]]},{"id":"af2fa9ce.e60938","type":"api-current-state","z":"4a6266e9.7dd058","name":"","server":"b5a42f15.0fc0c","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"group.gg_zhaoming","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":480,"y":440,"wires":[[],[]]},{"id":"7943c772.dd30e8","type":"inject","z":"4a6266e9.7dd058","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":520,"wires":[["cc70ef50.19e45"]]},{"id":"cc70ef50.19e45","type":"api-current-state","z":"4a6266e9.7dd058","name":"","server":"b5a42f15.0fc0c","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"group.gg_zhaoming","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":480,"y":520,"wires":[[],[]]},{"id":"b5a42f15.0fc0c","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]


为什么同样的节点,上面那个flow,得到的状态是off,下面那个flow得到的状态是on

flow中间要判断一下节点的状态,然后再往下走,这样的写法对吗?


回复

使用道具 举报

20

主题

421

帖子

2514

积分

金牌会员

Rank: 6Rank: 6

积分
2514
金钱
2088
HASS币
20
发表于 2020-9-4 11:32:10 | 显示全部楼层
没必要这么写吧  直接 用另一个节点  输出 单  双  长安 不好 ?
回复

使用道具 举报

46

主题

641

帖子

4413

积分

元老级技术达人

积分
4413
金钱
3742
HASS币
120
 楼主| 发表于 2020-9-4 15:18:25 | 显示全部楼层
yhwl8888 发表于 2020-9-4 11:32
没必要这么写吧  直接 用另一个节点  输出 单  双  长安 不好 ?

能具体一点吗?还是用switch节点吗?新手不太会
回复

使用道具 举报

23

主题

660

帖子

3110

积分

论坛元老

Rank: 8Rank: 8

积分
3110
金钱
2450
HASS币
10
发表于 2020-9-4 18:04:54 | 显示全部楼层
用获取状态那个节点,状态那里留空,那么只有一个输出,输出接switch 然后 建立两个输出,一个on一个off
回复

使用道具 举报

23

主题

660

帖子

3110

积分

论坛元老

Rank: 8Rank: 8

积分
3110
金钱
2450
HASS币
10
发表于 2020-9-4 18:06:18 | 显示全部楼层
话说,你都混到论坛技术达人,积分那么多应该是老手才对啊
回复

使用道具 举报

46

主题

641

帖子

4413

积分

元老级技术达人

积分
4413
金钱
3742
HASS币
120
 楼主| 发表于 2020-9-4 18:14:09 | 显示全部楼层
wshc1216 发表于 2020-9-4 18:06
话说,你都混到论坛技术达人,积分那么多应该是老手才对啊

node-red是新手
回复

使用道具 举报

0

主题

144

帖子

1156

积分

金牌会员

Rank: 6Rank: 6

积分
1156
金钱
1012
HASS币
0
发表于 2020-9-22 21:14:42 | 显示全部楼层

哈哈哈 老手好
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-12-22 16:14 , Processed in 0.128379 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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