Scheduler card/custom component

Is there a way to figure out the schedule after it’s been set? E.g, I would like to know for how long a specific device is scheduled to be on (or simply read when the state transitions would happen for a specific device.

Thanks for all the support.

Hi

I installed the scheduler, however I get an error on next boot of home assistant:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/config_entries.py", line 228, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/home/homeassistant/.homeassistant/custom_components/scheduler/__init__.py", line 28, in async_setup_entry
    coordinator = SchedulerCoordinator(hass, session, entry)
  File "/home/homeassistant/.homeassistant/custom_components/scheduler/__init__.py", line 91, in __init__
    self.update_sun_data()
  File "/home/homeassistant/.homeassistant/custom_components/scheduler/__init__.py", line 95, in update_sun_data
    self.sun_data["sunrise"] = sun_state.attributes["next_rising"]
AttributeError: 'NoneType' object has no attribute 'attributes'

I hope you can help me solve it. As I’m very interested in using the scheduler

It’s a simple problem: this integration requires you to have the sun integration installed.
It takes the sunrise/sunset times from it.

Indeed, with the sun integration installed. It works indeed.
Maybe interesting to build in als test and check that it is installed?

I actually planned on making it an optional feature. Since not everyone is interested in programming sunrise-dependent timers. But I didn’t have the time yet to implement it.
For the time being maybe better to mark it as dependency indeed :slightly_smiling_face:

1 Like

As promised, a new update of the card is available :tada:

Version v1.5.0 comes with quite some changes.
Most of which are under the hood, so you are not supposed to notice much difference.

Most importantly, the standard configuration is drastically improved.
You all should start using it (or give me a valid reason why you don’t :slight_smile:)

Here are the highlights:

Support for more device types
Up to now, the standard configuration was only there to help you out with light, cover, climate, switch and fan entities.

Today I am adding (on request) script, scene, vacuum, media_player, input_boolean, input_number and input_select to this list. For each type I defined some actions of which i though could be meaningful to set up with scheduler. Let me know if you miss anything, because the list is not complete yet.

I made it a lot easier to add (and hide) domains. It is a matter of writing a list.

Improved action parameters
The card will now check the capabilities of your devices and will define appropriate actions for it. For example the card will detect min/max temperature setpoint supported for your thermostat setpoint, as well as the unit (Celsius or Fahrenheit).
If your thermostat has multiple operation modes (e.g. cooling and heating), these modes will be detected as well. And you can now change it through a schedule. For doing that i made something new:

List variables
A new addition is the ability to pick an option from a list, and have it automatically passed as service_data in the action.
It is pretty similar to the slider that appears for choosing a temperature or brightness level. This one is specifically made for working with lists.
Example:

3 Likes

Vacuum not showing?


image

I saw you needed to manually enable it.
Also another bug:
image

In the 1.5 I think there is a problem between the cards…

If on a second card I put

domains:
  climate: false
  cover: false
  fan: false
  switch: true
  light: false

The first card that just
type: 'custom:scheduler-card'.
Only has access to SWITCHES and DISCOVERED
image

Try a hard refresh ([Ctrl/Command]+Shift+r) and try again?

Done… same problem


domains: Lost actions…


domain: = fail

domain
domains

Also don’t try to customize it, just do

domains:
  climate:

OK, but the doc :slight_smile:image

Fix PR incoming…

If you have discovered group showing up, means that you have an error in your configuration.
You should open the group and see which entities are there.
Make sure they are included in your configuration.

If you have your schedules divided in multiple cards, then this is intentionally.
Add discover_existing:false to the card to disable the discovery.

The primary card have only : type: ‘custom:scheduler-card’

And which entities are in the discovered group?

Okay, I’m starting to understand. When you use several cards you have to specify at least one domain to true.

This was a copy-paste error. Causes sunrise to show up fine, sunset to show up wrong.
I will release a fix.