
안녕하세요 레드추파 입니다.
홈어시스턴트에서 세탁기, 건조기를 연동하여
스마트하게 알림을 사용 하는 자동화를 소개 해드리고자 합니다.
일단 세탁물을 뺐는지 안뻈는지 확인하기 위한
세탁실 최근 입장 여부를 판단하는 센서가 필요합니다.
세탁기 도어에 도어센서를 붙이는 방법, 모션센서, 재실감지센서 등
여러가지 센서를 트리거 할수 있겠지만 제가 생각하기에 가장 정확한건 카운터 센서 입니다.
도어센서의 경우에는 정확하지만 눈으로 보기에 별로 안이뻐서 추천드리지 않습니다.
시작하기전에 필요한 물리적 센서과 자동화 작동 구조를 전체적으로 설명 드리겠습니다.
물리적 센서
세탁기 or 건조기 (HA에 연결된)
세탁실 문열림 감지용 (도어 센서)
세탁실 들어감 감지용 (카운터 센서)
카운터 센서 오탐 초기화용 (모션 센서)
자동화 작동 구조
아이가 밤중에 깨면 안되니
낮에는 소리 알림으로 세탁물을 꺼내라고 알려주고 or 아이방에 사람감지시 앱알림으로 주거나
밤에는 앱알림으로 세탁물을 꺼내라고 알려줍니다
방송 알림의 경우에는 존재하는곳에서
재실이 감지된 경우에만 방송 알림을 하는 방법이 가장 깔끔합니다.
자동화는 사람의 기분까지 고려해서 알려주는게 좋습니다
랜덤 노래를 재생하더라도 날씨에 따라서 재생을 분기 해주는게 좋고
아.. 내용이 길어지니 현재 자동화만 설명 드리겠습니다.
아무튼간에 요약해서 설명 드리자면
1. 세탁실문을 열어두면 겨울엔 춥고, 여름엔 덥기 때문에
세탁기가 종료되고 5분이 지났는데, 세탁실 문이 열려있다면 문을 닫으라고 알려줍니다.
(세탁물을 바로 꺼내고 문을 안닫았을때, 문닫으라는 알림)
2. 세탁물 꺼내라는 알림은
10분마다 6단계로 나눠서 처음엔 친절하게 말해주고 뒤로 갈수록 엄중한 톤으로 세탁물을 빼라고 알려주게 합니다.
ex)
1번째 알림: 세탁이 끝났어요. 시간 되실 때 세탁기 한 번만 확인해주세요.
6번째 알림: 마지막 알림 입니다. 세탁이 끝난 지 1시간이 지났으나, 세탁실에 출입한 이력을 발견하지 못했습니다. 세탁물을 꺼내주세요. 현재 알림을 종료 합니다.
ps. 여기서 중요한게 세탁기가 꺼짐 상태를 트리거를 하면 안됩니다.
홈어시스턴트가 재시작했을 경우에는 언노운(알수없음) 상태에서 꺼짐상태로 변경이 되기 때문에 불필요한 자동화가 실행됩니다.
그렇기 때문에 재시작해도 문제가 발생되지 않는, 기기상태의 정확한 트리거 방식을 사용 하여야 합니다.
3.
세탁실 입장시 최근 입장여부 스위치가 켜지게 하고
최근 입장여부 센서는 20분마다 자동으로 꺼지게 해두고
최근 입장여부 센서가 켜져있으면 불필요한 알림 방송 반복을 중지 합니다.
최근 입장 여부를 저장할 센서를 생성
1. 일단 메모리 역할을 할 센서를 생성해 줍니다.
# /homeassistant/input_booleans.yaml
laundry_recent_enter:
name: 세탁실 최근 입장 여부
initial: off
icon: mdi:account-arrow-left
2. 센서를 편하게 쓰기 위해서 템플릿 센서를 만들어서 동기화 해줍니다
# /homeassistant/templates.yaml
# 엔티티 아아디는 이런식으로 생성됨 switch.setagsil_coegeun_ibjang_yeobu_gasangseuwici
- switch:
- name: "세탁실 최근 입장 여부 가상스위치"
unique_id: seataksil_enter_vitual_switch
state: "{{ is_state('input_boolean.laundry_recent_enter', 'on') }}"
turn_on:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.laundry_recent_enter
turn_off:
- action: input_boolean.turn_off
target:
entity_id: input_boolean.laundry_recent_enter
재시작하게되면 엔티티 아이디가 생성이 되고
input_boolean 센서는 input_boolean.laundry_recent_enter 이런식으로 생성이 되고
템플릿 센서 이면 switch.setagsil_coegeun_ibjang_yeobu_gasangseuwici 이런식으로 생성이 됩니다.
즉 한글이면 발음된 영어로 변경이되고 띄어쓰기는 언더바 형태로 엔티티 아이디가 부여 됩니다.
템플릿 센서로 만들어 두면 자동화 할때, 유용해서 이렇게 만드는게 좋습니다.
전체 자동화 코드는 아래와 같습니다.
아래 코드에 디바이스 아이디와 엔티티 아이디를 변경해서 넣으면 이해할 필요 없이 고대로 쓰시면 됩니다.
device_id 와 entity_id 아이디는 설정 내역에서 보실수도 있지만
빈 자동화를 생성해서 요런식으로 확인하실수도 있습니다.

[자동화 코드 1] - 세탁실에 사람이 한명 들어가면 최근 입장여부 가상스위치 켜짐
alias: 세탁실 들어가면 조명 켜지고, 최근 세탁실 입장 여부 가상스위치 켜짐
description: ""
triggers:
- trigger: numeric_state
entity_id:
- number.anbang_sihaseu_jaesil_kaunteo_senseo_people
above: 0
id: 세탁실 시하스 카운터 센서 0 초과되면
conditions: []
actions:
- if:
- condition: trigger
id:
- 세탁실 시하스 카운터 센서 0 초과되면
then:
- if:
- condition: state
entity_id: switch.setagsil_coegeun_ibjang_yeobu_gasangseuwici
state:
- "off"
then:
- action: switch.turn_on
metadata: {}
target:
entity_id: switch.setagsil_coegeun_ibjang_yeobu_gasangseuwici
data: {}
- if:
- condition: device
type: is_off
device_id: d21f191abb7559cfa594298950db301b
entity_id: 8b1b653e630ba0428476265ca2c80782
domain: switch
then:
- type: turn_on
device_id: d21f191abb7559cfa594298950db301b
entity_id: 8b1b653e630ba0428476265ca2c80782
domain: switch
alias: 세탁실 조명 꺼져 있으면 세탁실 조명 켜기
mode: parallel
max: 25
[자동화 코드 2] - 세탁실 세탁기 건조기 꺼짐 트리거 후 알림 방송 자동화
// (코드가 길어서 건조기 코드는 삭제했는데 세탁기껄 복붙해서 쓰시면 됩니다.)
alias: z(알림) 세탁실 세탁기 건조기 확인 알림
description: ""
triggers:
- trigger: state
entity_id:
- sensor.setagsil_setaggi_job_state
to:
- finish
id: 세탁실 세탁기 꺼졌을때
- trigger: state
entity_id:
- sensor.setagsil_geonjogi_job_state
to:
- finished
id: 세탁실 건조기 꺼졌을때
conditions: []
actions:
- if:
- condition: trigger
id:
- 세탁실 세탁기 꺼졌을때
then:
- if:
- condition: time
after: "07:00:00"
before: "23:59:59"
then:
- if:
- type: is_open
condition: device
device_id: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
entity_id: wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
domain: binary_sensor
then:
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- if:
- type: is_open
condition: device
device_id: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
entity_id: wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
domain: binary_sensor
then:
- action: tts.speak
data:
media_player_entity_id: media_player.cpyi_z_fold5
message: 세탁실 문이 열려있습니다... 세탁실 문을 닫아주세요
cache: true
language: ko-KR-SunHiNeural
target:
entity_id: tts.edge_tts
enabled: false
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.geosil_gugeulneseuteuheobeu
language: ko-KR
message: 세탁실 문이 열려있습니다... 세탁실 문을 닫아주세요
target:
device_id: zxcvzxcvzxcvzxcvzxcvzxcvzxcv
- repeat:
count: 6
sequence:
- delay:
minutes: 10
enabled: true
- choose:
- conditions:
- condition: state
entity_id: input_boolean.laundry_recent_enter
state: "on"
sequence:
- stop: 세탁기 문이 열려 반복을 중지합니다
- conditions:
- condition: and
conditions:
- condition: device
type: is_off
device_id: asdfasdfasdfasdfasdfasdfasdfasdf
entity_id: qwerqwerqwerqwerqwerqwerqwerqwer
domain: switch
- condition: template
value_template: "{{ repeat.index == 1 }}"
sequence:
- action: tts.speak
data:
media_player_entity_id: media_player.geosil_gugeulneseuteuheobeu
message: 세탁기 안에 빨래는 빼셨나요... 빨래 좀 부탁드립니다
cache: true
language: ko-KR-SunHiNeural
target:
entity_id: tts.edge_tts
enabled: false
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.geosil_gugeulneseuteuheobeu
language: ko-KR
message: 세탁이 끝났어요. 시간 되실 때 세탁기 한 번만 확인해주세요.
target:
device_id: zxcvzxcvzxcvzxcvzxcvzxcvzxcv
- conditions:
- condition: and
conditions:
- condition: device
type: is_off
device_id: asdfasdfasdfasdfasdfasdfasdfasdf
entity_id: qwerqwerqwerqwerqwerqwerqwerqwer
domain: switch
- condition: template
value_template: "{{ repeat.index == 2 }}"
sequence:
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.geosil_gugeulneseuteuheobeu
language: ko-KR
message: 아직 세탁기 안에 빨래가 있어요. 잊지 않으셨다면 시간 괜찮을 때 꺼내주세요.
target:
device_id: zxcvzxcvzxcvzxcvzxcvzxcvzxcv
- conditions:
- condition: and
conditions:
- condition: device
type: is_off
device_id: asdfasdfasdfasdfasdfasdfasdfasdf
entity_id: qwerqwerqwerqwerqwerqwerqwerqwer
domain: switch
- condition: template
value_template: "{{ repeat.index == 3 }}"
sequence:
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.geosil_gugeulneseuteuheobeu
language: ko-KR
message: >-
세탁이 끝난 지 30분이 지났으나, 세탁실에 출입한 기록을 발견하지 못했습니다. 세탁물을
꺼내주세요.
target:
device_id: zxcvzxcvzxcvzxcvzxcvzxcvzxcv
- conditions:
- condition: and
conditions:
- condition: device
type: is_off
device_id: asdfasdfasdfasdfasdfasdfasdfasdf
entity_id: qwerqwerqwerqwerqwerqwerqwerqwer
domain: switch
- condition: template
value_template: "{{ repeat.index == 4 }}"
sequence:
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.geosil_gugeulneseuteuheobeu
language: ko-KR
message: >-
세탁이 끝난 지 40분이 지났으나, 세탁실에 출입한 기록을 발견하지 못했습니다. 세탁물을
꺼내주세요.
target:
device_id: zxcvzxcvzxcvzxcvzxcvzxcvzxcv
- conditions:
- condition: and
conditions:
- condition: device
type: is_off
device_id: asdfasdfasdfasdfasdfasdfasdfasdf
entity_id: qwerqwerqwerqwerqwerqwerqwerqwer
domain: switch
- condition: template
value_template: "{{ repeat.index == 5 }}"
sequence:
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.geosil_gugeulneseuteuheobeu
language: ko-KR
message: >-
세탁이 끝난 지 50분이 지났으나, 세탁실에 출입한 기록을 발견하지 못했습니다. 세탁물을
꺼내주세요.
target:
device_id: zxcvzxcvzxcvzxcvzxcvzxcvzxcv
- conditions:
- condition: and
conditions:
- condition: device
type: is_off
device_id: asdfasdfasdfasdfasdfasdfasdfasdf
entity_id: qwerqwerqwerqwerqwerqwerqwerqwer
domain: switch
- condition: template
value_template: "{{ repeat.index == 6 }}"
sequence:
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.geosil_gugeulneseuteuheobeu
language: ko-KR
message: >-
마지막 알림 입니다. 세탁이 끝난 지 1시간이 지났으나, 세탁실에 출입한 이력을 발견하지
못했습니다. 세탁물을 꺼내주세요. 현재 알림을 종료 합니다.
target:
device_id: zxcvzxcvzxcvzxcvzxcvzxcvzxcv
else:
- if:
- type: is_open
condition: device
device_id: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
entity_id: wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
domain: binary_sensor
then:
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- if:
- type: is_open
condition: device
device_id: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
entity_id: wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
domain: binary_sensor
then:
- action: notify.mobile_app_sm_f966n
data:
message: 세탁실 문이 열려있습니다... 세탁실 문을 닫아주세요
- repeat:
count: 6
sequence:
- delay:
minutes: 10
enabled: true
- choose:
- conditions:
- condition: state
entity_id: input_boolean.laundry_recent_enter
state: "on"
sequence:
- stop: 세탁기 문이 열려 반복을 중지합니다
- conditions:
- condition: and
conditions:
- condition: device
type: is_off
device_id: asdfasdfasdfasdfasdfasdfasdfasdf
entity_id: qwerqwerqwerqwerqwerqwerqwerqwer
domain: switch
- condition: template
value_template: "{{ repeat.index == 1 }}"
sequence:
- action: notify.mobile_app_sm_f966n
data:
message: 세탁이 끝났어요. 시간 되실 때 세탁기 한 번만 확인해주세요.
- conditions:
- condition: and
conditions:
- condition: device
type: is_off
device_id: asdfasdfasdfasdfasdfasdfasdfasdf
entity_id: qwerqwerqwerqwerqwerqwerqwerqwer
domain: switch
- condition: template
value_template: "{{ repeat.index == 2 }}"
sequence:
- action: notify.mobile_app_sm_f966n
data:
message: 아직 세탁기 안에 빨래가 있어요 잊지 않으셨다면 괜찮을 때 꺼내주세요
- conditions:
- condition: and
conditions:
- condition: device
type: is_off
device_id: asdfasdfasdfasdfasdfasdfasdfasdf
entity_id: qwerqwerqwerqwerqwerqwerqwerqwer
domain: switch
- condition: template
value_template: "{{ repeat.index == 3 }}"
sequence:
- action: notify.mobile_app_sm_f966n
data:
message: >-
세탁이 끝난 지 30분이 지났으나, 세탁실에 출입한 기록을 발견하지 못했습니다. 세탁물을
꺼내주세요.
- conditions:
- condition: and
conditions:
- condition: device
type: is_off
device_id: asdfasdfasdfasdfasdfasdfasdfasdf
entity_id: qwerqwerqwerqwerqwerqwerqwerqwer
domain: switch
- condition: template
value_template: "{{ repeat.index == 4 }}"
sequence:
- action: notify.mobile_app_sm_f966n
data:
message: >-
세탁이 끝난 지 40분이 지났으나, 세탁실에 출입한 기록을 발견하지 못했습니다. 세탁물을
꺼내주세요.
- conditions:
- condition: and
conditions:
- condition: device
type: is_off
device_id: asdfasdfasdfasdfasdfasdfasdfasdf
entity_id: qwerqwerqwerqwerqwerqwerqwerqwer
domain: switch
- condition: template
value_template: "{{ repeat.index == 5 }}"
sequence:
- action: notify.mobile_app_sm_f966n
data:
message: >-
세탁이 끝난 지 50분이 지났으나, 세탁실에 출입한 기록을 발견하지 못했습니다. 세탁물을
꺼내주세요.
- conditions:
- condition: and
conditions:
- condition: device
type: is_off
device_id: asdfasdfasdfasdfasdfasdfasdfasdf
entity_id: qwerqwerqwerqwerqwerqwerqwerqwer
domain: switch
- condition: template
value_template: "{{ repeat.index == 6 }}"
sequence:
- action: notify.mobile_app_sm_f966n
data:
message: >-
마지막 알림 입니다. 세탁이 끝난 지 1시간이 지났으나, 세탁실에 출입한 이력을 발견하지
못했습니다. 세탁물을 꺼내주세요. 현재 알림을 종료 합니다.
[자동화 코드 3] - 세탁실 최근 입장 여부 가상 스위치 자동 꺼짐용 자동화
alias: 세탁실 최근 입장 여부 가상 스위치 켜지면 20분뒤에 자동 꺼짐
description: ""
triggers:
- trigger: state
entity_id:
- switch.setagsil_coegeun_ibjang_yeobu_gasangseuwici
to:
- "on"
id: 세탁실 최근 입장 여부 가상 스위치 켜지면
from:
- "off"
conditions: []
actions:
- if:
- condition: trigger
id:
- 세탁실 최근 입장 여부 가상 스위치 켜지면
then:
- delay:
hours: 0
minutes: 20
seconds: 0
milliseconds: 0
- if:
- condition: state
entity_id: switch.setagsil_coegeun_ibjang_yeobu_gasangseuwici
state:
- "on"
then:
- action: switch.turn_off
metadata: {}
target:
entity_id: switch.setagsil_coegeun_ibjang_yeobu_gasangseuwici
data: {}
mode: restart
[자동화 코드 4] - 카운터 센서 초기화용 자동화
alias: 세탁실 움직임 없으면 카운터 센서 초기화
description: ""
triggers:
- type: not_occupied
device_id: 1021e9f1f963d73ff3ce0f0741919369
entity_id: 86da7ccfd838b8e5f57a1254e89863be
domain: binary_sensor
trigger: device
for:
hours: 0
minutes: 5
seconds: 0
conditions: []
actions:
- if:
- condition: not
conditions:
- condition: state
entity_id: number.anbang_sihaseu_jaesil_kaunteo_senseo_people
state: "0"
then:
- device_id: ec765228ce5361ba3f6f092edd728516
domain: number
entity_id: 931425e48ce0bd386d9abc67cd815905
type: set_value
value: 0
mode: single
'스마트홈 IoT 월드 > 스마트홈 자동화' 카테고리의 다른 글
| 선풍기, 에어컨 대쉬보드 카드 및 자동화 예시 (0) | 2025.12.18 |
|---|---|
| 홈어시스턴트에서 Node-RED 사용해보기: 웹훅을 이용한 재실 자동화 (1) | 2025.07.09 |
| 시하스 카운터 센서를 HA에서 더 편하게 사용 하게 해주는 블루프린트 (0) | 2025.04.28 |
| 컴퓨터 켜기 자동화의 끝판왕 (WOL, AOS, 비콘) (0) | 2025.03.19 |
| HA 가상스위치를 사용하여 구글홈 앱 스마트하게 사용하기 3탄 (0) | 2025.03.11 |