Not so much a feature request as a poll for interest.
I looked at Creating an alarm clock ! updated but decided I wanted more; so I created a custom component. I’m planning on adding more functionality but if it’s something people would like, I’d be happy to send a pull request.
On top of the basic functionality (enable/disable the alarm; pick the time; trigger a light, a group or a scene when the alarm goes off) it supports an “additional” timer that can go off before / after the main one.
A typical use case: I want my alarm to play at 7am; but 15 minutes I want my Hue lights to start a “sunrise” transition that slowly turns them on. I could do that by setting up an extra automation at 6:45am, but then what if tomorrow I need to wake up 20 minutes earlier? I’d need to change both.
Future plans:
some kind of integration with the workday component;
log explicitly to logbook;
the component should probably create its own sensors instead of expecting the use to do so;
I currently support one “additional” timer before/after the main one; it might useful to generalize that to more;
To give you an example, this is what I currently have in my config:
Looks good, may I suggest a snooze button configurable by extra mins and number of times you can repeat said extra mins It sure would make my automations a bit smaller
@andreacampi I want to follow up the discussion here. I think this is more an use-case than a component. What we really need I think is to have templates for day/time values. In my point of view it would be a better solution if we can pass day/time parameters in a script component instance.
Then you can configure that script by input components and scenes/scripts.
@tringler sorry for the late reply, I had a busy week at work + needed to fix my code that’s going into 0.60
I understand your point of view but really, the canonical Creating an alarm clock ! updated thread and the original post clearly show how creating a full featured alarm clock is far from trivial. It may be obvious (if tedious) for experienced people or developers, but it’s daunting to noobs.
Yet this is basic functionality that seems to be pretty popular!
To some extent this is not dissimilar from e.g. the device_sun_light_trigger: it may be only a convenience “virtual” component, but it makes it so much easier to get started.
To be honest: I’m gonna keep using this as a custom component and publish it on Github. I’m porting it onto the master tree simply because that’s the only realistic way of writing unit tests today. As a side effect that also lets me send a pull request; if it’s not accepted it’s not accepted, I won’t be slighted but I hope it will as I think it would benefit others.
EDIT I didn’t mean to sound like an ass with the last paragraph. What I really wanted to say is: I’m doing it regardless and then we can discuss on the diff; code speaks louder than words.
Don’t worry, It’s just my personal opinion, that instead of adding more and more platforms for different use-cases, we should take care of using the script component, which is a very powerful tool, but complicated for beginners. At the end this decision must be made by HASS dev core team and you are right then we need to refactor/elimate a lot of other components, which have the same approach.
I can imagine that as a long-term solution we would have a script editor, which has templates for use-cases. In example on the script editor you choose the template alarm clock compinent, defining your needs and the script editor is generating the script.
I’m pretty sure, that the PR will be accepted and your work is highly appreciated.
@tringler another thing that I can see long-term is a “marketplace” of packages such that you can download and install solutions to your needs. That would be neat
I’m totally new to home assistant, installed it yesterday. Not new to python etc.
What I need is something similar that I probably can build from your module.
I need to set a time when I plan to leave for work, which varies. Based on that time and outside temperature the car heater shall turn on the appropriate time before. .
@Flurken Not sure if this helps, but I created an ideal time to leave based on my google calendar and the current traffic. You could subtract 10 minutes from this and add a script to turn on your car if the temp is below a certain threshold
Hi. I have a newbie question, just learning home assistant and not yet friend
with the configuration. Got a alarm working with sliders for time setting.
However… It’s not clear to me how to have multiple alarms with separate controls, how do I do that? As I understand the root element alarm_clock: can only appear once, right?
Where can I read on how to do eval like things in configuration, like…
time: foo * 3
How can I cast stuff?
Works fine to have the additional time as seconds, but having a input_select does not work.
Fun, but still a bit confusing. At least the car was warm this morning.
Thanks in advance.
//Peter