Very simple blueprint to turn off light(s) at a certain time

Get started

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: Turn lights off at defined time
  description: Turn lights off at defined time
  domain: automation
  input:
    time_entity:
      name: Time
      selector:
        time:
    light_entity:
      name: Light
      selector:
        target:
          entity:
            domain: light
    transition_time:
      name: Transition
      selector:
        number:
          min: 0
          max: 180
          step: 10
          unit_of_measurement: sec
          mode: slider

trigger:
  platform: time
  at: !input time_entity

action:
  - service: light.turn_off
    target: !input light_entity
    data:
      transition: !input transition_time

1 Like

The name can be a friendly name, it’s allowed to contain spaces. I recommend setting the name to the same as the description.

I did not know, thanks for the info.
I edited the blueprint.

Updated version with transtion time for Hue lights

Whenever you update a blueprint make sure to also update the code block in the original post too, because that’s what gets used when people import your blueprint into their Home Assistant.

I updated the original post

1 Like

This doesn’t show all of my things. When I go by area, it only shows 7 areas and if I pick one and expand it, it does not show all the items in that area. When I try to search by device, it again does not list them all. Entity also does not list all things.

Any idea what I am missing?

Thank you.

1 Like

I think I figured it out. It does not show switches. Any way to modify this to show switches and lights?

Thank you.

1 Like

That depends on the domain of the selector, this blueprint is made for lights.
I have not tested it but maybe you can add multiple domains ?
You can read about it here:
https://www.home-assistant.io/docs/blueprint/selectors/

Currently, you cannot.

There was a recent report of a way to do it but, upon further investigation, it turned out to be a bug and not an undocumented feature. The technique generates warning messages and the selector’s menu doesn’t always list all of the available entities (like I said, more of a bug than an undisclosed feature).

1 Like

i’m struggeling in adapting the blueprint so i can use it to trigger light on at time X/ light off at time Y.

This one is only to turn lights off. So either you edit it to what you want it to do or you create a new one and change the action.

You can create a light entity from a switch using the light.switch integration.

####################################################
#                     LIGHT                        #
####################################################
light:
    # https://www.home-assistant.io/integrations/light.switch
  - platform: switch
    name: Voordeur Lampen
    entity_id: switch.voordeur_lampen
1 Like

Thanks for this, it works great!

1 Like