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

 找回密码
 立即注册
查看: 2705|回复: 3

[流程系列] 请教如何比较2个仪器的状态值

[复制链接]

12

主题

91

帖子

406

积分

论坛分享达人

积分
406
金钱
315
HASS币
0
发表于 2020-5-19 20:44:52 | 显示全部楼层 |阅读模式
一个小的改造,已经尝试了2天还没找到解决办法,无赖只好请教各位大侠了。
我想实现当室外湿度小于室内湿度时风机打开,反之风机关闭。目前遇到的困难是不知道怎么比较2个仪器的状态值。
TIM图片20200519204410.png
回复

使用道具 举报

6

主题

71

帖子

754

积分

高级会员

Rank: 4

积分
754
金钱
678
HASS币
30
发表于 2020-5-19 21:47:41 | 显示全部楼层
[{"id":"942a0190.8c1b2","type":"server-state-changed","z":"25655f3e.f0139","name":"室内湿度","server":"bb7c7ca1.f8ba3","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":140,"y":360,"wires":[["2dd2f4cb.e0cc8c"]]},{"id":"2dd2f4cb.e0cc8c","type":"change","z":"25655f3e.f0139","name":"保存室内温度","rules":[{"t":"move","p":"payload","pt":"msg","to":"shineishidu","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":360,"wires":[["75dcf59d.d9564c"]]},{"id":"75dcf59d.d9564c","type":"api-current-state","z":"25655f3e.f0139","name":"室外湿度","server":"bb7c7ca1.f8ba3","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":480,"y":360,"wires":[["4f785b2.23836a4"]]},{"id":"4f785b2.23836a4","type":"switch","z":"25655f3e.f0139","name":"比较湿度","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"shineishidu","vt":"msg"},{"t":"lt","v":"shineishidu","vt":"msg"}],"checkall":"true","repair":false,"outputs":2,"x":620,"y":360,"wires":[["f2d921ab.9e9ee"],["8b9bfd32.21f2b"]]},{"id":"f2d921ab.9e9ee","type":"api-call-service","z":"25655f3e.f0139","name":"关闭风机","server":"bb7c7ca1.f8ba3","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":790,"y":320,"wires":[[]]},{"id":"8b9bfd32.21f2b","type":"api-call-service","z":"25655f3e.f0139","name":"打开风机","server":"bb7c7ca1.f8ba3","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":790,"y":400,"wires":[[]]},{"id":"bb7c7ca1.f8ba3","type":"server","z":"","name":"gushihou-hass","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

回复

使用道具 举报

26

主题

2096

帖子

8508

积分

论坛元老

Rank: 8Rank: 8

积分
8508
金钱
6407
HASS币
30

论坛元老

发表于 2020-5-20 10:38:35 | 显示全部楼层
用inject循环触发,换另一个ha节点收集湿度,然后吧每个湿度msg.payload = msg.payload.室内or室外这样,能让数据传输下去,最后在function里比较室内和室外2个参数
回复

使用道具 举报

12

主题

91

帖子

406

积分

论坛分享达人

积分
406
金钱
315
HASS币
0
 楼主| 发表于 2020-5-20 20:50:19 | 显示全部楼层

666!!!   按照大神的方法很轻松就搞定。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-26 12:12 , Processed in 3.098481 second(s), 29 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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