[ { "id": "自动化客厅灯带", "automation": "- alias: 自动化客厅灯带\n description: ''\n trigger:\n - platform: state\n entity_id:\n - sensor.xiaomi_lx06_b297_conversation\n condition:\n - condition: template\n value_template: '{{ (trigger.to_state|default(0)) and as_timestamp(now()) -\n\n as_timestamp(trigger.to_state.attributes.timestamp) < 60 }}\n\n {# 限制60秒内的对话 #}\n\n '\n - condition: template\n value_template: '{{ ''自动化客厅灯带'' in trigger.to_state.state }}'\n - condition: state\n entity_id: light.living_room_ceiling_light_strip\n state: 'off'\n - condition: state\n entity_id: light.living_room_main_light\n state: 'off'\n - condition: state\n entity_id: input_boolean.guan_ying_mo_shi_zhuang_tai\n state: 'off'\n action:\n - service: light.turn_on\n data: {}\n target:\n entity_id: light.living_room_ceiling_light_strip\n - service: light.turn_off\n data: {}\n target:\n entity_id: light.walkway_spotlights\n - service: light.turn_off\n data: {}\n target:\n entity_id: light.hallway\n mode: single", "config": [ { "name": "xiaomi lx06 b297 conversation sensor", "room": "living_room", "type": "sensor", "id": { "entity_id": "sensor.xiaomi_lx06_b297_conversation", "device_id": null } }, { "name": "living room ceiling light strip", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_ceiling_light_strip", "device_id": null } }, { "name": "living room main light", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_main_light", "device_id": null } }, { "name": "guan ying mo shi zhuang tai input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.guan_ying_mo_shi_zhuang_tai", "device_id": null } }, { "name": "walkway spotlights", "room": "walkway", "type": "light", "id": { "entity_id": "light.walkway_spotlights", "device_id": null } }, { "name": "hallway light", "room": "hallway", "type": "light", "id": { "entity_id": "light.hallway", "device_id": null } } ] }, { "id": "knx离家", "automation": "- alias: knx离家\n description: ''\n trigger:\n - platform: event\n event_type: knx_event\n event_data:\n destination: 10/1/101\n condition: []\n action:\n - service: scene.turn_on\n data: {}\n target:\n entity_id: scene.chi_jia_zhong_zhi\n mode: single", "config": [ { "name": "chi jia zhong zhi scene", "room": null, "type": "scene", "id": { "entity_id": "scene.chi_jia_zhong_zhi", "device_id": null } } ] }, { "id": "小爱对话自动化之主卧", "automation": "- alias: 小爱对话自动化之主卧\n description: 关键词匹配和小爱对话内容并操作对应的设备\n trigger:\n - platform: state\n entity_id: sensor.xiaomi_oh2_3d2b_conversation\n condition:\n - condition: template\n value_template: \"{{ trigger.to_state and\\n as_timestamp(now()) - as_timestamp(trigger.to_state.attributes.timestamp)\\\n \\ < 60 }}\\n\"\n action:\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ ''打开主灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_on\n target:\n entity_id: light.master_bedroom_main_light\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭主灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_off\n target:\n entity_id: light.master_bedroom_main_light\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''打开射灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_on\n target:\n entity_id: light.master_bedroom_bed_headlight\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭射灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_off\n target:\n entity_id: light.master_bedroom_bed_headlight\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''打开床尾灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_on\n target:\n entity_id: light.master_bedroom_bed_headlight\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭床尾灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_off\n target:\n entity_id: light.master_bedroom_bed_headlight\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''打开床头灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_on\n target:\n entity_id: light.master_bedroom_bedside_lamp\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭床头灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_off\n target:\n entity_id: light.master_bedroom_bedside_lamp\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''打开灯带'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_on\n target:\n entity_id: light.master_bedroom_light_strip\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭灯带'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_off\n target:\n entity_id: light.master_bedroom_light_strip\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''打开衣帽间灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_on\n target:\n entity_id: light.master_bedroom_entrance_spotlight\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭衣帽间灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_off\n target:\n entity_id: light.master_bedroom_entrance_spotlight\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''打开布帘'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: switch.turn_off\n target:\n entity_id: switch.master_bedroom_curtains\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭布帘'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: switch.turn_on\n target:\n entity_id: switch.master_bedroom_curtains\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''准备睡觉'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: scene.turn_on\n target:\n entity_id: scene.zhu_wo_yu_shui_jue\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''晚安'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: scene.turn_on\n target:\n entity_id: scene.shui_jue\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''起床'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: scene.turn_on\n target:\n entity_id: scene.zhu_wo_qi_chuang\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''准备起床'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: scene.turn_on\n target:\n entity_id: scene.zhu_wo_yu_qi_chuang\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''主卧观影'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: scene.turn_on\n target:\n entity_id: scene.zhu_wo_guan_ying\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''结束观影'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: scene.turn_on\n target:\n entity_id: scene.jie_shu_zhu_wo_guan_ying\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''打开纱帘'' in trigger.to_state.state or ''打开窗纱'' in trigger.to_state.state\n }}\n\n '\n sequence:\n - if:\n - condition: state\n entity_id: switch.master_bedroom_gauze_curtain\n state: 'off'\n then:\n - service: switch.turn_off\n target:\n entity_id: switch.master_bedroom_gauze_curtain\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭纱帘'' in trigger.to_state.state or ''关闭窗纱'' in trigger.to_state.state\n }}\n\n '\n sequence:\n - if:\n - condition: state\n entity_id: switch.master_bedroom_gauze_curtain\n state: 'on'\n then:\n - service: switch.turn_on\n target:\n entity_id: switch.master_bedroom_gauze_curtain\n data: {}\n default: []\n - service: system_log.write\n data:\n level: info\n logger: custom_components.xiaomi_miot.xiaoai\n message: '{{ trigger.entity_id }}: {{ trigger.to_state.state }}\n\n '\n mode: single", "config": [ { "name": "xiaomi oh2 3d2b conversation sensor", "room": "master_bedroom", "type": "sensor", "id": { "entity_id": "sensor.xiaomi_oh2_3d2b_conversation", "device_id": null } }, { "name": "master bedroom main light", "room": "master_bedroom", "type": "light", "id": { "entity_id": "light.master_bedroom_main_light", "device_id": null } }, { "name": "master bedroom bed headlight", "room": "master_bedroom", "type": "light", "id": { "entity_id": "light.master_bedroom_bed_headlight", "device_id": null } }, { "name": "master bedroom bedside lamp", "room": "master_bedroom", "type": "light", "id": { "entity_id": "light.master_bedroom_bedside_lamp", "device_id": null } }, { "name": "master bedroom light strip", "room": "master_bedroom", "type": "light", "id": { "entity_id": "light.master_bedroom_light_strip", "device_id": null } }, { "name": "master bedroom entrance spotlight", "room": "master_bedroom", "type": "light", "id": { "entity_id": "light.master_bedroom_entrance_spotlight", "device_id": null } }, { "name": "master bedroom curtains switch", "room": "master_bedroom", "type": "switch", "id": { "entity_id": "switch.master_bedroom_curtains", "device_id": null } }, { "name": "zhu wo yu shui jue scene", "room": "master_bedroom", "type": "scene", "id": { "entity_id": "scene.zhu_wo_yu_shui_jue", "device_id": null } }, { "name": "shui jue scene", "room": null, "type": "scene", "id": { "entity_id": "scene.shui_jue", "device_id": null } }, { "name": "zhu wo qi chuang scene", "room": "master_bedroom", "type": "scene", "id": { "entity_id": "scene.zhu_wo_qi_chuang", "device_id": null } }, { "name": "zhu wo yu qi chuang scene", "room": "master_bedroom", "type": "scene", "id": { "entity_id": "scene.zhu_wo_yu_qi_chuang", "device_id": null } }, { "name": "zhu wo guan ying scene", "room": "master_bedroom", "type": "scene", "id": { "entity_id": "scene.zhu_wo_guan_ying", "device_id": null } }, { "name": "jie shu zhu wo guan ying scene", "room": "master_bedroom", "type": "scene", "id": { "entity_id": "scene.jie_shu_zhu_wo_guan_ying", "device_id": null } }, { "name": "master bedroom gauze curtain switch", "room": "master_bedroom", "type": "switch", "id": { "entity_id": "switch.master_bedroom_gauze_curtain", "device_id": null } } ] }, { "id": "小爱对话自动化之书房", "automation": "- alias: 小爱对话自动化之书房\n description: 关键词匹配和小爱对话内容并操作对应的设备\n trigger:\n - platform: state\n entity_id:\n - sensor.xiaomi_l05c_0bb3_conversation\n condition:\n - condition: template\n value_template: '{{ (trigger.to_state|default(0)) and as_timestamp(now()) -\n\n as_timestamp(trigger.to_state.attributes.timestamp) < 60 }}\n\n {# 限制60秒内的对话 #}\n\n '\n action:\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ ''离家模式'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: scene.turn_on\n data: {}\n target:\n entity_id: scene.chi_jia_zhong_zhi\n - conditions:\n - condition: template\n value_template: '{{ ''打开玄关灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_on\n target:\n entity_id: light.hallway\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭玄关灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_off\n target:\n entity_id: light.hallway\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''打开书房灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_on\n target:\n entity_id:\n - light.study\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭书房灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_off\n data: {}\n target:\n entity_id: light.study\n default: []\n - service: system_log.write\n data:\n level: info\n logger: custom_components.xiaomi_miot.xiaoai\n message: '{{ trigger.entity_id }}: {{ trigger.to_state.state }}\n\n '\n mode: single", "config": [ { "name": "hallway light", "room": "hallway", "type": "light", "id": { "entity_id": "light.hallway", "device_id": null } }, { "name": "chi jia zhong zhi scene", "room": null, "type": "scene", "id": { "entity_id": "scene.chi_jia_zhong_zhi", "device_id": null } }, { "name": "xiaomi l05c 0bb3 conversation sensor", "room": "study", "type": "sensor", "id": { "entity_id": "sensor.xiaomi_l05c_0bb3_conversation", "device_id": null } }, { "name": "study light", "room": "study", "type": "light", "id": { "entity_id": "light.study", "device_id": null } } ] }, { "id": "小爱对话自动化之客厅", "automation": "- alias: 小爱对话自动化之客厅\n description: 关键词匹配和小爱对话内容并操作对应的设备\n triggers:\n - entity_id: sensor.xiaomi_lx06_b297_conversation\n trigger: state\n conditions:\n - condition: template\n value_template: '{{ (trigger.to_state|default(0)) and as_timestamp(now()) -\n\n as_timestamp(trigger.to_state.attributes.timestamp) < 60 }}\n\n {# 限制60秒内的对话 #}\n\n '\n actions:\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ ''打开走道灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.walkway_spotlights\n data: {}\n action: light.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭走道灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.walkway_spotlights\n data: {}\n action: light.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''打开厨房灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.kitchen_strip_light\n data: {}\n action: light.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭厨房灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.kitchen_strip_light\n data: {}\n action: light.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''打开厨房筒灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.kitchen_downlight\n data: {}\n action: light.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭厨房筒灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.kitchen_downlight\n data: {}\n action: light.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''打开餐厅吊灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.restaurant_chandelier\n data: {}\n action: light.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭餐厅吊灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.restaurant_chandelier\n data: {}\n action: light.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''打开餐厅筒灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.restaurant_spotlights\n data: {}\n action: light.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭餐厅筒灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.restaurant_spotlights\n data: {}\n action: light.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''打开餐厅布帘'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: switch.restaurant_curtain\n data: {}\n action: switch.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''关闭餐厅布帘'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: switch.restaurant_curtain\n data: {}\n action: switch.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''打开餐厅纱帘'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: switch.restaurant_gauze_curtain\n data: {}\n action: switch.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''打开餐厅窗纱'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: switch.restaurant_gauze_curtain\n data: {}\n action: switch.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''关闭餐厅纱帘'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: switch.restaurant_gauze_curtain\n data: {}\n action: switch.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭餐厅窗纱'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: switch.restaurant_gauze_curtain\n data: {}\n action: switch.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''打开客厅灯带'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.living_room_ceiling_light_strip\n data: {}\n action: light.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭客厅灯带'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.living_room_ceiling_light_strip\n data: {}\n action: light.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''打开客厅中间筒灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.living_room_center_spotlight\n data: {}\n action: light.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭客厅中间筒灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.living_room_center_spotlight\n data: {}\n action: light.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''打开客厅筒灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.living_room_downlight\n data: {}\n action: light.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭客厅筒灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.living_room_downlight\n data: {}\n action: light.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''打开客厅主灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.living_room_main_light\n data: {}\n action: light.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭客厅主灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.living_room_main_light\n data: {}\n action: light.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''打开电视墙灯带'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.tv_background_light_strip\n data: {}\n action: light.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭电视墙灯带'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: light.tv_background_light_strip\n data: {}\n action: light.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''打开客厅布帘'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: switch.living_room_curtains\n data: {}\n action: switch.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''关闭客厅布帘'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: switch.living_room_curtains\n data: {}\n action: switch.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''打开客厅纱帘'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: switch.living_room_gauze_curtain\n data: {}\n action: switch.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''关闭客厅纱帘'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: switch.living_room_gauze_curtain\n data: {}\n action: switch.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''打开客厅窗纱'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: switch.living_room_gauze_curtain\n data: {}\n action: switch.turn_off\n - conditions:\n - condition: template\n value_template: '{{ ''关闭客厅窗纱'' in trigger.to_state.state }}\n\n '\n sequence:\n - target:\n entity_id: switch.living_room_gauze_curtain\n data: {}\n action: switch.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''观影模式'' == trigger.to_state.state }}'\n sequence:\n - data: {}\n target:\n entity_id: scene.guan_ying\n action: scene.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''结束观影'' == trigger.to_state.state }}'\n sequence:\n - data: {}\n target:\n entity_id: scene.jie_shu_guan_ying\n action: scene.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''看电视'' in trigger.to_state.state }}'\n sequence:\n - data: {}\n target:\n entity_id: scene.kan_dian_shi\n action: scene.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''用餐'' in trigger.to_state.state }}'\n sequence:\n - data: {}\n target:\n entity_id: scene.yong_can\n action: scene.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''备餐'' in trigger.to_state.state }}'\n sequence:\n - data: {}\n target:\n entity_id: scene.bei_can\n action: scene.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''厨房'' in trigger.to_state.state }}'\n sequence:\n - data: {}\n target:\n entity_id: scene.bei_can\n action: scene.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''工作'' in trigger.to_state.state }}'\n sequence:\n - data: {}\n target:\n entity_id: scene.can_ting_gong_zuo\n action: scene.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''晚安'' in trigger.to_state.state }}'\n sequence:\n - data: {}\n target:\n entity_id: scene.ke_ting_wan_an\n action: scene.turn_on\n - data: {}\n action: script.1698163602021\n - conditions:\n - condition: template\n value_template: '{{ ''关闭纱帘'' in trigger.to_state.state }}'\n sequence:\n - if:\n - condition: state\n entity_id: switch.living_room_gauze_curtain\n state: 'off'\n then:\n - data: {}\n target:\n entity_id: scene.guan_bi_ke_can_ting_sha_lian\n action: scene.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''打开纱帘'' in trigger.to_state.state }}'\n sequence:\n - if:\n - condition: state\n entity_id: switch.living_room_gauze_curtain\n state: 'on'\n then:\n - data: {}\n target:\n entity_id: scene.da_kai_ke_can_ting_sha_lian\n action: scene.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''会客模式'' in trigger.to_state.state }}'\n sequence:\n - data: {}\n target:\n entity_id: scene.hui_ke\n action: scene.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭会客模式'' in trigger.to_state.state }}'\n sequence:\n - data: {}\n target:\n entity_id: scene.hui_ke\n action: scene.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''关闭布帘'' in trigger.to_state.state }}'\n sequence:\n - if:\n - condition: state\n entity_id: switch.living_room_curtains\n state: 'off'\n then:\n - data: {}\n target:\n entity_id: switch.restaurant_curtain\n action: switch.turn_on\n - data: {}\n target:\n entity_id: switch.living_room_curtains\n action: switch.turn_on\n - conditions:\n - condition: template\n value_template: '{{ ''打开布帘'' in trigger.to_state.state }}'\n sequence:\n - if:\n - condition: state\n entity_id: switch.living_room_curtains\n state: 'on'\n then:\n - action: switch.turn_off\n target:\n entity_id:\n - switch.restaurant_curtain\n data: {}\n - action: switch.turn_off\n target:\n entity_id:\n - switch.living_room_curtains\n data: {}\n default: []\n - data:\n level: info\n logger: custom_components.xiaomi_miot.xiaoai\n message: '{{ trigger.entity_id }}: {{ trigger.to_state.state }}\n\n '\n action: system_log.write\n mode: single", "config": [ { "name": "xiaomi lx06 b297 conversation sensor", "room": "living_room", "type": "sensor", "id": { "entity_id": "sensor.xiaomi_lx06_b297_conversation", "device_id": null } }, { "name": "living room ceiling light strip", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_ceiling_light_strip", "device_id": null } }, { "name": "living room main light", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_main_light", "device_id": null } }, { "name": "walkway spotlights", "room": "walkway", "type": "light", "id": { "entity_id": "light.walkway_spotlights", "device_id": null } }, { "name": "kitchen strip light", "room": "kitchen", "type": "light", "id": { "entity_id": "light.kitchen_strip_light", "device_id": null } }, { "name": "kitchen downlight", "room": "kitchen", "type": "light", "id": { "entity_id": "light.kitchen_downlight", "device_id": null } }, { "name": "restaurant chandelier", "room": "restaurant", "type": "light", "id": { "entity_id": "light.restaurant_chandelier", "device_id": null } }, { "name": "restaurant spotlights", "room": "restaurant", "type": "light", "id": { "entity_id": "light.restaurant_spotlights", "device_id": null } }, { "name": "restaurant curtain switch", "room": "restaurant", "type": "switch", "id": { "entity_id": "switch.restaurant_curtain", "device_id": null } }, { "name": "restaurant gauze curtain switch", "room": "restaurant", "type": "switch", "id": { "entity_id": "switch.restaurant_gauze_curtain", "device_id": null } }, { "name": "living room center spotlight", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_center_spotlight", "device_id": null } }, { "name": "living room downlight", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_downlight", "device_id": null } }, { "name": "tv background light strip", "room": "living_room", "type": "light", "id": { "entity_id": "light.tv_background_light_strip", "device_id": null } }, { "name": "living room curtains switch", "room": "living_room", "type": "switch", "id": { "entity_id": "switch.living_room_curtains", "device_id": null } }, { "name": "living room gauze curtain switch", "room": "living_room", "type": "switch", "id": { "entity_id": "switch.living_room_gauze_curtain", "device_id": null } }, { "name": "guan ying scene", "room": "living_room", "type": "scene", "id": { "entity_id": "scene.guan_ying", "device_id": null } }, { "name": "jie shu guan ying scene", "room": "living_room", "type": "scene", "id": { "entity_id": "scene.jie_shu_guan_ying", "device_id": null } }, { "name": "kan dian shi scene", "room": "living_room", "type": "scene", "id": { "entity_id": "scene.kan_dian_shi", "device_id": null } }, { "name": "yong can scene", "room": "restaurant", "type": "scene", "id": { "entity_id": "scene.yong_can", "device_id": null } }, { "name": "bei can scene", "room": "kitchen", "type": "scene", "id": { "entity_id": "scene.bei_can", "device_id": null } }, { "name": "can ting gong zuo scene", "room": "restaurant", "type": "scene", "id": { "entity_id": "scene.can_ting_gong_zuo", "device_id": null } }, { "name": "ke ting wan an scene", "room": "living_room", "type": "scene", "id": { "entity_id": "scene.ke_ting_wan_an", "device_id": null } }, { "name": "script 1698163602021", "room": null, "type": "script", "id": { "entity_id": "script.1698163602021", "device_id": null } }, { "name": "guan bi ke can ting sha lian scene", "room": "living_room", "type": "scene", "id": { "entity_id": "scene.guan_bi_ke_can_ting_sha_lian", "device_id": null } }, { "name": "da kai ke can ting sha lian scene", "room": "living_room", "type": "scene", "id": { "entity_id": "scene.da_kai_ke_can_ting_sha_lian", "device_id": null } }, { "name": "hui ke scene", "room": "living_room", "type": "scene", "id": { "entity_id": "scene.hui_ke", "device_id": null } } ] }, { "id": "小爱对话自动化之主卧", "automation": "- alias: 小爱对话自动化之主卧\n description: 关键词匹配和小爱对话内容并操作对应的设备\n trigger:\n - platform: state\n entity_id: sensor.xiaomi_s12_e74f_conversation\n - platform: state\n entity_id: sensor.xiaomi_l05c_0bb3_conversation\n - platform: state\n entity_id: sensor.xiaomi_l05c_4da7_conversation\n - platform: state\n entity_id: sensor.xiaomi_lx06_b297_conversation\n condition:\n - condition: template\n value_template: '{{ (trigger.to_state|default(0)) and as_timestamp(now()) -\n\n as_timestamp(trigger.to_state.attributes.timestamp) < 60 }}\n\n {# 限制60秒内的对话 #}\n\n '\n action:\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ ''打开主卧灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_on\n target:\n entity_id: light.master_bedroom_main_light\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭主卧灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.master_bedroom_main_light\n target:\n entity_id: switch.study\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''打开主卧空调'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: switch.turn_on\n target:\n entity_id: switch.zhu_wo_kong_diao_kai_guan\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭主卧空调'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: switch.turn_off\n target:\n entity_id: switch.zhu_wo_kong_diao_kai_guan\n data: {}\n default: []\n - service: system_log.write\n data:\n level: info\n logger: custom_components.xiaomi_miot.xiaoai\n message: '{{ trigger.entity_id }}: {{ trigger.to_state.state }}\n\n '\n mode: single", "config": [ { "name": "xiaomi lx06 b297 conversation sensor", "room": "living_room", "type": "sensor", "id": { "entity_id": "sensor.xiaomi_lx06_b297_conversation", "device_id": null } }, { "name": "master bedroom main light", "room": "master_bedroom", "type": "light", "id": { "entity_id": "light.master_bedroom_main_light", "device_id": null } }, { "name": "xiaomi l05c 0bb3 conversation sensor", "room": "study", "type": "sensor", "id": { "entity_id": "sensor.xiaomi_l05c_0bb3_conversation", "device_id": null } }, { "name": "xiaomi s12 e74f conversation sensor", "room": "hallway", "type": "sensor", "id": { "entity_id": "sensor.xiaomi_s12_e74f_conversation", "device_id": null } }, { "name": "xiaomi l05c 4da7 conversation sensor", "room": "master_bedroom", "type": "sensor", "id": { "entity_id": "sensor.xiaomi_l05c_4da7_conversation", "device_id": null } }, { "name": "zhu wo kong diao kai guan switch", "room": "master_bedroom", "type": "switch", "id": { "entity_id": "switch.zhu_wo_kong_diao_kai_guan", "device_id": null } }, { "name": "Study Switch", "room": "Study", "type": "switch", "id": { "entity_id": "switch.study", "device_id": null } } ] }, { "id": "小爱对话自动化之玄关", "automation": "- alias: 小爱对话自动化之玄关\n description: 关键词匹配和小爱对话内容并操作对应的设备\n trigger:\n - platform: state\n entity_id: sensor.xiaomi_s12_e74f_conversation\n condition:\n - condition: template\n value_template: '{{ (trigger.to_state|default(0)) and as_timestamp(now()) -\n\n as_timestamp(trigger.to_state.attributes.timestamp) < 60 }}\n\n {# 限制60秒内的对话 #}\n\n '\n action:\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ ''离家模式'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: scene.turn_on\n data: {}\n target:\n entity_id: scene.chi_jia_zhong_zhi\n - conditions:\n - condition: template\n value_template: '{{ ''打开玄关灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_on\n target:\n entity_id: light.hallway\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭玄关灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_off\n target:\n entity_id: light.hallway\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''打开儿童房主灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_on\n target:\n entity_id: light.children_s_house_lamp\n data: {}\n - conditions:\n - condition: template\n value_template: '{{ ''关闭儿童房主灯'' in trigger.to_state.state }}\n\n '\n sequence:\n - service: light.turn_off\n target:\n entity_id: light.children_s_house_lamp\n data: {}\n default: []\n - service: system_log.write\n data:\n level: info\n logger: custom_components.xiaomi_miot.xiaoai\n message: '{{ trigger.entity_id }}: {{ trigger.to_state.state }}\n\n '\n mode: single", "config": [ { "name": "hallway light", "room": "hallway", "type": "light", "id": { "entity_id": "light.hallway", "device_id": null } }, { "name": "chi jia zhong zhi scene", "room": null, "type": "scene", "id": { "entity_id": "scene.chi_jia_zhong_zhi", "device_id": null } }, { "name": "xiaomi s12 e74f conversation sensor", "room": "hallway", "type": "sensor", "id": { "entity_id": "sensor.xiaomi_s12_e74f_conversation", "device_id": null } }, { "name": "children house lamp", "room": "children_room", "type": "light", "id": { "entity_id": "light.children_s_house_lamp", "device_id": null } } ] }, { "id": "日出窗帘自动化", "automation": "- alias: 日出窗帘自动化\n description: ''\n trigger:\n - platform: sun\n event: sunrise\n offset: 0\n condition: []\n action:\n - service: switch.turn_off\n data: {}\n target:\n entity_id: switch.master_bedroom_curtains\n - service: switch.turn_off\n data: {}\n target:\n entity_id: switch.restaurant_curtain\n - service: switch.turn_off\n data: {}\n target:\n entity_id: switch.living_room_curtains\n - service: switch.turn_off\n data: {}\n target:\n entity_id: switch.children_s_room_gauze_curtain\n - service: switch.turn_off\n data: {}\n target:\n entity_id: switch.gauze_curtain_for_elders_room\n - service: switch.turn_off\n data: {}\n target:\n entity_id: switch.living_room_gauze_curtain\n - service: switch.turn_off\n data: {}\n target:\n entity_id: switch.restaurant_gauze_curtain\n mode: single", "config": [ { "name": "master bedroom curtains switch", "room": "master_bedroom", "type": "switch", "id": { "entity_id": "switch.master_bedroom_curtains", "device_id": null } }, { "name": "restaurant curtain switch", "room": "restaurant", "type": "switch", "id": { "entity_id": "switch.restaurant_curtain", "device_id": null } }, { "name": "restaurant gauze curtain switch", "room": "restaurant", "type": "switch", "id": { "entity_id": "switch.restaurant_gauze_curtain", "device_id": null } }, { "name": "living room curtains switch", "room": "living_room", "type": "switch", "id": { "entity_id": "switch.living_room_curtains", "device_id": null } }, { "name": "living room gauze curtain switch", "room": "living_room", "type": "switch", "id": { "entity_id": "switch.living_room_gauze_curtain", "device_id": null } }, { "name": "children room gauze curtain switch", "room": "children_room", "type": "switch", "id": { "entity_id": "switch.children_s_room_gauze_curtain", "device_id": null } }, { "name": "gauze curtain for elders room switch", "room": "elders_room", "type": "switch", "id": { "entity_id": "switch.gauze_curtain_for_elders_room", "device_id": null } } ] }, { "id": "日落窗帘自动化", "automation": "- alias: 日落窗帘自动化\n description: ''\n trigger:\n - platform: sun\n event: sunset\n offset: 0\n condition: []\n action:\n - service: switch.turn_on\n data: {}\n target:\n entity_id: switch.master_bedroom_curtains\n - service: switch.turn_on\n data: {}\n target:\n entity_id: switch.restaurant_gauze_curtain\n - service: switch.turn_on\n data: {}\n target:\n entity_id: switch.living_room_gauze_curtain\n - service: switch.turn_on\n data: {}\n target:\n entity_id: switch.children_s_room_gauze_curtain\n - service: switch.turn_on\n data: {}\n target:\n entity_id: switch.gauze_curtain_for_elders_room\n - service: switch.turn_on\n data: {}\n target:\n entity_id: switch.master_bedroom_gauze_curtain\n mode: single", "config": [ { "name": "master bedroom curtains switch", "room": "master_bedroom", "type": "switch", "id": { "entity_id": "switch.master_bedroom_curtains", "device_id": null } }, { "name": "master bedroom gauze curtain switch", "room": "master_bedroom", "type": "switch", "id": { "entity_id": "switch.master_bedroom_gauze_curtain", "device_id": null } }, { "name": "restaurant gauze curtain switch", "room": "restaurant", "type": "switch", "id": { "entity_id": "switch.restaurant_gauze_curtain", "device_id": null } }, { "name": "living room gauze curtain switch", "room": "living_room", "type": "switch", "id": { "entity_id": "switch.living_room_gauze_curtain", "device_id": null } }, { "name": "children room gauze curtain switch", "room": "children_room", "type": "switch", "id": { "entity_id": "switch.children_s_room_gauze_curtain", "device_id": null } }, { "name": "gauze curtain for elders room switch", "room": "elders_room", "type": "switch", "id": { "entity_id": "switch.gauze_curtain_for_elders_room", "device_id": null } } ] }, { "id": "晚上10点关闭主卧布帘", "automation": "- alias: 晚上10点关闭主卧布帘\n description: ''\n trigger:\n - platform: time\n at: '22:00:00'\n condition: []\n action:\n - service: switch.turn_on\n data: {}\n target:\n entity_id: switch.master_bedroom_curtains\n mode: single", "config": [ { "name": "master bedroom curtains switch", "room": "master_bedroom", "type": "switch", "id": { "entity_id": "switch.master_bedroom_curtains", "device_id": null } } ] }, { "id": "玄关人体感应器回家模式", "automation": "- alias: 玄关人体感应器回家模式\n description: 检查家里没有开灯且厨房光照低于50开启回家模式\n trigger:\n - platform: state\n entity_id:\n - sensor.xiaomi_lx06_b297_conversation\n condition:\n - condition: template\n value_template: '{{ (trigger.to_state|default(0)) and as_timestamp(now()) -\n\n as_timestamp(trigger.to_state.attributes.timestamp) < 60 }}\n\n {# 限制60秒内的对话 #}\n\n '\n - condition: state\n entity_id: light.restaurant_chandelier\n state: 'off'\n - condition: state\n entity_id: light.restaurant_spotlights\n state: 'off'\n - condition: state\n entity_id: light.living_room_center_spotlight\n state: 'off'\n - condition: state\n entity_id: light.living_room_downlight\n state: 'off'\n - condition: state\n entity_id: light.living_room_ceiling_light_strip\n state: 'off'\n - condition: state\n entity_id: light.tv_background_light_strip\n state: 'off'\n - condition: state\n entity_id: light.living_room_main_light\n state: 'off'\n - condition: template\n value_template: '{{ ''玄关人体感应器自动化回家'' in trigger.to_state.state }}'\n action:\n - service: scene.turn_on\n target:\n entity_id: scene.hui_jia\n metadata: {}\n - service: scene.turn_on\n target:\n entity_id: scene.zai_jia_mo_shi\n metadata: {}\n mode: single", "config": [ { "name": "xiaomi lx06 b297 conversation sensor", "room": "living_room", "type": "sensor", "id": { "entity_id": "sensor.xiaomi_lx06_b297_conversation", "device_id": null } }, { "name": "living room ceiling light strip", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_ceiling_light_strip", "device_id": null } }, { "name": "living room main light", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_main_light", "device_id": null } }, { "name": "restaurant chandelier", "room": "restaurant", "type": "light", "id": { "entity_id": "light.restaurant_chandelier", "device_id": null } }, { "name": "restaurant spotlights", "room": "restaurant", "type": "light", "id": { "entity_id": "light.restaurant_spotlights", "device_id": null } }, { "name": "living room center spotlight", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_center_spotlight", "device_id": null } }, { "name": "living room downlight", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_downlight", "device_id": null } }, { "name": "tv background light strip", "room": "living_room", "type": "light", "id": { "entity_id": "light.tv_background_light_strip", "device_id": null } }, { "name": "hui jia scene", "room": null, "type": "scene", "id": { "entity_id": "scene.hui_jia", "device_id": null } }, { "name": "zai jia mo shi scene", "room": null, "type": "scene", "id": { "entity_id": "scene.zai_jia_mo_shi", "device_id": null } } ] }, { "id": "自动化客厅灯带", "automation": "- alias: 自动化客厅灯带\n description: ''\n trigger:\n - platform: state\n entity_id:\n - sensor.xiaomi_lx06_b297_conversation\n condition:\n - condition: template\n value_template: '{{ (trigger.to_state|default(0)) and as_timestamp(now()) -\n\n as_timestamp(trigger.to_state.attributes.timestamp) < 60 }}\n\n {# 限制60秒内的对话 #}\n\n '\n - condition: template\n value_template: '{{ ''自动化客厅灯带'' in trigger.to_state.state }}'\n - condition: state\n entity_id: light.living_room_ceiling_light_strip\n state: 'off'\n action:\n - service: light.turn_on\n data: {}\n target:\n entity_id: light.living_room_ceiling_light_strip\n mode: single", "config": [ { "name": "xiaomi lx06 b297 conversation sensor", "room": "living_room", "type": "sensor", "id": { "entity_id": "sensor.xiaomi_lx06_b297_conversation", "device_id": null } }, { "name": "living room ceiling light strip", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_ceiling_light_strip", "device_id": null } } ] }, { "id": "自动化客厅筒灯", "automation": "- alias: 自动化客厅筒灯\n description: ''\n trigger:\n - platform: state\n entity_id:\n - sensor.xiaomi_lx06_b297_conversation\n condition:\n - condition: template\n value_template: '{{ (trigger.to_state|default(0)) and as_timestamp(now()) -\n\n as_timestamp(trigger.to_state.attributes.timestamp) < 60 }}\n\n {# 限制60秒内的对话 #}\n\n '\n - condition: template\n value_template: '{{ ''自动化客厅筒灯'' in trigger.to_state.state }}'\n - condition: state\n entity_id: light.living_room_downlight\n state: 'off'\n - condition: state\n entity_id: light.living_room_main_light\n state: 'off'\n - condition: state\n entity_id: light.living_room_ceiling_light_strip\n state: 'off'\n - condition: state\n entity_id: input_boolean.guan_ying_mo_shi_zhuang_tai\n state: 'off'\n action:\n - service: light.turn_on\n data: {}\n target:\n entity_id: light.living_room_downlight\n mode: single", "config": [ { "name": "xiaomi lx06 b297 conversation sensor", "room": "living_room", "type": "sensor", "id": { "entity_id": "sensor.xiaomi_lx06_b297_conversation", "device_id": null } }, { "name": "living room ceiling light strip", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_ceiling_light_strip", "device_id": null } }, { "name": "living room main light", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_main_light", "device_id": null } }, { "name": "guan ying mo shi zhuang tai input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.guan_ying_mo_shi_zhuang_tai", "device_id": null } }, { "name": "living room downlight", "room": "living_room", "type": "light", "id": { "entity_id": "light.living_room_downlight", "device_id": null } } ] } ]