- 积分
- 276
- 金钱
- 241
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
中级会员
- 积分
- 276
- 金钱
- 241
- HASS币
- 0
|
发表于 2024-9-9 16:49:53
|
显示全部楼层
本帖最后由 wanyevyv 于 2024-9-9 16:52 编辑
需要在nodered中实现,nodered的events:state,可以在温度每变化0.1度时触发,在switch里设置几个输出控制空调风速
以下为导出
[
{
"id": "b47fd01d009e1125",
"type": "api-call-service",
"z": "724075cff78956a2",
"name": "低速",
"server": "65bef38af2beb021",
"version": 5,
"debugenabled": false,
"domain": "climate",
"service": "set_fan_mode",
"areaId": [],
"deviceId": [
"e2ea0068e8559f95649b6716e11a9438"
],
"entityId": [],
"data": "{\"fan_mode\":\"low\"}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 930,
"y": 400,
"wires": [
[]
]
},
{
"id": "71abcb5f71159d35",
"type": "api-call-service",
"z": "724075cff78956a2",
"name": "高速",
"server": "65bef38af2beb021",
"version": 5,
"debugenabled": false,
"domain": "climate",
"service": "set_fan_mode",
"areaId": [],
"deviceId": [
"e2ea0068e8559f95649b6716e11a9438"
],
"entityId": [],
"data": "{\"fan_mode\":\"high\"}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 930,
"y": 320,
"wires": [
[]
]
},
{
"id": "94039a86feef064f",
"type": "server-state-changed",
"z": "724075cff78956a2",
"name": "1F老人",
"server": "65bef38af2beb021",
"version": 5,
"outputs": 1,
"exposeAsEntityConfig": "",
"entityId": "sensor.cgllc_s1_c5f4_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": "qingpingtemp",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"x": 170,
"y": 360,
"wires": [
[
"26d2b89434c99860"
]
]
},
{
"id": "26d2b89434c99860",
"type": "api-current-state",
"z": "724075cff78956a2",
"name": "面板",
"server": "65bef38af2beb021",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is_not",
"entity_id": "climate.cubee_th125a_cd58_thermostat",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "mianban",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 290,
"y": 360,
"wires": [
[
"afedc40bb8bc69e7"
],
[]
]
},
{
"id": "df3c7785381152b2",
"type": "function",
"z": "724075cff78956a2",
"name": "function 4",
"func": "msg.payload = (msg.qingpingtemp - msg.mianban.attributes.temperature)\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 680,
"y": 360,
"wires": [
[
"8ad9f91f8d114fca"
]
]
},
{
"id": "8ad9f91f8d114fca",
"type": "switch",
"z": "724075cff78956a2",
"name": "",
"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": 810,
"y": 360,
"wires": [
[
"71abcb5f71159d35"
],
[
"a836bbffc4d9f2bb"
],
[
"b47fd01d009e1125"
]
]
},
{
"id": "a836bbffc4d9f2bb",
"type": "api-call-service",
"z": "724075cff78956a2",
"name": "中速",
"server": "65bef38af2beb021",
"version": 5,
"debugenabled": false,
"domain": "climate",
"service": "set_fan_mode",
"areaId": [],
"deviceId": [
"e2ea0068e8559f95649b6716e11a9438"
],
"entityId": [],
"data": "{\"fan_mode\":\"medium\"}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 930,
"y": 360,
"wires": [
[]
]
},
{
"id": "2e02f5467b3d7a58",
"type": "api-call-service",
"z": "724075cff78956a2",
"name": "制冷3",
"server": "65bef38af2beb021",
"version": 5,
"debugenabled": false,
"domain": "climate",
"service": "set_hvac_mode",
"areaId": [],
"deviceId": [
"e2ea0068e8559f95649b6716e11a9438"
],
"entityId": [],
"data": "{\"hvac_mode\":\"cool\"}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 550,
"y": 340,
"wires": [
[
"df3c7785381152b2"
]
]
},
{
"id": "eda141157e401a87",
"type": "api-call-service",
"z": "724075cff78956a2",
"name": "停止3",
"server": "65bef38af2beb021",
"version": 5,
"debugenabled": false,
"domain": "climate",
"service": "set_hvac_mode",
"areaId": [],
"deviceId": [
"e2ea0068e8559f95649b6716e11a9438"
],
"entityId": [],
"data": "{\"hvac_mode\":\"heat\"}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 550,
"y": 380,
"wires": [
[]
]
},
{
"id": "afedc40bb8bc69e7",
"type": "switch",
"z": "724075cff78956a2",
"name": "温度阈值",
"property": "qingpingtemp",
"propertyType": "msg",
"rules": [
{
"t": "gte",
"v": "(msg.mianban.attributes.temperature)+1",
"vt": "jsonata"
},
{
"t": "lte",
"v": "mianban.attributes.temperature",
"vt": "msg"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 420,
"y": 360,
"wires": [
[
"2e02f5467b3d7a58"
],
[
"eda141157e401a87"
]
]
},
{
"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
}
] |
|