This may or may not be in-depth enough (and I haven’t read the whole thread) - but quick post in case someone finds it helpful - and i can add more detail (if anyone wants)
“Alexa, Set alarm for 6:30am”
I use IFTTT to grab the alarm trigger and send to HA to start gradual lighting sequence (there is minimal IFTTT delay in this instance, but it also maybe possible to use Node-Red-alexa-local to grab the same result.
“Alexa, snooze alarm” or “Alexa, cancel alarm” are the standard OOB responses (however lighting sequence continues)
so I created a custom routine “Alexa, stop the alarm for 15 minutes”
which using Node-Red turns the lights off and waits for the alarm to go off again.
Works for me as i can set the time verbally, and to whatever time I need based on my schedule the next day I also have an echo spot in the Bedroom, but a dot will work just as well.
Do you think I could add voice support easily to this?: Universal Persistent Timer
It can add a timer to anything including multiple scripts, lights etc. with separate start and stop actions, and will resume in the event of downtime and requires no programming skills once installed. All lights, switches etc can be accessed from auto populated lists; and you can specify days of the week, repetitions, intervals, and much more. Timers can be paused, backed up and give activation notifications etc. https://youtu.be/rUeTIU1uAP0
So, because my job isn’t a 9-5 M-F one, I’ve created a variation on this alarm clock that runs my “wake up” script and let’s me choose specific days for it to run - for instance, I may have an 8am shift on Monday and Wednesday that I need it for.
(I haven’t read the whole 3 years of posts on this topic, so I hope I’m not duplicating anything here, but if anyone else needs something similar here it is.)
I’ve added input_booleans for each day of the week, and a sensor that will list which days are “on” in the “minimized” card.
And when I put it on an entity card with the sensors I get this, for an at-a-glance summary of what alarms I have set (I have multiple copies for other days with different wake up times):
You could create a new automation which puts your desired sunset offsets into the input_datetime value for the alarm when selected from an input_select
I am almost a year around in Home Assistan and now i am trying this to work but i cant get it working. I think the problem is that for some reason it doesn’t get inside the activation of the time.
if i execute the automation it does the action that i have program it to do.
my code is
#Inside automations
#Alarm clock
- id: '1560900229648'
alias: Wake 1
trigger:
platform: template
value_template: '{{ states.sensor.time.state == states.sensor.wake_time_1.state
}}'
condition:
condition: or
conditions:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wakestatus_1
state: 'on'
- condition: state
entity_id: input_boolean.wakeweekday_sun_1
state: 'on'
- condition: time
weekday: sun
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wakestatus_1
state: 'on'
- condition: state
entity_id: input_boolean.wakeweekday_mon_1
state: 'on'
- condition: time
weekday: mon
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wakestatus_1
state: 'on'
- condition: state
entity_id: input_boolean.wakeweekday_tue_1
state: 'on'
- condition: time
weekday: tue
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wakestatus_1
state: 'on'
- condition: state
entity_id: input_boolean.wakeweekday_wed_1
state: 'on'
- condition: time
weekday: wed
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wakestatus_1
state: 'on'
- condition: state
entity_id: input_boolean.wakeweekday_thu_1
state: 'on'
- condition: time
weekday: thu
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wakestatus_1
state: 'on'
- condition: state
entity_id: input_boolean.wakeweekday_fri_1
state: 'on'
- condition: time
weekday: fri
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wakestatus_1
state: 'on'
- condition: state
entity_id: input_boolean.wakeweekday_sat_1
state: 'on'
- condition: time
weekday: sat
action:
- data:
entity_id: switch.office_1
service: switch.turn_on
#Inside Sensor
# Wake 1 Sensors
- platform: template
sensors:
wake_hour_1:
friendly_name: 'Wake Hour 1'
value_template: '{{ states("input_number.wakehour_1") | round(0) }}'
wake_minutes_1:
friendly_name: 'Wake Minutes 1'
value_template: '{{ states("input_number.wakeminutes_1") | round(0) }}'
wake_time_1:
friendly_name: 'Wake Time 1'
value_template: '{% if states("sensor.wake_hour_1")|length == 1 %}0{% endif %}{{ states("sensor.wake_hour_1") }}:{% if states("sensor.wake_minutes_1")|length == 1 %}0{% endif %}{{ states("sensor.wake_minutes_1") }}'
wake_time_days_1:
friendly_name: 'Days'
value_template: '{% if states.input_boolean.wakeweekday_sun_1.state == "on" %}Sun {% else %} {% endif %}
{% if states.input_boolean.wakeweekday_mon_1.state == "on" %}Mon {% else %} {% endif %}
{% if states.input_boolean.wakeweekday_tue_1.state == "on" %}Tue {% else %} {% endif %}
{% if states.input_boolean.wakeweekday_wed_1.state == "on" %}Wed {% else %} {% endif %}
{% if states.input_boolean.wakeweekday_thu_1.state == "on" %}Thu {% else %} {% endif %}
{% if states.input_boolean.wakeweekday_fri_1.state == "on" %}Fri {% else %} {% endif %}
{% if states.input_boolean.wakeweekday_sat_1.state == "on" %}Sat {% else %} {% endif %}'
#inside config.yaml
input_boolean:
wakestatus_1:
name: Alarm 1
icon: mdi:alarm
wakeweekday_sun_1:
name: Sunday
icon: mdi:calendar
wakeweekday_mon_1:
name: Monday
icon: mdi:calendar
wakeweekday_tue_1:
name: Tuesday
icon: mdi:calendar
wakeweekday_wed_1:
name: Wednesday
icon: mdi:calendar
wakeweekday_thu_1:
name: Thursday
icon: mdi:calendar
wakeweekday_fri_1:
name: Friday
icon: mdi:calendar
wakeweekday_sat_1:
name: Saturday
icon: mdi:calendar
input_number:
wakehour_1:
name: Hour
min: 00
max: 23
step: 1
icon: mdi:alarm
wakeminutes_1:
name: Minutes
min: 00
max: 59
step: 1
It’s honestly a bit redundant, but it controls whether that alarm will run or not. That way, I can leave the weekday toggles on but turn off the alarm itself if I want, and then turn it back on later for the same days with a single button. With my work schedule, this is a convenient feature.
The automation should work without it, as long as you remove it from the conditionals.