Custom Room Presence Component: A Game-Changer for Smart Home Automation

Hey everyone, I’m thrilled to share my latest project with the community! I’ve developed a custom Home Assistant component called Room Presence, designed to simplify room occupancy management through motion sensors. This tool has completely transformed how I handle automations in my smart home, and I can’t wait to hear your thoughts!

The Room Presence component allows you to define rooms and assign sensors that trigger the presence status. It’s incredibly versatile—whether you’re watching TV, sleeping, or just want to avoid lights turning on when you move, this component has you covered. One of my favorite features is the Presence Hold switch, which prevents the room from being marked as empty even if motion stops. It’s perfect for those lazy nights when you don’t want to get up to adjust settings!

Setting it up was straightforward. I configured my rooms in the configuration.yaml file, specifying which sensors would trigger occupancy and which would manage the presence hold. The default clear_timeout is set to 5 seconds, but I adjusted it to 30 seconds for my living room to ensure smooth transitions. Here’s a quick example of how I set it up:

yaml
room:
living_room:
name: “Living Room”
presence_sensors:
- binary_sensor.motion_living_room
- media_player.living_room_alexa
- binary_sensor.door_living_room
- binary_sensor.tv_living_room
presence_hold_sensors:
- binary_sensor.tv_living_room
- media_player.living_room_alexa
icon: ‘mdi:sofa’
on_states:
- on
- playing
- home
clear_timeout: 30

I’ve also included the hacs.json file, making installation through HACS a breeze! If you’re interested, you can find the component on GitHub. I’d love to hear how you’re using it or any suggestions you might have!

This project has been a labor of love, and seeing it come together has been incredibly rewarding. I hope it brings the same level of convenience and efficiency to your smart home setup. Let me know if you have any questions or feedback—I’m here to help!

Cheers,
[Your Name]