- 积分
- 276
- 金钱
- 241
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
中级会员
- 积分
- 276
- 金钱
- 241
- HASS币
- 0
|
发表于 2024-9-13 20:05:29
|
显示全部楼层
楼主试试这个吧
假设不能正确获取空调伴侣的运行状态,通过HA控制空调开关,即可实现空调伴侣的自动化。如果能正确获取空调伴侣的状态就更简单了
[{"id":"ed2205733c30c472","type":"api-call-service","z":"0078678ef362fbed","name":"7.低速","server":"65bef38af2beb021","version":5,"debugenabled":false,"domain":"climate","service":"set_fan_mode","areaId":[],"deviceId":["5f5e92c27b29f8ff7cf8990fea565d07"],"entityId":[],"data":"{\"fan_mode\":\"low\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":200,"wires":[[]]},{"id":"9f4ae7055d9ff9f2","type":"api-call-service","z":"0078678ef362fbed","name":"7.高速","server":"65bef38af2beb021","version":5,"debugenabled":false,"domain":"climate","service":"set_fan_mode","areaId":[],"deviceId":["5f5e92c27b29f8ff7cf8990fea565d07"],"entityId":[],"data":"{\"fan_mode\":\"high\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":120,"wires":[[]]},{"id":"c6e42a7e162c6814","type":"server-state-changed","z":"0078678ef362fbed","name":"1.温度计温度变化则触发","server":"65bef38af2beb021","version":5,"outputs":1,"exposeAsEntityConfig":"","entityId":"sensor.cgllc_s1_18dc_temperature","entityIdType":"exact","outputInitially":true,"stateType":"str","ifState":"","ifStateType":"num","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"temp","propertyType":"msg","value":"","valueType":"entityState"}],"x":130,"y":160,"wires":[["96f0b7a78aff6bc3"]]},{"id":"156f2635460bae20","type":"switch","z":"0078678ef362fbed","name":"6.可选调整风速调整阈值","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"2.6","vt":"num"},{"t":"btwn","v":"2.5","vt":"num","v2":"1.6","v2t":"num"},{"t":"lte","v":"1.5","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":1030,"y":160,"wires":[["9f4ae7055d9ff9f2"],["c5a7b621924d6b69"],["ed2205733c30c472"]]},{"id":"c5a7b621924d6b69","type":"api-call-service","z":"0078678ef362fbed","name":"7.中速","server":"65bef38af2beb021","version":5,"debugenabled":false,"domain":"climate","service":"set_fan_mode","areaId":[],"deviceId":["5f5e92c27b29f8ff7cf8990fea565d07"],"entityId":[],"data":"{\"fan_mode\":\"medium\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":160,"wires":[[]]},{"id":"9ec71d83428986bc","type":"api-call-service","z":"0078678ef362fbed","name":"4.空调制冷","server":"65bef38af2beb021","version":5,"debugenabled":false,"domain":"climate","service":"set_hvac_mode","areaId":[],"deviceId":["5f5e92c27b29f8ff7cf8990fea565d07"],"entityId":[],"data":"{\"hvac_mode\":\"cool\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":650,"y":160,"wires":[["6e1fd118554b6fcc"]]},{"id":"c9acc0241736f515","type":"api-call-service","z":"0078678ef362fbed","name":"4.空调通风","server":"65bef38af2beb021","version":5,"debugenabled":false,"domain":"climate","service":"set_hvac_mode","areaId":[],"deviceId":["5f5e92c27b29f8ff7cf8990fea565d07"],"entityId":[],"data":"{\"hvac_mode\":\"heat\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":650,"y":200,"wires":[[]]},{"id":"5f68ecbd9678cb2b","type":"switch","z":"0078678ef362fbed","name":"3.温度阈值","property":"temp","propertyType":"msg","rules":[{"t":"gte","v":"27","vt":"num"},{"t":"lte","v":"26","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":160,"wires":[["9ec71d83428986bc"],["c9acc0241736f515"]]},{"id":"f2bf1e32d825b822","type":"server-state-changed","z":"0078678ef362fbed","name":"在HA中开关空调时触发","server":"65bef38af2beb021","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"climate.cubee_th125t_2a73_thermostat","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"off","ifStateType":"str","ifStateOperator":"is_not","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":120,"y":340,"wires":[["c2f16347439e5765"],["a7da5a367b2783ee"]]},{"id":"c2f16347439e5765","type":"change","z":"0078678ef362fbed","name":"流程变量赋值on","rules":[{"t":"set","p":"woshikongtiao","pt":"flow","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":320,"wires":[[]]},{"id":"a7da5a367b2783ee","type":"change","z":"0078678ef362fbed","name":"流程变量赋值off","rules":[{"t":"set","p":"woshikongtiao","pt":"flow","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":360,"wires":[[]]},{"id":"96f0b7a78aff6bc3","type":"switch","z":"0078678ef362fbed","name":"2.通过流程变量判断是否开机","property":"woshikongtiao","propertyType":"flow","rules":[{"t":"neq","v":"off","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":200,"wires":[[],["5f68ecbd9678cb2b"]]},{"id":"6e1fd118554b6fcc","type":"function","z":"0078678ef362fbed","name":"5.计算温差","func":"msg.payload = (msg.temp) - 24\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":160,"wires":[["156f2635460bae20"]]},{"id":"426bb514abeaaaef","type":"comment","z":"0078678ef362fbed","name":"修改温度计实体","info":"","x":100,"y":120,"wires":[]},{"id":"30385ed30d76ab4a","type":"comment","z":"0078678ef362fbed","name":"如在流程里部署多个空调则需修改变量名","info":"","x":340,"y":240,"wires":[]},{"id":"66ad851034379f83","type":"comment","z":"0078678ef362fbed","name":"修改空调伴侣设备","info":"","x":670,"y":240,"wires":[]},{"id":"9cc4f3c642fc77b5","type":"comment","z":"0078678ef362fbed","name":"自己设置空调制冷启停的阈值","info":"","x":540,"y":120,"wires":[]},{"id":"a15848f65da34882","type":"comment","z":"0078678ef362fbed","name":"应与第3节点的低值相同","info":"","x":840,"y":120,"wires":[]},{"id":"8fc9685a2142df6f","type":"comment","z":"0078678ef362fbed","name":"5、6、7节点是实现自动调节风速功能,如无需此功能可删除","info":"","x":960,"y":80,"wires":[]},{"id":"c28f2c4640a5b0a3","type":"comment","z":"0078678ef362fbed","name":"修改空调伴侣实体","info":"","x":110,"y":300,"wires":[]},{"id":"2f491f71a8927bde","type":"comment","z":"0078678ef362fbed","name":"修改空调伴侣设备","info":"","x":1250,"y":260,"wires":[]},{"id":"65bef38af2beb021","type":"server","name":"Home Assistant","version":5,"addon":false,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m","enableGlobalContextStore":false}]
|
|