『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
12
返回列表 发新帖
楼主: 罐头

[求助] 小米人体传感器2怎么实现日落后有人时自动开灯

[复制链接]

7

主题

59

帖子

352

积分

中级会员

Rank: 3Rank: 3

积分
352
金钱
293
HASS币
0
发表于 2022-6-6 15:09:08 | 显示全部楼层
trigger作为触发条件,trigger特性是如果你有多个触发条件, 任何一个条件满足都会触发。 所以condition里应该再补充下,”有人 “和 ”关照度低于300 “ 两个条件    是并且的关系!
回复

使用道具 举报

7

主题

59

帖子

352

积分

中级会员

Rank: 3Rank: 3

积分
352
金钱
293
HASS币
0
发表于 2022-6-6 15:15:22 | 显示全部楼层
本帖最后由 BabyDriver 于 2022-6-6 15:18 编辑

alias: 大厅有人开灯
description: ''
trigger:
  - platform: sun
    event: sunset
    offset: 0
condition:
  - condition: and
        conditions  #第一个环境条件  有人在 #

        conditions  #第二个环境条件   光照低于XXX#

action:
  - type: turn_on
    device_id: b7e80d98208f4e036ee87c9fb6f179e9
    entity_id: switch.0x00158d0003665be4_switch
    domain: switch
mode: single
回复

使用道具 举报

8

主题

36

帖子

179

积分

注册会员

Rank: 2

积分
179
金钱
143
HASS币
0
 楼主| 发表于 2022-6-6 20:14:45 | 显示全部楼层
alias: 大厅有人开灯
description: ''
trigger: []
condition:
  - condition: and
    conditions:
      - condition: sun
        before: sunrise
        after: sunset
      - type: is_motion
        condition: device
        device_id: 18617e09d69ba54cf339503479b23560
        entity_id: binary_sensor.54ef44c40fae_motion
        domain: binary_sensor
action:
  - type: turn_on
    device_id: b7e80d98208f4e036ee87c9fb6f179e9
    entity_id: switch.0x00158d0003665be4_switch
    domain: switch
mode: single


可是我改成这样不开了
回复

使用道具 举报

8

主题

36

帖子

179

积分

注册会员

Rank: 2

积分
179
金钱
143
HASS币
0
 楼主| 发表于 2022-6-6 20:16:17 | 显示全部楼层
alias: 大厅有人开灯
description: ''
trigger: []
condition:
  - condition: and
    conditions:
      - condition: sun
        before: sunrise
        after: sunset
      - type: is_motion
        condition: device
        device_id: 18617e09d69ba54cf339503479b23560
        entity_id: binary_sensor.54ef44c40fae_motion
        domain: binary_sensor
action:
  - type: turn_on
    device_id: b7e80d98208f4e036ee87c9fb6f179e9
    entity_id: switch.0x00158d0003665be4_switch
    domain: switch
mode: single


改成这样不开了
回复

使用道具 举报

7

主题

59

帖子

352

积分

中级会员

Rank: 3Rank: 3

积分
352
金钱
293
HASS币
0
发表于 2022-6-6 21:15:27 | 显示全部楼层
罐头 发表于 2022-6-6 20:16
alias: 大厅有人开灯
description: ''
trigger: []

trigger 条件要有啊。。。。。condition只是补充
回复

使用道具 举报

8

主题

36

帖子

179

积分

注册会员

Rank: 2

积分
179
金钱
143
HASS币
0
 楼主| 发表于 2022-6-6 21:35:37 | 显示全部楼层
BabyDriver 发表于 2022-6-6 21:15
trigger 条件要有啊。。。。。condition只是补充

- id: '1654338947630'
  alias: 大厅有人开灯
  description: ''
  trigger:
  condition:
    - condition: and
      conditions:
        - type: motion
          platform: device
          device_id: 18617e09d69ba54cf339503479b23560
          entity_id: binary_sensor.54ef44c40fae_motion
          domain: binary_sensor
        - platform: sun
          before: sunrise
          after: sunset
  action:
    - type: turn_on
      device_id: b7e80d98208f4e036ee87c9fb6f179e9
      entity_id: switch.0x00158d0003665be4_switch
      domain: switch
  mode: single

改成这样l
回复

使用道具 举报

7

主题

59

帖子

352

积分

中级会员

Rank: 3Rank: 3

积分
352
金钱
293
HASS币
0
发表于 2022-6-7 11:04:32 | 显示全部楼层
罐头 发表于 2022-6-6 21:35
- id: '1654338947630'
  alias: 大厅有人开灯
  description: ''

你真的 需要 去好好学学基础, 慢慢来
回复

使用道具 举报

8

主题

36

帖子

179

积分

注册会员

Rank: 2

积分
179
金钱
143
HASS币
0
 楼主| 发表于 2022-6-10 15:04:30 | 显示全部楼层
BabyDriver 发表于 2022-6-7 11:04
你真的 需要 去好好学学基础, 慢慢来

要学yaml语言吗
回复

使用道具 举报

8

主题

36

帖子

179

积分

注册会员

Rank: 2

积分
179
金钱
143
HASS币
0
 楼主| 发表于 2022-6-10 15:17:02 | 显示全部楼层
alias: 新建自动化
description: ''
trigger:
  - type: motion
    platform: device
    device_id: 18617e09d69ba54cf339503479b23560
    entity_id: binary_sensor.54ef44c40fae_motion
    domain: binary_sensor
condition:
  - condition: sun
    before: sunrise
    after: sunset
action:
  - type: turn_on
    device_id: b7e80d98208f4e036ee87c9fb6f179e9
    entity_id: switch.0x00158d0003665be4_switch
    domain: switch
mode: single


求教
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-19 04:05 , Processed in 0.090928 second(s), 28 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表