Scheduler card/custom component

Great. Will this be installed by HACS as well?

UPDATE: Yes. It gets updated by HACS as well and works perfectly fine for me. Thanks for all your great work!

Thank you! That eliminated the error message and the card is now displayed correctly.

Iā€™m unable to install the custom_component; it doesnā€™t appear in the list of available integrations.

I followed the manual installation instructions: download zip file, extract all files into custom_components/scheduler, restart Home Assistant. I know Home Assistant is aware of the scheduler component because the log reports the boilerplate message about custom components:

You are using a custom integration for scheduler which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.

Using:
Configuration > Integration > +
I typed sched and thereā€™s no matching integration available.

Screenshot from 2020-08-30 15-32-25

I tried installing it on another instance of Home Assistant and got the same result. Thereā€™s nothing in the log beyond the message shown above. What did I do wrong? Alternately, what additional information do you require to help debug this issue?

Try clearing your cache and refreshing.

1 Like

Arrgh! That was it! :man_facepalming:

Thank you!

Ooff, you are very unlucky with all these issues :sweat_smile:
Glad you got it running finally, hopefully you wonā€™t face more disappointments.
Iā€™ll try to keep improving the user experience, but it might take a bit more of your patience :grin:

The manual installation instructions for scheduler-card indicate the following:

Add a reference to the card in the resources section of ui-lovelace.yaml:

resources:
 - url: /local/scheduler-card/scheduler-card.js?v=0
  type: module

However, since version 0.107, the resources section moved to configuration.yaml.

If you put it in ui-lovelace.yaml, you get this warning in the log:

Resources need to be specified in your configuration.yaml. Please see the docs

Very unlucky indeed. Now the scheduler-card is no longer working. :man_shrugging:

The resources are defined in configuration.yaml:
Screenshot from 2020-08-30 16-21-31

Duplicating the same definition in ui-lovelace.yaml (and then restarting) doesnā€™t help Home Assistant find the card (nor does clearing the browser cache). On a positive note, the Scheduler integration is installed:
Screenshot from 2020-08-30 16-22-03

Iā€™ve also had no luck getting the scheduler-card to be found on a second instance of Home Assistant. That one doesnā€™t use Lovelace in YAML mode so I defined the resource in Configuration > Lovelace Dashboards > Resources.

Screenshot from 2020-08-30 16-30-55

If I follow steps 6-9 of BrianHanifinā€™s instructions (posted above) to add a custom card, the search fails to find anything starting with ā€œSchedā€. If I try using Manual to add the card, it also fails to find
- type: custom:scheduler-card


EDIT

I canā€™t be certain if that error message in the screenshot posted above is related to the scheduler card. I tried it again and this time thereā€™s no message in the browser console.

It shows you used
/local/scheduler-card/scheduler-card?v=0
but it wants
/local/scheduler-card/scheduler-card.js?v=0

1 Like

I followed the instructions provided by neliss in this post. I guess that was a typo.

I can confirm that adding .js fixed the problem for the first instance (the one using Lovelace in YAML mode; plus itā€™s entered in configuration.yaml, not ui-lovelace.yaml) and it now displays the scheduler card. As for the second instance, it doesnā€™t quite work the way BrianHanifinā€™s instructions describe. Searching for a Scheduler card produces nothing. I have to select ā€˜Manualā€™ and fill in the type value:

Hopefully, everything that can go wrong has already gone wrong and now itā€™s smooth sailing.

I contributed that ability, when @neliss switched to typescript he forgot to add it back.
Hereā€™s the commit:

@neliss
Just wanted to say thank you for this great component. Iā€™ve been using HA for over 3 years and this simplified functionality is very welcome.

Hello, iā€™m trying to setup a scheduler with a generic thermostat, but it seems to be not well defined.
I setup 2 action with the service climate.set_temperature but whatā€™s wrong ?

domains:
  climate:
    actions:
      - icon: icon-heat
        service: climate_set_temperature
        data_template:
          temperature: '{{ states.input_number.consigne_confort.state }}'
      - icon: icon-off
        service: climate_set_temperature
        data_template:
          temperature: '{{ states.input_number.consigne_eco.state }}'
    icon: thermometer
type: 'custom:scheduler-card'

Maybe you can add an example of thermostat setup in the doc in gitub ?

1 Like

Sorry about the typo, my bad :blush:

Little bit of a positive note about the frustrations: by finding these f*ckups improvement points and sharing these, you are helping with the development of this card/component.
I would like give all of you a good experience setting it up and working with it, but it will take some time to get everything right.

Making the card configurable through UI (no yaml skills required) is on the roadmap, but currently there are more pressing matters. I hope you can work with it in the mean time :wink:

@neliss that would be very helpful. I have 6 generic thermostats (DS18B20 + relay as a thermostat) so finally having a way to replace all the automation with a proper scheduler would be awesome!

Hey there!
Thermostat is not a simple component since (i presume) you want to control it with temperature setpoint instead of on/off.
Best way to do this is indeed to add entities configuration, for example:

entities:
  climate.my_thermostat:
    actions:
      - service: set_temperature
        service_data: { temperature: 10 }
        name: "Set to 10C"
      - service: set_temperature
        service_data: { temperature: 22 }
        "name": "Set to 22C"

The above example is almost identical to the functionality you will get when you define any configuration.
This should give you 2 actions, so you could create a schedule that goes to the high setpoint in the morning, and a second schedule that goes to low setpoint in the evening.

Iā€™m working on a way to enter the temperature value through the card, so you donā€™t have to define these in the configuration. Also it would be nice if you can define multiple actions in a single view/schedule, this is future material :grinning:

PS: templates are not supported at this point, so any attempts with curly brackets and references to other entities will probably result in undesired behaviour.

1 Like

Thank you.
I begin to understand more the configuration.
But , if i well understand, you need to configure temp for each thermostat, as entity is requiered.

Hey,

Iā€™m also using the Scheduler card since a couple of days with a thermostat entity, and solved it like this :

  1. Build a script ( and input boolean ) :
    ( There are also some calculations in the template, but this is due to the ESPhome thermostat ( bang/bang controller ), which require an upper and lower bound ).
floorheating_bathroom_on:
  alias: "Badkamer Vloerverwarming Aan"
  sequence:
  - service: climate.set_temperature
    data_template:
      entity_id: climate.vloerverwarming_badkamer
      target_temp_high: "{{ states.input_number.bathroom_on.state | float + 0.5 | float | round(1, half) }}"    
      target_temp_low: "{{ states.input_number.bathroom_on.state | float - 0.5 | float  | round(1, half) }}"    
  - service: script.turn_off
    data_template:
      entity_id: floorheating_bathroom_on

floorheating_bathroom_off:
  alias: "Badkamer Vloerverwarming Uit"
  sequence:
  - service: climate.set_temperature
    data_template:
      entity_id: climate.vloerverwarming_badkamer
      target_temp_high: "{{ states.input_number.bathroom_off.state | float + 0.5 | float | round(1, half) }}"    
      target_temp_low: "{{ states.input_number.bathroom_off.state | float - 0.5 | float  | round(1, half) }}"    
  - service: script.turn_off
    data_template:
      entity_id: floorheating_bathroom_off     
  1. Trigger the script with the Scheduler card :
entities:
 script.floorheating_bathroom_off:
   actions:
     - service: script.turn_on
 script.floorheating_bathroom_on:
   actions:
     - service: script.turn_on
type: 'custom:scheduler-card'

The scheduler component is working like a charm ;)!

3 Likes

UI parts you could do:

  1. Add your card to the card picker
  2. Prefill the cardā€™s values (done internally, not externally right now)
  3. Make a UI configurator

I think this will be key to wider adoption. The goal is to simplify scheduling via the UI yet, in its current state, it requires the user to pre-select what they wish to expose to the UI via YAML. That impinges on the convenience of having a UI-based scheduler because it involves a YAML-based pre-selection process.

FWIW, my interest in this scheduler is purely academic. Iā€™m comfortable with creating automation-based schedules. However, I do recognize that a UI-based scheduler would be a great convenience to many users. Thatā€™s why I wanted to try this scheduler, to see how it works.

There was an effort to implement a scheduler but it was discontinued. It would have worked with scenes as opposed to directly calling services itself. Thatā€™s how the scheduler works in another home automation software that Iā€™ve used for over a decade. If youā€™re interested, I described its operation to balloob (includes screenshots) in this post: