###################################################################### # @CCOSTAN - Follow Me on X # For more info visit https://www.vcloudinfo.com/click-here # Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig # ------------------------------------------------------------------- # Dark House Little Extra Light - Daytime rain/lightning lighting helper # Turns on living-room lights and announces weather-related reasons. # ------------------------------------------------------------------- # Notes: # Avoid trigger entity string-splitting; map trigger IDs safely. # Lightning may turn on the lights here, but its safety speech is owned by # the Lightning Notification automation to prevent back-to-back briefings. # Kitchen Show illuminance confirms the occupied first floor is actually dim; # weather behavior falls back unchanged if that MQTT sensor is unavailable. ###################################################################### - alias: 'Dark House Little extra light' id: cb94a5bb-7cb3-4e0d-a753-ace01af0bae4 mode: single trigger: - platform: state entity_id: sensor.pirateweather_precip to: 'rain' - platform: numeric_state entity_id: sensor.pirateweather_precip_intensity above: 0.5 - platform: numeric_state entity_id: sensor.blitzortung_lightning_counter above: 1 - platform: numeric_state entity_id: sensor.kitchen_show_ambient_light_2 below: 30 for: "00:05:00" - 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.pirateweather_precip_intensity above: 0.2 - condition: numeric_state entity_id: sensor.blitzortung_lightning_counter above: 1 - condition: template value_template: >- {% set lux = states('sensor.kitchen_show_ambient_light_2') %} {{ lux in ['unknown', 'unavailable', 'none', ''] or lux | float(0) < 35 }} - 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' action: - service: light.turn_on data: entity_id: - light.living_room_lights - light.living_room_accents brightness: 255 color_temp_kelvin: 5500 - choose: - conditions: - condition: template value_template: >- {{ trigger.entity_id | default('') != 'sensor.blitzortung_lightning_counter' }} sequence: - service: script.speech_engine data: value1: >- {% set reason_map = { 'sensor.pirateweather_precip': 'rain', 'sensor.pirateweather_precip_intensity': 'heavy rain', 'sensor.kitchen_show_ambient_light_2': 'rain and clouds', 'group.family': 'rain and clouds', 'binary_sensor.sleepnumber_carlo_carlo_is_in_bed': 'rain and clouds' } %} {% set reason = reason_map.get(trigger.entity_id | default(''), 'weather changes') %} Because of the {{ reason }} outside. I will turn on some extra lights in the living room. call_outside_weather: 1 call_window_check: 1 call_garage_check: 1 - delay: hours: 3 ######################################################################