[size=15.008px]避免睡前加湿器的风扇噪音,睡前联动灯关闭,在设定的时间后自动开启加湿器保持湿度,使用nodered实现。 [size=15.008px]视频教程 https://www.bilibili.com/video/BV1m3411y7rL/
[
{
"id": "3687aa50d23e61de",
"type": "api-call-service",
"z": "e2a8ceb6.b2cd",
"name": "关闭加湿器",
"server": "18668ea5.b519c1",
"version": 3,
"debugenabled": false,
"service_domain": "humidifier",
"service": "turn_off",
"entityId": "humidifier.mi_smart_evaporative_humidifer_humidifier",
"data": "",
"dataType": "jsonata",
"mergecontext": "",
"mustacheAltTags": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "1",
"valueType": "str"
}
],
"queue": "none",
"x": 290,
"y": 2740,
"wires": [
[
"1aa2f15519bdad9f"
]
]
},
{
"id": "3e2f27a83778ebc1",
"type": "api-call-service",
"z": "e2a8ceb6.b2cd",
"name": "打开加湿器",
"server": "18668ea5.b519c1",
"version": 3,
"debugenabled": false,
"service_domain": "humidifier",
"service": "turn_on",
"entityId": "humidifier.mi_smart_evaporative_humidifer_humidifier",
"data": "",
"dataType": "jsonata",
"mergecontext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 690,
"y": 2800,
"wires": [
[
"6a26691763dac8ce"
]
]
},
{
"id": "6a26691763dac8ce",
"type": "api-call-service",
"z": "e2a8ceb6.b2cd",
"name": "加湿器-恒湿模式",
"server": "18668ea5.b519c1",
"version": 3,
"debugenabled": false,
"service_domain": "humidifier",
"service": "set_mode",
"entityId": "humidifier.mi_smart_evaporative_humidifer_humidifier",
"data": "{\t \"entity_id\": \"humidifier.mi_smart_evaporative_humidifer_humidifier\",\t \"mode\": \"Humidity\"\t}",
"dataType": "jsonata",
"mergecontext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 900,
"y": 2780,
"wires": [
[]
]
},
{
"id": "1aa2f15519bdad9f",
"type": "trigger",
"z": "e2a8ceb6.b2cd",
"name": "",
"op1": "",
"op2": "0",
"op1type": "nul",
"op2type": "str",
"duration": "50",
"extend": true,
"overrideDelay": false,
"units": "min",
"reset": "",
"bytopic": "all",
"topic": "topic",
"outputs": 2,
"x": 670,
"y": 2700,
"wires": [
[],
[
"8ec8b5c461ac508a"
]
]
},
{
"id": "a7b580218ae95a7e",
"type": "server-state-changed",
"z": "e2a8ceb6.b2cd",
"name": "卧室射灯",
"server": "18668ea5.b519c1",
"version": 3,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "switch.wo_shi_she_deng",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"for": 0,
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 260,
"y": 2560,
"wires": [
[
"7abb1909dddccdc1"
],
[]
]
},
{
"id": "eed993f87c7878c8",
"type": "server-state-changed",
"z": "e2a8ceb6.b2cd",
"name": "卧室灯",
"server": "18668ea5.b519c1",
"version": 3,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "switch.wo_shi_deng",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"for": 0,
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 270,
"y": 2620,
"wires": [
[
"7abb1909dddccdc1"
],
[]
]
},
{
"id": "7abb1909dddccdc1",
"type": "change",
"z": "e2a8ceb6.b2cd",
"name": "",
"rules": [
{
"t": "set",
"p": "reset",
"pt": "msg",
"to": "1",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 460,
"y": 2600,
"wires": [
[
"1aa2f15519bdad9f"
]
]
},
{
"id": "c67306b21020df3c",
"type": "link in",
"z": "e2a8ceb6.b2cd",
"name": "加湿器-睡眠模式",
"links": [
"6a5b1640c31a6834",
"7a14d5e1bbee7b17"
],
"x": 175,
"y": 2740,
"wires": [
[
"3687aa50d23e61de"
]
]
},
{
"id": "8ec8b5c461ac508a",
"type": "api-current-state",
"z": "e2a8ceb6.b2cd",
"name": "加湿器状态",
"server": "18668ea5.b519c1",
"version": 2,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "humidifier.mi_smart_evaporative_humidifer_humidifier",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 870,
"y": 2700,
"wires": [
[
"67527da5fc0863b6"
]
]
},
{
"id": "67527da5fc0863b6",
"type": "switch",
"z": "e2a8ceb6.b2cd",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "off",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 1030,
"y": 2700,
"wires": [
[
"3e2f27a83778ebc1"
]
]
},
{
"id": "8a8c108073121184",
"type": "comment",
"z": "e2a8ceb6.b2cd",
"name": "开灯,重置倒计时",
"info": "",
"x": 510,
"y": 2540,
"wires": []
},
{
"id": "18668ea5.b519c1",
"type": "server",
"name": ".7.7-Home Assistant",
"version": 1,
"legacy": false,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true
}
]
|