--- layout: component title: "Sun" description: "Instructions how to track the sun within Home Assistant." date: 2015-01-24 14:39 sidebar: true comments: false sharing: true footer: true ha_category: Weather --- The `sun` component 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][automation-trigger]. [automation-trigger]: /components/automation.html#sun-trigger ```yaml # Example configuration.yaml entry homeassistant: latitude: 32.87336 longitude: -117.22743 sun: elevation: 123 ``` Configuration variables: - **elevation** (*Optional*): The solar elevation angle is the altitude of the sun. If ommitted will be retrieved from Google Maps.