Presence-based lights


Home Assistant has a built-in integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] called device_sun_light_trigger to help you automate your lights. The integration will:

  • Fade in the lights when the sun is setting and there are people home
  • Turn on the lights when people get home after the sun has set
  • Turn off the lights when all people leave the house

This integration requires the integrations sun, device_tracker, person and light to be enabled.

To enable this integration, add the following lines to your configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI.[Learn more] file. After changing the configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI.[Learn more] file, restart Home Assistant to apply the changes.

# Example configuration.yaml entry
device_sun_light_trigger:

Configuration Variables

light_group string (Optional)

Specify a specific light/group of lights that has to be turned on.

light_profile string (Optional, default: relax)

Specify which light profile to use when turning lights on.

device_group string (Optional)

Specify which group to track. The group can contain device_trackers or persons.

disable_turn_off boolean (Optional, default: false)

Disable lights being turned off when everybody leaves the house.

A full configuration example could look like this:

# Example configuration.yaml entry
device_sun_light_trigger:
  light_group: group.living_room
  light_profile: relax
  device_group: group.my_devices
  disable_turn_off: true