⚙ Turn Light, Switch, Entity or Scene On & Off with Trigger Conditions

FAQ - Sun Option & Sun Elevation

Why did you use it and how can I set it?

I thought about “Sunset” and “Sunrise” but HA recommend to use sun elevation as it works better throughout the year. So I took their advice and used the sun elevation.

It is really easy to set up. I would recommend checking your sun elevation degrees and adjusting it to your requirements. Every site is different. An easy way to choose your setting is to find or add the sun to your dashboard. When you click on it, a pop-up window will appear or you can just put the sun elevation entity in.

4

Then, one night, simply observe the sunset and note the elevation. Decide on the elevation you’d like to trigger the automation so the lights will turn on. Once you’ve determined your preference, adjust the sun elevation degrees in the blueprint for “Sun Elevation Falling”. Repeat the process for sunrise and enter your settings into “Sun Elevation Rising”

Then, monitor to ensure it’s working correctly and meets your preferences. If adjustments are needed, you can easily make changes as necessary.

Enjoy

Blacky :grinning:

Back to FAQ: Click Here

@HansE

Firstly welcome to the community.

Looks like you would like a lot of different automatons. You can use this blueprint and also have another one called :bulb: Sensor Light

You can also use :calendar: Calendar Notifications & Actions that can do your Christmas automatons and I have a FAQ on how to set it all up that could help. You can also just use the calendar blueprint to toggle ON and OFF your automatons. So you would have a automation for x-mas lights and you toggle it ON and OFF using the start and end actions.

Hope this can help you.

Blacky :smiley:

1 Like

New update 1.8

:warning: Some work is required in this upgrade see below. Only entities are allowed now, don’t update if you would like to still use areas and devices or make a copy of the code to use in another custom blueprint file.

Upgrade Features :new:

  • Light Control:

    • We have now added a option to set the colour temperature of a light.
    • We have now added a option to set the transition of a light and scene.
  • Sun Option: You now have the option to set a rising and falling sun elevation.

Maintenance :toolbox:

  • Set blueprint to my new layout.
  • Clean up some descriptions.

:warning: :stethoscope: STEPS REQUIRED WHEN UPGRADING :white_check_mark:

  1. Just need to clean up some YAML. Once you update and you see nothing selected in light control as shown below then jump to step 2.

    If you see brightness selected as shown below then you are all good and don’t need to do anything hear unless you use the sun option as a trigger then jump to step 5.

  2. Click on the 3 dots and select edit in YAML.

  3. We are looking for the line ‘include_light_control: dont_use_brightness’. If you don’t see it then you are all good nothing more to do if you see it go to step 4.

  4. Delete the line ‘include_light_control: dont_use_brightness’, click save then the 3 dots and select ‘Edit in visual editor’. If you need to make any changes do so, if you use the sun option as a trigger then go to step 5.

  5. Scroll down to the sun option. You will see you have 2 inputs now called ‘Sun Elevation Falling’ and ‘Sun Elevation Rising’. Adjust to your liking.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

I’m a newb to HA and trying use this blueprint to turn on and then off a light in my office. I don’t know what I’m doing wrong. The device I’m using is a TP-Link P135 wall plug with dimming.

alias: Office Light On & Off
description: Scheduled light on and off for workdays
use_blueprint:
  path: Blackshome/entities-on-off-trigger-conditions.yaml
  input:
    light_colour_temperature: 2700
    entity_switch:
      entity_id: switch.office_light
    light_transition_off: 15
    light_transition_on: 0
    after_time: "10:30:00"
    before_time: "10:35:00"
    weekday_options:
      - mon
      - tue
      - wed
      - thu
      - fri
    include_light_control:
      - dont_use_brightness
    include_time: time_enabled
    include_weekdays: weekday_enabled  

@knotfinleyHA

Welcome to the community.

Thanks for providing your YAML.

Everything looks good and I have tested this and it is working. I used version 1.8 but it should work on version 1.7. Note your ‘TP-Link P135 wall plug’ is a switch so the light control will not work on a switch. Maybe this is done internally within the ‘TP-Link P135 wall plug’.

Not sure if you have updated to the new version 1.8 or not but if you have then you can clean up some YAML by removing the code below.

    include_light_control:
      - dont_use_brightness

Here is your full YAML with the code cleaned up for you.

alias: Office Light On & Off
description: Scheduled light on and off for workdays
use_blueprint:
  path: Blackshome/entities-on-off-trigger-conditions.yaml
  input:
    light_colour_temperature: 2700
    entity_switch:
      entity_id: switch.office_light
    light_transition_off: 15
    light_transition_on: 0
    after_time: "10:30:00"
    before_time: "10:35:00"
    weekday_options:
      - mon
      - tue
      - wed
      - thu
      - fri
    include_time: time_enabled
    include_weekdays: weekday_enabled

Blacky :smiley:

Hello Blacky,

I think I found the issue. Using Edge I created Home Assistant webpage as an app so I could pin it to my taskbar and it opens like an app. I have noticed that when updating some items it doesn’t work in app mode. So I opened the HA webpage through the browser and did the update there and it worked. I also copied your version of yaml but don’t think that was the problem.

Thanks for your help and the blueprint.
Thanks for the help.

@knotfinleyHA

Nice one and thanks for letting the community know and for getting back to me :+1:

Your welcome

Enjoy

Blacky :smiley: