###################################################################### ## Dark House Little extra light - DARK and Cloudy or just rainy. ###################################################################### - alias: 'Dark House Little extra light' trigger: - platform: numeric_state entity_id: sensor.dark_sky_cloud_coverage above: 90 - platform: state entity_id: sensor.dark_sky_precip to: 'rain' - platform: numeric_state entity_id: sensor.dark_sky_precip_intensity above: 0.2 - platform: state entity_id: group.family to: 'home' from: 'not_home' - platform: state entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed to: 'off' for: "00:10:00" condition: condition: and conditions: - condition: or conditions: - condition: numeric_state entity_id: sensor.dark_sky_cloud_coverage above: 90 - condition: numeric_state entity_id: sensor.dark_sky_precip_intensity above: 0.2 - condition: state entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed state: 'off' - condition: state entity_id: binary_sensor.sleepnumber_carlo_stacey_is_in_bed state: 'off' - condition: state entity_id: sun.sun state: 'above_horizon' - condition: state entity_id: group.family state: 'home' - condition: template # Only run once every ~3 hours tops. value_template: > {%- if states.automation.dark_house_little_extra_light.attributes.last_triggered -%} {{ (as_timestamp(now()) - as_timestamp(states.automation.dark_house_little_extra_light.attributes.last_triggered)) > 10000 }} {%- else -%} true {%- endif -%} action: - service: light.turn_on entity_id: - light.couch_1 - light.sink - service: input_boolean.turn_on entity_id: - input_boolean.daylight_override - service: script.speech_engine data_template: value1: "It is getting a little dark inside the house because of the {{trigger.entity_id.split('_')[2]|replace('precip','rain') }} {{trigger.entity_id.split('_')[3]|replace('intensity',' ')}} outside. I will turn on some extra lights in the living room." call_window_check: 1 call_garage_check: 1 ######################################################################