πŸ”† Smart Light - Entity - Sun Elevation - Ambient & Time Triggers

@Ltek

If for some reason you would like both option of the sensor light and smart light blueprint then you would use the sensor light blueprint.

Looking at the smart light blueprint the triggers are:

State: Just use the entity.
Sun or Ambient: Template binary sensor (see below).
Time: With the schedule helper, you have more flexibility than simply setting the light to turn ON or OFF at a specific time every day. It provides you with greater control and customization for your lighting schedule.

Code below for your template binary sensors:

To create a Template binary sensor, follow these steps:

  1. Navigate to Settings > Device & Services > Helpers tab at the top.
  2. Click the Create helper button.
  3. Select Template and then choose Template a binary sensor.

Next, provide a Name and Device class of your choice. If applicable, you can link this template to an existing device so it appears under that device’s details.

In the State template field choose your code below,

Sun Code
{{ (((is_state_attr('sun.sun', 'rising', false)) 
   and (state_attr('sun.sun', 'elevation') < -1.5))) 
   or (((is_state_attr('sun.sun', 'rising', true)) 
   and (state_attr('sun.sun', 'elevation') < -4.0))) }}
Ambient Code

This one is a bit trick as you need to create the template binary sensor first and then enter in the entity ID into binary_sensor.this_binary_sensor_id

{% set lux = states('sensor.your_lux_sensor') | float(0) %}
{% if lux < 100 %}
  true
{% elif lux > 200 %}
  false
{% else %}
  {{ is_state('binary_sensor.this_binary_sensor_id', 'on') }}
{% endif %}

Then if you wanted to use a motion sensor with one of the fixed triggers you would group your motion sensor and / or the entity state, a schedule helper or template binary sensor you created. Now you have fixed triggers and a dynamic trigger in one entity (your group). You then use this group in the sensor light trigger or just use the fixed trigger.

Blacky :smiley: