Closet Door Light On Off

Automatically turn a light on when a door opens and off when it closes — perfect for small closets, cabinets, or 3D printer enclosures.



:inbox_tray: Import Blueprint

Import Blueprint


:wrench: Description

This blueprint links a binary door sensor to a light entity. When the door is opened, the light turns on. When the door is closed, the light turns off.


:technologist: How It Was Made

I created this blueprint with the help of ChatGPT, which guided me step by step — from writing the YAML code to publishing it on GitHub and formatting this post. It’s a great tool for learning and creating useful automations, even if you’re new to YAML or GitHub.


:package: Requirements

  • A binary_sensor with device_class: door
  • A light entity (e.g., smart bulb, LED strip)

:control_knobs: Inputs

  • Door Sensor – The binary sensor on your closet/cabinet door
  • Closet Light – The light to control when the door is opened/closed

I know it’s your first post and all, but maybe ChatGPT should have told you identical Blueprints already exist. These are the first 3 I found in less than a minute:

1 Like

Thanks for the “Help” i did search for one but for some reason every single one used a timer to turn the light off, i just wanted the light to go off when i close the door, kind of like a fridge door.

You’re"welcome".

Didn’t check the others, but the closet one only uses that timer in case you leave the door open (like stuffing in so many clothes that the door sensor can’t detect a closed state). It switches off the light immediately when the doors are closed, irrespective of the timer.

It’s a pretty handy feature tbh - you don’t want the light to stay on all night if the door isn’t actually closed

2 Likes