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

 找回密码
 立即注册
查看: 7210|回复: 9

[流程系列] 大佬看看为什么不执行

[复制链接]

16

主题

223

帖子

1868

积分

金牌会员

Rank: 6Rank: 6

积分
1868
金钱
1645
HASS币
0
发表于 2021-2-1 20:39:57 | 显示全部楼层 |阅读模式
微信图片_20210201203626.png



插座是用miio接入的,带了Load power显示调用,但是写流不执行大佬们帮忙看看。



YY截图20210201203741.png


YY截图20210201203843.png


YY截图20210201203851.png

回复

使用道具 举报

43

主题

412

帖子

3806

积分

元老级技术达人

积分
3806
金钱
3389
HASS币
136
发表于 2021-2-1 23:26:47 | 显示全部楼层
把state 属性里的勾取消。 如不去,只有当开关状态改变才数据,去掉勾,则有任意属性变化都触发

评分

参与人数 1金钱 +20 收起 理由
neroxps + 20

查看全部评分

回复

使用道具 举报

16

主题

223

帖子

1868

积分

金牌会员

Rank: 6Rank: 6

积分
1868
金钱
1645
HASS币
0
 楼主| 发表于 2021-2-2 09:35:01 | 显示全部楼层
hunterfox 发表于 2021-2-1 23:26
把state 属性里的勾取消。 如不去,只有当开关状态改变才数据,去掉勾,则有任意属性变化都触发 ...

谢谢大佬受教了,能不能教一下类似于普通自动化
1(流) 2(流)
执行1关闭1打开2
执行2关闭2打开1
这种流怎么写。
回复

使用道具 举报

43

主题

412

帖子

3806

积分

元老级技术达人

积分
3806
金钱
3389
HASS币
136
发表于 2021-2-2 16:02:16 | 显示全部楼层
mengyu 发表于 2021-2-2 09:35
谢谢大佬受教了,能不能教一下类似于普通自动化
1(流) 2(流)
执行1关闭1打开2

不太明白你的意思。但如果只是简单判断开闭。就用switch节点接可以了。可以做很多分支。搞熟了可以直接用function写。
或者你把你的流贴出来,我可以帮你改
回复

使用道具 举报

16

主题

223

帖子

1868

积分

金牌会员

Rank: 6Rank: 6

积分
1868
金钱
1645
HASS币
0
 楼主| 发表于 2021-2-2 16:27:22 | 显示全部楼层
hunterfox 发表于 2021-2-2 16:02
不太明白你的意思。但如果只是简单判断开闭。就用switch节点接可以了。可以做很多分支。搞熟了可以直接用 ...

大佬在问一个问题,如果说两个人体传感器,我要想两个人体传感器同时无触发才执行用什么写?
回复

使用道具 举报

43

主题

412

帖子

3806

积分

元老级技术达人

积分
3806
金钱
3389
HASS币
136
发表于 2021-2-2 17:12:43 | 显示全部楼层
mengyu 发表于 2021-2-2 16:27
大佬在问一个问题,如果说两个人体传感器,我要想两个人体传感器同时无触发才执行用什么写? ...

[{"id":"8f3c9832.bab7a8","type":"api-current-state","z":"444ac2e5.82b0bc","name":"第一节点","server":"2b887588.e131fa","version":1,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.espapi02_key2gpio2","state_type":"habool","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":380,"y":1880,"wires":[[],["55527d1f.607854"]]},{"id":"55527d1f.607854","type":"api-current-state","z":"444ac2e5.82b0bc","name":"第二节点","server":"2b887588.e131fa","version":1,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.espapi04_key5d0gpio16","state_type":"habool","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":540,"y":1880,"wires":[[],["42d8c2c8.6772ac"]]},{"id":"701471ca.981c4","type":"inject","z":"444ac2e5.82b0bc","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":209.10415649414062,"y":1896.6666259765625,"wires":[["8f3c9832.bab7a8"]]},{"id":"42d8c2c8.6772ac","type":"debug","z":"444ac2e5.82b0bc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":700,"y":1880,"wires":[]},{"id":"2b887588.e131fa","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
回复

使用道具 举报

16

主题

223

帖子

1868

积分

金牌会员

Rank: 6Rank: 6

积分
1868
金钱
1645
HASS币
0
 楼主| 发表于 2021-2-2 21:25:07 | 显示全部楼层
hunterfox 发表于 2021-2-2 17:12
[{"id":"8f3c9832.bab7a8","type":"api-current-state","z":"444ac2e5.82b0bc","name":"第一节点","serve ...

谢谢大佬,学习一下
回复

使用道具 举报

16

主题

223

帖子

1868

积分

金牌会员

Rank: 6Rank: 6

积分
1868
金钱
1645
HASS币
0
 楼主| 发表于 2021-2-2 22:31:46 | 显示全部楼层
hunterfox 发表于 2021-2-1 23:26
把state 属性里的勾取消。 如不去,只有当开关状态改变才数据,去掉勾,则有任意属性变化都触发 ...

大佬,顶上那条我把state 属性里的勾取消了,怎么还是不执行我发给你看看

[{"id":"cf558bfe.f62e78","type":"tab","label":"流程 1","disabled":false,"info":""},{"id":"2907eaa.d5cfe16","type":"server-state-changed","z":"cf558bfe.f62e78","name":"电脑排插","server":"7cac8150.6405d","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.diannao","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":280,"y":160,"wires":[["42ab2e6d.c09af"]]},{"id":"76bac9da.8f6ed8","type":"api-call-service","z":"cf558bfe.f62e78","name":"关闭电脑","server":"7cac8150.6405d","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.diannao","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":800,"y":160,"wires":[[]]},{"id":"42ab2e6d.c09af","type":"switch","z":"cf558bfe.f62e78","name":"功率小于20瓦","property":"data.attributes.load_power","propertyType":"msg","rules":[{"t":"lt","v":"20","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":460,"y":160,"wires":[["da40474.5e4fab8"]]},{"id":"da40474.5e4fab8","type":"delay","z":"cf558bfe.f62e78","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":640,"y":160,"wires":[["76bac9da.8f6ed8"]]},{"id":"7cac8150.6405d","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
回复

使用道具 举报

43

主题

412

帖子

3806

积分

元老级技术达人

积分
3806
金钱
3389
HASS币
136
发表于 2021-2-2 23:12:44 | 显示全部楼层
mengyu 发表于 2021-2-2 22:31
大佬,顶上那条我把state 属性里的勾取消了,怎么还是不执行我发给你看看

[{"id":"cf558bfe.f62e78","typ ...

你的switch 属性应该是错误的,我猜测你是用injec 推开关状态取的路径,如果用events:state 节点,实际功率路劲应该是:data.new_state.attributes.load_power   你用debug核实一下你的路径
回复

使用道具 举报

16

主题

223

帖子

1868

积分

金牌会员

Rank: 6Rank: 6

积分
1868
金钱
1645
HASS币
0
 楼主| 发表于 2021-2-3 00:03:50 | 显示全部楼层
hunterfox 发表于 2021-2-2 23:12
你的switch 属性应该是错误的,我猜测你是用injec 推开关状态取的路径,如果用events:state 节点,实际 ...

谢谢大佬,看来确实是data.old_state.attributes.load_power,不能用injec推路径

大佬有没有关于门锁的nr能指点一下啊?思路好乱,之前用自动化的时候就是开门关门锁门执行,然后开门执行,能不能给点教程或者建议啊
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-21 22:47 , Processed in 1.491232 second(s), 35 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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