Closed balloob closed 9 years ago
Note, Philips Hue is currently the only light platform that support transitions.
automation:
trigger:
platform: time
after: "07:15:00"
action:
service: light.turn_on
entity_id: light.bedroom
data:
# 900 seconds = 15 minutes
transition: 900
RE: https://github.com/balloob/home-assistant.io/issues/61#issuecomment-141684477
@balloob, I agree - Deleted the future recipe. Will keep this one for verified working recipes.
This recipe will turn on a light when there is motion and turn off the light when ten minutes has passed without any motion events .
automation:
alias: Turn on kitchen lights when there is movement
trigger:
- platform: state
entity_id: sensor.motion_sensor
to: 'on'
action:
service: homeassistant.turn_on
entity_id: script.timed_lamp
script:
timed_lamp:
alias: "Turn on lamp and set timer"
sequence:
# Cancel ev. old timers
- execute_service: script.turn_off
service_data:
entity_id: script.timer_off
- execute_service: light.turn_on
service_data:
entity_id: light.kitchen
# Set new timer
- execute_service: script.turn_on
service_data:
entity_id: script.timer_off
timer_off:
alias: "Turn off lamp after 10 minutes"
sequence:
- delay:
minutes: 10
- execute_service: light.turn_off
service_data:
entity_id: light.kitchen
Last recipe requires PR #403 to be merged to it to work
Turn on lights during daytime when it's dark enough < 200 lux.
automation:
- alias:
trigger:
- platform: numeric_state
entity_id: sensor.sensor_luminance
below: 200
- platform: time
after: "08:00"
before: "23:00"
condition: use_trigger_values
action:
service: homeassistant.turn_on
entity_id: group.basic_lights
automation 2:
- alias:
trigger:
- platform: numeric_state
entity_id: sensor.sensor_luminance
above: 200
- platform: time
after: "23:00"
action:
service: homeassistant.turn_off
entity_id: group.basic_lights
@CCOSTAN this issue is only for recipes that already work, not for feature requests
Rainy Day Light
This requires the forecast.io
component to be loaded and uses the sensor weather_precip
to tell if it's raining.
Turn on a light in the living room when it starts raining, someone is home and it's afternoon or later.
automation:
alias: 'Rainy Day'
trigger:
- platform: state
entity_id: sensor.weather_precip
state: 'rain'
- platform: state
entity_id: group.all_devices
state: 'home'
- platform: time
after: '14:00'
before: '23:00'
condition: use_trigger_values
action:
execute_service: light.turn_on
service_entity_id: light.couch_lamp
And then of course turn off the lamp when it stops raining but only if it's within an hour before sunset.
alias: 'Rain is over'
trigger:
- platform: state
entity_id: sensor.weather_precip
state: 'None'
- platform: sun
event: 'sunset'
offset: '-01:00:00'
condition: use_trigger_values
action:
execute_service: light.turn_off
service_entity_id: light.couch_lamp
Entry way light when you get home
Uses the presence awareness to turn on a house light if it's nighttime but only during reasonable hours'. (to guard against iPhones dropping on/off wifi in the middle of the night)
alias: 'Kitchen Light Helper'
trigger:
- platform: state
entity_id: group.all_devices
state: 'home'
condition:
- platform: state
entity_id: group.all_devices
state: 'home'
- platform: state
entity_id: sun.sun
state: 'below_horizon'
- platform: time
after: '16:00'
before: '00:00'
action:
service: light.turn_on
entity_id: light.fan_bulb_1
Light slow-brightness alarm
This script and trigger produce a sequence of brightness increases 3 minutes apart. This approximates a slowly brightening light alarm. If more divisions are required simply duplicate the last section and iterate the values. Actual results will be far better with ~ 10 divisions.
This awkward method is required since currently there is no way to use "transition" property for wink or bulbs other than hue.
automation:
alias: wakeup alarm trigger
trigger:
- platform: time
after: "07:30"
action:
service: script.turn_on
entity_id: script.wakeup
script:
wakeup:
alias: Wake Up
sequence:
- alias: Bedroom Alarm 1
execute_service: light.turn_on
service_data:
entity_id: light.bedroom
brightness: 10
- delay:
minutes: 3
- alias: Bedroom Alarm 2
execute_service: light.turn_on
service_data:
entity_id: light.bedroom
brightness: 80
- delay:
minutes: 3
- alias: Bedroom Alarm 3
execute_service: light.turn_on
service_data:
entity_id: light.bedroom
brightness: 150
- delay:
minutes: 3
Automatic dim level based on time of day respecting lights that are off This switches the dim level if a light is on when the threshold time is crossed, but also automatically changes the dim level when a light goes from off to on. Importantly, if lights are off, they stay off.
automation 4:
alias: "Set dim level daytime"
trigger:
- platform: time
after: "07:00" #instantaneously at 7am only, not 'after'
- platform: state #implicit OR betwen the two conditions
entity_id: light.kitchen
from: 'off'
to: 'on'
condition:
- platform: state
entity_id: light.kitchen
state: 'on'
- platform: time #implicit AND
after: "07:00"
before: "19:59"
action:
service: light.turn_on
entity_id: light.kitchen
data:
brightness: 255
Hi all, Love HASS!
I wish there's a button that you can activate to trigger an adjustable timer that will kick off based on time selection. Like an alarm clock that trigger a switch at a given time and day. Preferably that can be adjusted via HASS web interface.
For example in my case I can turn on my washing machine automatically via RF 433mhz switch (i loaded the dirty clothes and the detergent the night before I go to sleep) and in the morning when I wake up I switch it on, by the time I have breakfast and coffee, the laundry is done and I just take it out and hang them up. Unfortunately, if I overslept and the button didnt get activated, I will miss the wash.
Cheers!!!
Automation component documentation will be revamped and put front and center in the getting started. I want to include a cookbook with awesome recipes for people to easily copy-paste-adjust. Please post your real life examples here and get some good ones!
For each automation you post, include a title and an optional description if a complex setup. It is okay to include configuration for scripts and scenes too.
I am looking for simple and complex examples!
Example:
Turn on the living room lights 45 minutes before sunset if anyone home