Wake up light alarm

Hello guys,

I’m trying to create an automation to wake me up with light transition.
I’ve readed this post :

And this article:

I would like a mix between this two codes

It could be nice to :

  • add a “light transition time” in lovelace card
  • create a new sensor "wakeup time which show “alarm time” - “light transition time”
  • use wakeup time like automation start
  • use “light transition time” in script in place of fixed value

Configuration.yaml

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensors.yaml

#Reveil
input_boolean :
  wakeup_enabled:
    name: "Reveil lumineux"
    initial: on
    icon: mdi:theme-light-dark
  wakeup_weekend:
    name: "Activer reveil le week-end"
    initial: off # I disable the system on default on weekends
    icon: mdi:calendar-blank

input_datetime:
  wakeup_time:
    name: "Heure du reveil"
    has_time: true
    has_date: false
    initial: "07:20"

  wakeup_duration:
    name: "Duree du reveil"
    has_time: true
    has_date: false
    initial: "0:15"

Sensors.yaml

- platform: time_date

Automations.yaml

- alias: "Me reveiller dans la chambre avec transition lumineuse"
  trigger:
    platform: template
    value_template: "{{ states('sensor.time') == (states.input_datetime.wakeup_time.attributes.timestamp | int | timestamp_custom('%H:%M', False)) }}"
  condition:
    - condition: state
      entity_id: input_boolean.wakeup_enabled
      state: 'on'
    - condition: or
      conditions:
        - condition: state
          entity_id: input_boolean.wakeup_weekend
          state: 'on'
        - condition: time
          weekday:
            - mon
            - tue
            - wed
            - thu
            - fri
  action:
    - service: script.wakeup_bedroom

Scripts.yaml

  wakeup_bedroom:
    alias: 'Wakeup lighting, smooth transition'
    sequence:
      - service: light.turn_on
        data_template:
          entity_id: light.plafonnier_chambre
          brightness: 1
          kelvin: 1500
      - service: light.turn_on
        data_template:
          entity_id: light.plafonnier_chambre
          brightness: 255
          kelvin: 5000
          transition: '30'

Maybe could you help me to modify my configuration files to get this requests.
I’m learning yaml files but need some more informations to get this work.

Thanks for all.

2 Likes

I appreciate your post. I am just looking into doing something like this. I also ran across this in the node red library.

https://flows-new.nodered.org/node/node-red-contrib-time-based-dimmer

Also check out this YouTube on how you can integrate your Google Calendar to tell your lights when to wake you up.