Scheduler card/custom component

Working great!

Using v1.2.4, and this configuration:

Click to reveal
    cards:
      - type: custom:scheduler-card
        groups:
          all_lights:
            domains: [light]
          my_lights:
            entities: [light.hallway, light.guest_bathroom_vanity]
        domains:
          light:
            actions:
              - service: turn_on
              - service: turn_off
        entities:
          switch.pool_pump:
            actions:
              - service: turn_on
              - service: turn_off
          light.hallway:
            actions:
              - service: turn_on
                service_data: {brightness_pct: 35}
              - service: turn_off

The Hallway light gets two TURN ON buttons.

Screenshot from 2020-09-03 16-09-16

One of the TURN ON buttons represents this domain-wide setting here:

        domains:
          light:
            actions:
              - service: turn_on
              - service: turn_off

The other button is probably due to the entity-specific setting here:

          light.hallway:
            actions:
              - service: turn_on
                service_data: {brightness_pct: 35}
              - service: turn_off

Shouldn’t the entity-specific setting for TURN ON supersede the domain-wide setting so only one TURN ON button is rendered?

Alternately, provide some means of indicating the difference between the two seemingly identical buttons?

  1. No, because you might want to have multiple choices (turn on to 50%, turn on to dim red, turn on at 100% warm white).
  2. You can specify:
          light.hallway:
            actions:
              - service: turn_on
                service_data: {brightness_pct: 35}
                name: Dim on
                icon: lightbulb-multiple-outline
              - service: turn_off
                icon: lightbulb-multiple-off
1 Like

Thank you! Works as described.

Screenshot from 2020-09-03 16-22-43

I’m still in English. My setting if french and my country is Canada. Should it be CF (Canadian french) instead of FR (french) ?

Hey, by the way, mind adding an exclude option to the entity options @neliss? That way instead of specifying all entities, you can just specify one or two to exclude. Thanks for all of the work!

The card checks for the setting in your user profile.
Canadian (or canadian french) is not listed here as language, so this should not be the problem.
Please check your setting here:


After a refresh of your browser the card should look like this:
Capture2
If it doesn’t, the problem is likely due to caching.
Please check if you are running the correct version in the console log of your browser (under developer tools):
Capture3
If not, you can try a force browser refresh (using ctrl+shift+r) or update to ?v=1.2.4 in ui-lovelace (assuming you are running yaml mode).

If all doesn’t help we need to have a closer look…

With release v1.2.5 comes the option to apply filtering to domains.

Examples:

Scenario 1:
“I have a lot of lights in my house, but i only want to control some of them with the scheduler.”
– Use the include option to specify which lights you want to add:

domain:
  light:
    include:
      - light.my_light_1
      - light.my_light_2
      - light.my_light_3
    # rest of domain config (actions, icon, ...)

Scenario 2:
“I have a lot of lights in my house, but i only want to control all but some of them with the scheduler.”
– Use the exclude option to specify which lights you want to be ignored:

domain:
  light:
    exclude:
      - light.my_light_that_i_never_use
    # rest of domain config (actions, icon, ...)

Remarks:

  • Ofcourse the domain config is only practical if you want to apply the same actions to multiple entities, else entities config is still the way to go
  • Don’t try to mix include and exclude in a single domain, if you do this you didn’t understand the concept :wink:
  • This feature works on top of the standard configuration, so you could use the above examples for entity filtering only, while maintaining the predefined actions.
3 Likes

This would be AWESOME!!!
Having an easy way to set the temperature on specific hours is the part I miss the most in Home Assistant. Now I use automation, but I must do all the changes. I don’t even want to try to show my wife how “easy” it is right now. With your card, even a 5yo will be able to do the changes.
Maybe someday your card will be added to the core :crossed_fingers:

WOW! This drastically simplifies the config needed. Thank you!

This is so much shorter and to the point! :partying_face:

domains:
  switch:
    actions:
      - service: turn_on
        icon: network
      - service: turn_off
        icon: network-off-outline
    include:
      - switch.network_blackpc
      - switch.network_bluepc
      - switch.network_bluepc_2
      - switch.network_redpc
      - switch.network_redpc_2
      - switch.network_nintendo_switch
groups:
  computers:
    entities:
      - switch.network_blackpc
      - switch.network_bluepc
      - switch.network_bluepc_2
      - switch.network_redpc
      - switch.network_redpc_2
      - switch.network_nintendo_switch
    icon: network
    name: Computers + Devices
type: 'custom:scheduler-card'

You’re very welcome.
More exiting updates coming soon :partying_face:

FWIW, you could clean up your config a little bit more by mapping the switch domain to your group:

groups:
  computers:
    domains: [switch]
    icon: network
    name: Computers + Devices

I guess i should update the github readme a bit, so people don’t have to figure this out themselves :slight_smile:

1 Like

Are multiple cards supported?

Could I have a scheduler card in my heating and climate view and another scheduler card in my irrigation view?

Yes, split setup is supported.
I recommend you to set:

  • standardConfiguration:false so you don’t have the default config that will cause all your lights/switches/climates to show up in both cards

  • discoverExisting:false so the cards will not load all your running schedules, but only the ones for the entities/domains that are defined in the config of either card

1 Like

I’ve been waiting for this feature for so long!

By the way, you can add this to manually created light actions like this:

variables:
  field: brightness

Another thing that you could add could be glob/regex matching to include and exclude.
And of course, whenever you’re ready, to add RGB choosing.

1 Like

Yup, with v1.2.6 comes a brand new feature which I called “action variables”.
It was a VERY needed addition, since one of the main uses for this card is ofcourse thermostat control.

As part of the standard configuration, you can now define the temperature setpoint for your climate entities, as well as set the brightness for your lamps :partying_face:

I updated the readme a bit, hoping that everyone can make sense of it all.

1 Like

Using this:

        domains:
          climate:
            actions:
              - service: climate.set_temperature
                name: "Set Temperature"
                variable:
                  field: temperature
                  name: "Temperature"
                  min: 19
                  max: 24
                  step: 0.5

I can set a thermostat’s setpoint temperature. The final screen before saving the new schedule looks like this:

After saving it, it presents this:
Screenshot from 2020-09-05 10-47-59

I have to refresh the browser page for it to display this:
Screenshot from 2020-09-05 10-48-12

That’s different from when I schedule most anything else which, after saving, instantly displays the newly created schedule and doesn’t require a manual page-refresh.


In addition, sometimes I get duplicated actions displayed in the UI, like this (notice that the icons are different):

Screenshot from 2020-09-05 10-55-50

I noticed that the lefthand button proceeds to offer changing the temperature whereas the righthand button does not:
Screenshot from 2020-09-05 10-59-30

Refreshing the browser’s cache eliminates the righthand ‘Set temperature’ button. It re-appears after scheduling the thermostat at least once.

1 Like

Okay. So first of all, it’s not showing the “No items added” message. Can you send a screenshot of the elements tab in the browser devtools when you inspect the empty area?
Second of all, that means they’re different. Probably the one you made is conflicting with the default config. Try standardConfiguration: false.
Also, if you create one with the one on the right, what are the attributes for the switch.scheduler in home assistant’s developer tools?

Thanks for letting me know. I see that the discoverExisting property is related.
I can reproduce your problem, so I will let you know when I have a fix.

1 Like

I’m not certain if this is what you want:

Not following you here. The only climate-related config is the one shown in my post above.

After creating two climate schedules, the third attempt produces this screen with three buttons.
Screenshot from 2020-09-05 11-08-46

I used the rightmost button to create a third schedule. It appears as the last entry in this States view screenshot (it has a temperature value but I didn’t set it in the UI because the UI doesn’t display a slider).

Ahh, I get it now. Looks like it created a new entry for your previous entries. Sorry I was confused…