Schedule integration improvement add referencing, templates and schema's

In the schedule integration:

  • The use of templates in schemas, time ranges, or times.
  • The use of referencing other entities providing a time (e.g., a sun entity, input_datetime or any other entity providing a time that can be used.

these would be tremendously helpful and have been suggested suggested, by Frenck himself on 10 aug 2022.

They would really level up the schedule integration and i would like to vote for this improvent being made :slight_smile:

example of stupid code using this beautiful feature, that is currently not allowed.

tun_hlp_achterdeurlamp_schedule:
  name: "Achterdeur lamp schema"
  monday:
    - from: "05:00:00"
      to: "{{ states('input_datetime.test') }}"
  tuesday:
    - from: "17:00:00"
      to: |
        {% set time = now().time() %}   {% set AanOm = today_at('3:15').time() %}  
        {% set TimeAfterSunriseToTurnOff = timedelta(minutes=30) %}
        {% set SunRise_datetime = as_datetime(as_timestamp(state_attr('sun.sun','next_rising')))%} 
        {% set OffAt =    (SunRise_datetime+TimeAfterSunriseToTurnOff).time() %}  
        {{ OffAt}}
  wednesday:
    - from: "{{(state_attr('sun.sun','next_rising')}}"
      to: "9:00:00"
  thursday:
    - from: "17:00:00"
      to: "21:00:00"
  friday:
    - from: "17:00:00"
      to: "23:00:00"
  saturday:
    - from: "07:00:00"
      to: "10:00:00"
  sunday:
    - from: "07:00:00"
      to: "21:00:00"