Custom conditional schedules

Hello all,

I’m migrating a custom domotics solution to HA. I’ve managed to use HA to replace almost everything, but I’m now struggling with the following:

I have a schedule picker like this:

image

where we can select 2 timeslots where a plug will be in state ‘on’

what I’m looking for is to implement a card where I can have the same (does not have to be a slider, it can be a normal hour picker ios/android style) and being able to use those values on an automation.

How can this be archieved with HA?

Best Regards.

I guess you’re looking for some scheduler component. Unfortunately - there’s nothing built-in into HA. I was surprised as well as this seems a very basic thing in automation.
I requested a feature and if you’re looking for a native HA scheduler - please vote for it here:

Of course there are various ways to achieve this in HA, but you need to build it yourself or use some solutions like schedy. I like to have control over things from UI, so I built it using input boxes for every day for my thermostat control.
Looks like this:


I uploaded it to github:

My solution is the following:

  1. Create input_numbers as in https://www.home-assistant.io/integrations/input_number/
  2. Create sensors for the input_numbers:
    configuration.yaml
  aut_temp:
    min: 5
    max: 30
    name: Temperature
    icon: mdi:thermometer
  aut_start1:
    min: 0
    max: 23
    step: 1
    name: From
    icon: mdi:timer
  aut_finish1:
    min: 0
    max: 23
    step: 1
    name: Until
    icon: mdi:timer
  aut_start2:
    min: 0
    max: 24
    step: 1
    name: From
    icon: mdi:timer
  aut_finish2:
    min: 0
    max: 23
    step: 1
    name: Until
    icon: mdi:timer

sensor:
 - platform: template
   sensors:
     aut_temp:
        value_template: '{{ states.input_number.aut_temp.state | int }}'
     aut_start1:
        value_template: '{{ states.input_number.aut_start1.state | int }}'
     aut_finish1:
        value_template: '{{ states.input_number.aut_finish1.state | int }}'
     aut_start2:
        value_template: '{{ states.input_number.aut_start2.state | int }}'
     aut_finish2:
        value_template: '{{ states.input_number.aut_finish2.state | int }}'

Then on lovelace I’ve created a entities card with all the input_number:
image

Not quite the same as the original, but it’ll work!
Hope this might be useful to someone.