hI, how do i configure the card to turn the lights on or off at sunrise or sunset?
Thanks
Check the box to automatically adapt to sunrise/sunset, and then enter in the sunrise time or the sunset time according to HA. If itâs a bit before or after, itâll turn off the lights before or after.
For the scheduler card, add it as a plugin/lovelace. For the scheduler component, add it as a component/integration.
I was skeptical. I set it up initially just to try the schedule options out.
Iâm really liking the ability to customize the groups and entities. I just setup switches to disable network access for my boys gaming PCs Sunday at midnight, and enable the network at noon on Friday. It is a lot easier than remembering to hide their power plugs every week.
I tried a few times but the card doesnât install. Any way to install it separately using HACS?
What do you mean?
I added it to the list of custom repos, clicked install âScheduler componentâ but I still get âCustom element doesnât exist: scheduler-cardâ when I try to add the card to a Lovelace dashboard.
I clicked âReinstallâ but stlll get the same error message.
Odd, I donât get that error. Is it listed in your resources?
I appear to be experiencing the same problem.
Requisite files are present:
Resource present in ui-lovelace.yaml
resources:
- url: /local/scheduler-card/dist/scheduler-card.js?v=0
type: module
No amount of browser refreshes or Home Assistant restarts fixes this:
What do you see in the browser console?
Uncaught SyntaxError: expected expression, got â<â
All three files Iâm currently using were downloaded (using wget
) from here this evening:
scheduler-card/dist at main ¡ nielsfaber/scheduler-card ¡ GitHub
EDIT
The link in the error message (scheduler-card.js) leads to the generated HTML. I pasted it into VS Code and it didnât identify any HTML syntax errors. I donât know if thatâs meaningful but I thought Iâd mention it.
Could you take a quick look in the ui-lovelace.yaml
under resources:
if there is a reference to the scheduler-card
directory. If so, can you also check if the files are there?
If this is all in place, then this is not related to HACS.
Currently there is no configuration check in place (my bad), so if you make a typo in the entities definition (or whatsoever) you will also get the same message. Perhaps the issue is caused there?
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.
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.