--- title: Sun description: Instructions on how to track the sun within Home Assistant. ha_category: - Environment ha_release: pre 0.7 ha_quality_scale: internal ha_codeowners: - '@Swamp-Ig' ha_iot_class: Calculated ha_domain: sun --- The sun integration will use your current location to track if the sun is above or below the horizon. The sun can be used within automation as [a trigger with an optional offset to simulate dawn/dusk][sun_trigger] or as [a condition with an optional offset to test if the sun has already set or risen][sun_condition]. [sun_trigger]: /docs/automation/trigger/#sun-trigger [sun_condition]: /docs/scripts/conditions/#sun-condition ## Configuration This integration is by default enabled, unless you've disabled or removed the [`default_config:`](https://www.home-assistant.io/integrations/default_config/) line from your configuration. If that is the case, the following example shows you how to enable this integration manually: ```yaml # Example configuration.yaml entry sun: ``` {% configuration %} elevation: description: "The (physical) elevation of your location, in meters above sea level. Defaults to the `elevation` in `configuration.yaml`, which is retrieved from Google Maps if not set." required: false type: integer {% endconfiguration %}