hvorragend / ha-blueprints

Other
40 stars 8 forks source link

Feature: Add an alarm trigger #135

Closed X3reax closed 3 months ago

X3reax commented 3 months ago

I've added an alarm trigger. At the moment, I'm still testing but it seems to work. This can be helpful, if you have to wake-up at different times every day. I would recommended to use the "sensor.\<phone>_next_alarm" sensor (provided by the Home Assistant app).

It is implemented to have the exact same functionality as the time schedule helper. I also changed service: to action: because this is the newest standard.

I'm not happy with the naming, but I tried to follow the existing names, variables and triggers. I'm also not happy to use a template trigger, because

- platform: time
  at: !input time_alarm_helper

would be the resource friendly version, but this causes the condition

'{{ state_attr(this.entity_id,''current'') | int(99) == 0 }}'

to throw an error. Why does this condition exist?

hvorragend commented 3 months ago

Hello, thank you very much for your commitment. But I have a problem with constantly adding new triggers that don't do anything special.

Why don't you use the Force function for this? This would also make you much more flexible in terms of implementation.

Would that be an approach?

Best regards Carsten

X3reax commented 3 months ago

Hey, I did not use the force function, because I thought "maybe it is 3pm and sun shading is active". With copying the logic of the schedule helper, sun shading would remain the highest priority and therefore the cover would not open. On the other hand, if you want to wake up, direct sun is most likely the best.

I will give the force feature a try and create a template sensor. Otherwise, I can still implement this on my local instance.

Thanks for the great automation.