# Home Assistant オートメーション YAML サンプル
# 日没後に動体センサーが反応したら照明をオンにする

alias: 玄関センサーで照明オン（日没後）
description: 玄関の動体センサーが反応したとき照明を点灯する
trigger:
  - platform: state
    entity_id: binary_sensor.hallway_motion
    to: "on"
condition:
  - condition: sun
    after: sunset
action:
  - service: light.turn_on
    target:
      entity_id: light.hallway
    data:
      brightness_pct: 80
      transition: 2
mode: single