139 lines
6.9 KiB
JSON
139 lines
6.9 KiB
JSON
{
|
||
"_meta": {
|
||
"description": "一个人类动作会触发哪些设备事件,事件按时间先后排列",
|
||
"time_offset_unit": "seconds,表示相对于动作开始的延迟",
|
||
"room_placeholder": "用 {room} 表示动作发生的房间,实际生成时替换为具体房间ID"
|
||
},
|
||
"actions": {
|
||
"enter_room": {
|
||
"description": "进入一个房间",
|
||
"events": [
|
||
{ "device": "{room}_occupancy", "cluster": "OccupancySensing", "attribute": "Occupancy", "value": 1, "time_offset": 0 }
|
||
]
|
||
},
|
||
"leave_room": {
|
||
"description": "离开一个房间",
|
||
"events": [
|
||
{ "device": "{room}_occupancy", "cluster": "OccupancySensing", "attribute": "Occupancy", "value": 0, "time_offset_range": [30, 180], "note": "PIR传感器有延迟,人走后30s-3min才变为unoccupied" }
|
||
]
|
||
},
|
||
"turn_on_light": {
|
||
"description": "开灯",
|
||
"events": [
|
||
{ "device": "{room}_light", "cluster": "OnOff", "attribute": "OnOff", "value": true, "time_offset": 0 }
|
||
]
|
||
},
|
||
"turn_off_light": {
|
||
"description": "关灯",
|
||
"events": [
|
||
{ "device": "{room}_light", "cluster": "OnOff", "attribute": "OnOff", "value": false, "time_offset": 0 }
|
||
]
|
||
},
|
||
"dim_light": {
|
||
"description": "调暗灯光(睡前常见)",
|
||
"events": [
|
||
{ "device": "{room}_light", "cluster": "LevelControl", "attribute": "CurrentLevel", "value_range": [10, 50], "time_offset": 0 }
|
||
]
|
||
},
|
||
"open_window_covering": {
|
||
"description": "打开窗帘",
|
||
"events": [
|
||
{ "device": "{room}_window", "cluster": "WindowCovering", "attribute": "CurrentPositionLiftPercent100ths", "value": 0, "time_offset": 0, "note": "0=全开" }
|
||
]
|
||
},
|
||
"close_window_covering": {
|
||
"description": "关闭窗帘",
|
||
"events": [
|
||
{ "device": "{room}_window", "cluster": "WindowCovering", "attribute": "CurrentPositionLiftPercent100ths", "value": 10000, "time_offset": 0, "note": "10000=全关" }
|
||
]
|
||
},
|
||
"open_window": {
|
||
"description": "打开窗户(通风)",
|
||
"events": [
|
||
{ "device": "{room}_window_contact", "cluster": "BooleanState", "attribute": "StateValue", "value": false, "time_offset": 0, "note": "false=Open" }
|
||
]
|
||
},
|
||
"close_window": {
|
||
"description": "关闭窗户",
|
||
"events": [
|
||
{ "device": "{room}_window_contact", "cluster": "BooleanState", "attribute": "StateValue", "value": true, "time_offset": 0, "note": "true=Closed" }
|
||
]
|
||
},
|
||
"unlock_front_door": {
|
||
"description": "解锁入户门(回家/有人来)",
|
||
"events": [
|
||
{ "device": "front_door_lock", "cluster": "DoorLock", "event": "LockOperation", "fields": { "LockOperationType": 1, "OperationSource": "{source}" }, "time_offset": 0 },
|
||
{ "device": "front_door_lock", "cluster": "DoorLock", "attribute": "LockState", "value": 2, "time_offset": 0, "note": "2=Unlocked" },
|
||
{ "device": "front_door_contact", "cluster": "BooleanState", "attribute": "StateValue", "value": false, "time_offset": 2, "note": "开门" },
|
||
{ "device": "entrance_occupancy", "cluster": "OccupancySensing", "attribute": "Occupancy", "value": 1, "time_offset": 3 }
|
||
]
|
||
},
|
||
"lock_front_door": {
|
||
"description": "锁入户门(出门/睡觉)",
|
||
"events": [
|
||
{ "device": "front_door_contact", "cluster": "BooleanState", "attribute": "StateValue", "value": true, "time_offset": 0, "note": "关门" },
|
||
{ "device": "front_door_lock", "cluster": "DoorLock", "event": "LockOperation", "fields": { "LockOperationType": 0, "OperationSource": "{source}" }, "time_offset": 1 },
|
||
{ "device": "front_door_lock", "cluster": "DoorLock", "attribute": "LockState", "value": 1, "time_offset": 1, "note": "1=Locked" }
|
||
]
|
||
},
|
||
"turn_on_ac": {
|
||
"description": "开空调",
|
||
"events": [
|
||
{ "device": "{room}_ac", "cluster": "OnOff", "attribute": "OnOff", "value": true, "time_offset": 0 },
|
||
{ "device": "{room}_ac", "cluster": "Thermostat", "attribute": "SystemMode", "value": "{mode}", "time_offset": 0 }
|
||
]
|
||
},
|
||
"turn_off_ac": {
|
||
"description": "关空调",
|
||
"events": [
|
||
{ "device": "{room}_ac", "cluster": "OnOff", "attribute": "OnOff", "value": false, "time_offset": 0 }
|
||
]
|
||
},
|
||
"start_cooking": {
|
||
"description": "开始做饭",
|
||
"events": [
|
||
{ "device": "kitchen_light", "cluster": "OnOff", "attribute": "OnOff", "value": true, "time_offset": 0 },
|
||
{ "device": "kitchen_occupancy", "cluster": "OccupancySensing", "attribute": "Occupancy", "value": 1, "time_offset": 0, "note": "仅在有厨房运动传感器的布局中" },
|
||
{ "device": "kitchen_cook_surface", "cluster": "OnOff", "attribute": "OnOff", "value": true, "time_offset": 30 },
|
||
{ "device": "kitchen_temp_sensor", "cluster": "TemperatureMeasurement", "attribute": "MeasuredValue", "value_trend": "gradual_increase", "time_offset": 60, "note": "厨房温度因烹饪逐渐上升" }
|
||
]
|
||
},
|
||
"stop_cooking": {
|
||
"description": "做饭结束",
|
||
"events": [
|
||
{ "device": "kitchen_cook_surface", "cluster": "OnOff", "attribute": "OnOff", "value": false, "time_offset": 0 },
|
||
{ "device": "kitchen_window_contact", "cluster": "BooleanState", "attribute": "StateValue", "value": false, "time_offset": 30, "note": "开窗通风" },
|
||
{ "device": "kitchen_temp_sensor", "cluster": "TemperatureMeasurement", "attribute": "MeasuredValue", "value_trend": "gradual_decrease", "time_offset": 60 }
|
||
]
|
||
},
|
||
"start_dishwasher": {
|
||
"description": "启动洗碗机",
|
||
"events": [
|
||
{ "device": "kitchen_dishwasher", "cluster": "OnOff", "attribute": "OnOff", "value": true, "time_offset": 0 },
|
||
{ "device": "kitchen_dishwasher", "cluster": "OperationalState", "attribute": "OperationalState", "value": 1, "time_offset": 5, "note": "1=Running" }
|
||
]
|
||
},
|
||
"start_laundry": {
|
||
"description": "启动洗衣机",
|
||
"events": [
|
||
{ "device": "balcony_laundry_washer", "cluster": "OnOff", "attribute": "OnOff", "value": true, "time_offset": 0 },
|
||
{ "device": "balcony_laundry_washer", "cluster": "OperationalState", "attribute": "OperationalState", "value": 1, "time_offset": 5, "note": "1=Running" }
|
||
]
|
||
},
|
||
"use_bathroom": {
|
||
"description": "使用卫生间",
|
||
"events": [
|
||
{ "device": "{bathroom}_occupancy", "cluster": "OccupancySensing", "attribute": "Occupancy", "value": 1, "time_offset": 0 },
|
||
{ "device": "{bathroom}_light", "cluster": "OnOff", "attribute": "OnOff", "value": true, "time_offset": 0 }
|
||
]
|
||
},
|
||
"leave_bathroom": {
|
||
"description": "离开卫生间",
|
||
"events": [
|
||
{ "device": "{bathroom}_light", "cluster": "OnOff", "attribute": "OnOff", "value": false, "time_offset": 0 },
|
||
{ "device": "{bathroom}_occupancy", "cluster": "OccupancySensing", "attribute": "Occupancy", "value": 0, "time_offset_range": [30, 120] }
|
||
]
|
||
}
|
||
}
|
||
}
|