求教大佬怎么设置定时22点到23点 ,其次米家人体感应检测有人移动 最后执行开灯。已经写好了人体感应有人移动自动开灯,现在就是不知道怎么添加时间条件。最终目的是想达到 比如周一至周五晚上10点到晚上12点,有人移动的情况自动开灯。
下面是我写的半成品,就差时间条件不知道怎么写
如果是大佬出手呢,也就一个节点的事。可惜我不是,
安装两个节点 node-red-contrib-time-range-switch 这是时间范围,设置几点开始,几点结束。 node-red-contrib-weekday 这是星期节点,需要输出的请打勾。
[mw_shl_code=javascript,true]
{
“id”: “5506c2db.0b4d9c”,
“type”: “time-range-switch”,
“z”: “114a935a.1ab29d”,
“name”: “时间范围几点到几点”,
“lat”: “”,
“lon”: “”,
“startTime”: “22:30”,
“endTime”: “23:30”,
“startOffset”: 0,
“endOffset”: 0,
“x”: 600,
“y”: 140,
“wires”:
“739472dd.2d2bac”
],
]
]
},
{
“id”: “f9d73434.bf9a68”,
“type”: “weekday”,
“z”: “114a935a.1ab29d”,
“name”: “星期一到星期六”,
“sun”: true,
“mon”: true,
“tue”: true,
“wed”: true,
“thu”: true,
“fri”: true,
“sat”: true,
“x”: 380,
“y”: 140,
“wires”:
“5506c2db.0b4d9c”
],
]
]
},
{
“id”: “3c57cf51.4c7e1”,
“type”: “ioBroker in”,
“z”: “114a935a.1ab29d”,
“name”: “人体”,
“topic”: “*”,
“payloadType”: “value”,
“onlyack”: “”,
“func”: “all”,
“gap”: “”,
“x”: 220,
“y”: 140,
“wires”:
“f9d73434.bf9a68”
]
]
},
{
“id”: “739472dd.2d2bac”,
“type”: “ioBroker get”,
“z”: “114a935a.1ab29d”,
“name”: “判断灯当前状态”,
“topic”: “”,
“attrname”: “payload”,
“payloadType”: “value”,
“x”: 290,
“y”: 240,
“wires”:
“264ef16f.64f5fe”
]
]
},
{
“id”: “264ef16f.64f5fe”,
“type”: “change”,
“z”: “114a935a.1ab29d”,
“name”: “如果灯关则打开”,
“rules”:
{
“t”: “change”,
“p”: “payload”,
“pt”: “msg”,
“from”: “false”,
“fromt”: “bool”,
“to”: “true”,
“tot”: “bool”
}
],
“action”: “”,
“property”: “”,
“from”: “”,
“to”: “”,
“reg”: false,
“x”: 480,
“y”: 240,
“wires”:
“63d2f9da.eb6568”
]
]
},
{
“id”: “63d2f9da.eb6568”,
“type”: “ioBroker out”,
“z”: “114a935a.1ab29d”,
“name”: “灯开关”,
“topic”: “”,
“ack”: “false”,
“autoCreate”: “false”,
“x”: 650,
“y”: 240,
“wires”: ]
}
][/mw_shl_code]
谢谢 大佬 给大佬端92年雪碧