added an Alert mode to keep the monthly scene from kicking in and keeping the house lights white.

This commit is contained in:
CCOSTAN
2017-02-03 01:59:29 +00:00
parent d3119251db
commit 0b3f018992
5 changed files with 22 additions and 9 deletions

View File

@@ -2,7 +2,7 @@
### Detect when lights are turned on and adjust them accordingly based on time. ### Detect when lights are turned on and adjust them accordingly based on time.
### Code by @JesseWebDotCom ### Code by @JesseWebDotCom
############################################################################## ##############################################################################
- alias: detect_light_between 5am and 8am - alias: detect lights and adjust the brightness when turned on based on time.
trigger: trigger:
- platform: event - platform: event
event_type: state_changed event_type: state_changed
@@ -10,7 +10,10 @@
condition: condition:
- condition: state - condition: state
entity_id: group.family entity_id: group.family
state: home state: 'home'
- condition: state
entity_id: input_boolean.alert_mode
state: 'off'
- condition: template - condition: template
value_template: "{{ trigger.event.data is not none }}" value_template: "{{ trigger.event.data is not none }}"
- condition: template - condition: template
@@ -41,6 +44,6 @@
{%- elif hour >= 20 or hour <24 -%} {%- elif hour >= 20 or hour <24 -%}
40 40
{%- else -%} {%- else -%}
20 15
{%- endif %} {%- endif %}

View File

@@ -26,9 +26,9 @@ input_boolean.pill_reminder:
emulated_hue: False emulated_hue: False
hidden: False hidden: False
input_boolean.trash_reminder: alert_mode:
friendly_name: 'Trash Day Reminder' friendly_name: Alert Mode
icon: mdi:delete icon: mdi:alert-octagram
emulated_hue: False emulated_hue: False
hidden: False hidden: False

View File

@@ -8,9 +8,9 @@ school_mode:
icon: mdi:school icon: mdi:school
initial: on initial: on
trash_reminder: alert_mode:
name: Trash Day Reminder name: Alert Mode
icon: mdi:delete icon: mdi:alert-octagram
initial: off initial: off
pill_reminder: pill_reminder:

View File

@@ -15,8 +15,15 @@ front_house_motion:
- condition: state - condition: state
entity_id: sun.sun entity_id: sun.sun
state: 'below_horizon' state: 'below_horizon'
- service: input_boolean.turn_on
data:
entity_id: input_boolean.alert_mode
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.front_full_brightness entity_id: scene.front_full_brightness
- service: input_boolean.turn_off
data:
entity_id: input_boolean.alert_mode
- delay: '00:{{ (range(5, 20)|random|int) }}:00' - delay: '00:{{ (range(5, 20)|random|int) }}:00'
- service: light.turn_off - service: light.turn_off
entity_id: group.outdoor_front_lights entity_id: group.outdoor_front_lights

View File

@@ -11,6 +11,9 @@ monthly_front_house_scene:
- condition: state - condition: state
entity_id: sun.sun entity_id: sun.sun
state: 'below_horizon' state: 'below_horizon'
- condition: state
entity_id: input_boolean.alert_mode
state: 'off'
- service: logbook.log - service: logbook.log
data_template: data_template: