Not a super difficult or complicated automation but it is really useful and has an enormous housemate approval factor.
What this does is activate our laundry room exhaust fan whenever the little box is used. It waits 2 minutes after the cat has entered the box (to avoid scaring them off) then kicks on the fan, it then waits for the litter robot to change to the Ready state (meaning it has completed its cleaning cycle, usually 7 minutes after the cat has entered the box). This kicks off a 10 minute delay after which it turns off the fan. So, by my math, it runs the fan for (7-2)+10 = 15 minutes. More than enough to clear out all but the most dramatic visits.
Requirements:
- Litter Robot (this publishes the status messages used to trigger the automation. You could substitute any automatic litter box that has this or similar functionality, or perhaps a normal litter box and a motion detector
- A switch or relay to control your exhaust fan in home assistant. I am using a Shelly 1PM (selected because it handles fan loads better than most smart wall switches) and it is running ESPHome, although it could run vanilla shelly, makes no difference. It is controlling a standard ceiling exhaust fan that you commonly see in bathrooms and laundry rooms.
Here is the automation code
alias: Fan - Litter Box
description: ""
trigger:
- platform: state
entity_id:
- sensor.litter_robot_4_status_code
to: cst
- platform: state
entity_id:
- sensor.litter_robot_4_status_code
to: cd
condition: []
action:
- if:
- condition: state
entity_id: switch.laundry_fan
state: "off"
then:
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- service: switch.turn_on
data: {}
target:
entity_id: switch.laundry_fan
- wait_for_trigger:
- platform: state
entity_id:
- sensor.litter_robot_4_status_code
to: rdy
for:
hours: 0
minutes: 10
seconds: 0
timeout:
hours: 1
minutes: 0
seconds: 0
milliseconds: 0
- service: switch.turn_off
data: {}
target:
entity_id: switch.laundry_fan
mode: restart