- id: '1706745419162'
  alias: ปิดระบบอัตโนมัติทุก 6 โมงเย็น
  description: ''
  trigger:
  - platform: time
    at: '18:00:00'
  condition: []
  action:
  - service: fan.turn_off
    target:
      entity_id:
      - fan.airterk_intake_switch_intake_fan
      - fan.airterk_monitor_switch_relay_exhale
    data: {}
  - type: turn_off
    device_id: 6606dafef742e418ae0269e3e2db9819
    entity_id: 7d0312ee4be77a90d207563684d37965
    domain: switch
  mode: single
- id: '1706745586515'
  alias: เปิดระบบอัตโนมัติทุก 8 โมงเช้า
  description: ''
  trigger:
  - platform: time
    at: 08:00:00
  condition: []
  action:
  - type: turn_on
    device_id: 6606dafef742e418ae0269e3e2db9819
    entity_id: 7d0312ee4be77a90d207563684d37965
    domain: switch
  mode: single
- id: '1706745894845'
  alias: เมื่อค่าฝุ่นมากกว่า 31
  description: ''
  trigger:
  - platform: state
    entity_id:
    - sensor.airterk_monitor_pm_25_in_room
    from:
    to:
  condition:
  - condition: state
    entity_id: switch.airterk_monitor_use_filter_auto
    state: 'on'
  - condition: numeric_state
    entity_id: sensor.airterk_monitor_pm_25_in_room
    above: 31
  action:
  - service: fan.turn_on
    target:
      entity_id:
      - fan.airterk_intake_switch_intake_fan
      - fan.airterk_monitor_switch_relay_exhale
    data: {}
  - service: timer.start
    target:
      entity_id: timer.exhale_timeout
    data: {}
  mode: single
- id: '1706746022991'
  alias: ปิดพัดลมดูดออกเมื่อหมดเวลา
  description: ''
  trigger:
  - platform: state
    entity_id:
    - timer.exhale_timeout
    from: active
    to: idle
  condition: []
  action:
  - service: fan.turn_off
    target:
      entity_id: fan.airterk_monitor_switch_relay_exhale
    data: {}
  mode: single
- id: '1706750712720'
  alias: ปิดพัดลมเมื่อค่าฝุ่นต่ำกว่า 20
  description: ''
  trigger:
  - platform: state
    entity_id:
    - sensor.airterk_monitor_pm_25_in_room
    from:
    to:
  condition:
  - condition: numeric_state
    entity_id: sensor.airterk_monitor_pm_25_in_room
    below: 20
  action:
  - service: fan.turn_off
    target:
      entity_id: fan.airterk_intake_switch_intake_fan
    data: {}
  mode: single
