Scheduler card/custom component

I would like to allow anyone in the house to schedule a light to turn on at a certain time. However, I need to hide my Network Access schedules in a card only I can manage.

I created a duplicate of the card, removed the network access switches, but the Network Access schedules appear on the new card anyway. Is the intention of discoverExisting: false to hide schedules not created by this card? If not, could you add a way to manage multiple schedule cards?

All it does is looks at the switch.schedule entities.
when I posted this, I didnā€™t read the docs for a while, and didnā€™t know what discoverExisting: false was.

Hi Brian,
The idea behind this discoverExisting option was that:

  • if you have previously-created schedules that donā€™t pass the filters of your current configuration (so the entities/domains and actions that you set up for the card)
  • they will show up anyway (both in the overview of current schedules as the available entities/actions for new items) if discoverExisting=true
  • they will not show up in either view if discoverExisting=false

Indeed this should be exactly the kind of functionality you are looking for if you want to split up into multiple scheduler-cards.

However, this is a new addition that i made last morning, and i cannot say it was extensively tested. So perhaps theory and practise may differ here :slight_smile:
Since it is a new addition, could you check if you run latest-greatest version (v1.2.x)?
If the behaviour is different than expected I would like to invite you to create an issue in github and add some background info, so I can reproduce it and follow-up on the issue.
Feature requests are always welcome as well :+1:

According to HACS I have 1.2.1 installed. I have discovered the problem. discoverExisting appears to filter by domain. Removing the switch: section from my domains: section hides my network related schedules. However I would like to leave the switch domain for other switch related schedules. For example: simple on/off switches (my Kitchen Lights), and smart plugs (for my floor/table fans).

Removing the switch: section from the following hides the network switch schedules.

discoverExisting: false
domains:
  .
  .
  switch:
    actions:
      - icon: toggle-switch
        service: turn_on
      - icon: toggle-switch-off-outline
        service: turn_off
    icon: light-switch
entities:
  .
  .
groups:
  .
  .

OK, so removing the default switch: domain hides the network switch schedules. Manually adding my Kitchen light switches to the entities: makes them available.

However, now I am getting two automatically generated groups that were not there before. The two circled in red are unwanted.
Annotation 2020-08-31 114155

I think you should add the entities to the groups. Something like

entities:
  light.thing:
    name: Thing
groups:
  lights:
    name: "Lighting"
    icon: lightbulb
    entities:
      - light.thing
# or
    entities:
      light.thing:

Hmm, here is the code I was using. I was under the impression that domains: section was used to define defaults for a domain of entities (ie. all lights should turn on, turn off, or be set to 60% brightness). Then individual entities could be defined under entities: with any settings that needs to be different than the default defined in domains:.

I am starting to think domains: are only for catch-all groups. Even though they did not act as catch-alls previously.

Sorry about the confusion here.
Using the domains configuration will result in all entities you have in HA of a certain type (domain) to be displayed.
In addition to them being displayed you can also define actions that all should have in common.
Unfortunately, it currently does not work the other way around.
If you want to include only specific entities of a type entities: configuration is the way to go.
Even if all of these need the same actions, you will have to define them one by one.
Perhaps there is room for improvement here :sweat_smile:

1 Like

Is it possible to divide my lights in two groups, All_lights for the light switch All_dimmer for the dimmer light switch. For now I have All_lights group and every lights are in. How can we tell which light goes in each group ?

You can use groups:

Thanks it work, but now I have my lights in one group and my dimmers in another one which is ok. I also have a light group that contain all lights and dimmers and I donā€™t need it. Is there a way to avoid this one ?

No, it will autocreate groups unless you remove them from domains I think.

About translation, is it possible to have a translation to other language. Now for example, week day names are in the code. Would it be possible to switch them to another language via parameter.

want to share what may be a bug, unless iā€™m overlooking something.
Once you create a schedule, if you go back later and change the time, it doesnā€™t change.
It will only respect the originally created time input.

Hi,

So I went to do a fresh install via HACS on my DEV system.

It was working previously.

So I uninstalled both integration and frontend via HACS, tgen removed Configuration/Integration

Made sure both folders were removed under custom_components and www/comunity.

Made sure /hacsfiles/scheduler-card/scheduler-card.js was removed from resources.

Restarted HA.

Reinstalled via HACS Integration & frontend and restarted HA.

Added Integration under configurationā€¦

Went to my home UI and add card.

This is where things start to go wrong.

When I search for the scheduler card it is no longer there.
I then select manual card and add my previous config bu no matter what i put in the manual editor all I get is.

image

I cannot seem to edit it any longer?

Unfortunately a light is a light and there is nothing in place to distinguish dimmable and non-dimmable lamps.
You could ofcourse split your lights into two groups, defining the entities you want for each group.

This is planned for a future update. I hope somewhere this month i can provide this functionality.

If you experience such behaviour there is indeed a bug.
From what i know, in some cases the overview needs a browser refresh to show the updated data.
Changing the time after creation is part of normal editing functionality and should always work (provided you press ā€˜saveā€™ and not ā€˜cancelā€™ ofcourse).
Could you create an issue with more background information if the behaviour persists?
Iā€™m curious if this is a consistent issue or you only see it in particular cases.

I assume you use the UI to configure your views, and not yaml?
If so this issue might be mentioned earlier.
I made an error with my last update, I will correct this somewhere this week when i have the time.
Your config being empty is a completely different issue, even if you leave the configuration empty there should be groups and actions in place.
Maybe you could share your config with us?

With the latest version of everything (installed via HACS) and just the default card config, when I click on Lights on the scheduler-card nothing happens.

This is the error in the console:

scheduler-card.js:186 Uncaught (in promise) TypeError: Cannot read property 'replace' of undefined
    at wt (scheduler-card.js:186)
    at scheduler-card.js:468
    at scheduler-card.js:186
    at scheduler-card.js:186
    at ar (scheduler-card.js:186)
    at scheduler-card.js:186
    at Er (scheduler-card.js:186)
    at Function.ds [as map] (scheduler-card.js:186)
    at HTMLElement.getEntities (scheduler-card.js:465)
    at HTMLElement.render (scheduler-card.js:408)
wt @ scheduler-card.js:186
(anonymous) @ scheduler-card.js:468
(anonymous) @ scheduler-card.js:186
(anonymous) @ scheduler-card.js:186
ar @ scheduler-card.js:186
(anonymous) @ scheduler-card.js:186
Er @ scheduler-card.js:186
ds @ scheduler-card.js:186
getEntities @ scheduler-card.js:465
render @ scheduler-card.js:408
update @ scheduler-card.js:186
performUpdate @ scheduler-card.js:148
_enqueueUpdate @ scheduler-card.js:148
async function (async)
_enqueueUpdate @ scheduler-card.js:148
requestUpdateInternal @ scheduler-card.js:148
requestUpdate @ scheduler-card.js:148
selectGroup @ scheduler-card.js:465
(anonymous) @ scheduler-card.js:461
handleEvent @ scheduler-card.js:82
N.__boundHandleEvent @ scheduler-card.js:82

Code as follows

domains:
  light:
    actions:
      - icon: lightbulb-outline
        service: turn_on
      - icon: lightbulb-off-outline
        service: turn_off
    icon: lightbulb
  switch:
    actions:
      - icon: electric-switch-closed
        service: turn_on
      - icon: electric-switch
        service: turn_off
    icon: electric-switch
type: 'custom:scheduler-card'

Adding card via manual as it is not shown anymoreā€¦

It appears any config returns back the same blank card?

Do you see the switch.scheduler entities in devtools?

Looked like a name was undefined. Make sure you set a valid name for every group and entity.

Always try a hard refresh and a soft refresh.

Here?