Scheduler card/custom component

This is really weird, hard for me to see from here what is causing this.
Lines 1-10 only include references to external dependencies, and in case something is wrong in these files you would get a different error message.
Also this "<" is barely used at all in the code, so it provides little information.

The good news is that i’m preparing an update that gets rid of external file dependencies. Perhaps with this version, your problems will be gone.
I expect to be able to release this somewhere over the weekend, so maybe its best to just give it a try in a few days.

1 Like

@neliss It seems I do not even have a ui-lovelace.yaml file. Where is this supposed to be in HAOS?

I think @neliss uses YAML mode, you should look under config > dashboards > resources.

I don’t even have a /hacsfiles directory…

What should be in /root/config/custom-components/scheduler after (re-)install via HACS?
I get

➜  ls -l /root/config/custom_components/scheduler
total 48
-rw-r--r--    1 root     root          3654 Aug 28 22:07 __init__.py
drwxr-xr-x    2 root     root          4096 Aug 28 22:26 __pycache__
-rw-r--r--    1 root     root           695 Aug 28 22:07 config_flow.py
-rw-r--r--    1 root     root          2050 Aug 28 22:07 const.py
-rw-r--r--    1 root     root          6817 Aug 28 22:07 datacollection.py
-rw-r--r--    1 root     root          2963 Aug 28 22:07 helpers.py
-rw-r--r--    1 root     root           321 Aug 28 22:07 manifest.json
-rw-r--r--    1 root     root          1678 Aug 28 22:07 services.yaml
-rw-r--r--    1 root     root          9945 Aug 28 22:07 switch.py

Yes, it was automatic for me. For me it’s /hacsfiles/scheduler-card/scheduler-card.js.

As promised, I released an update of the card today.
Could you try to download the latest version from here?
All code is now in a single file without external references, so chances are that it solves your problem.

You can place the js file in www/scheduler-card/scheduler-card.js (no /dist/ needed).

In the resources section of ui-lovelace, you should add:

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

This should solve your “custom element doesn’t exist” error.

1 Like

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: