Sunset completely wrong

How is sunset and sunrise calculated? I have an issue where sunset automations are being triggered at 1500 when they should only be happening at 2200. sun.sun has the current state:

next_dawn: '2020-07-23T01:41:55+00:00'
next_dusk: '2020-07-22T14:29:57+00:00'
next_midnight: '2020-07-22T20:05:58+00:00'
next_noon: '2020-07-23T08:05:57+00:00'
next_rising: '2020-07-23T02:03:55+00:00'
next_setting: '2020-07-22T14:07:55+00:00'
elevation: 0.53
azimuth: 289.99
rising: false
friendly_name: Sun

But should be coming up as follows:
Screenshot from 2020-07-22 15-06-20

I’ve checked my home coordinates and they appear to be fine. Here’s the relevant config:

homeassistant:
  name: ***snip***
  longitude: ***snip***
  latitude: ***snip***
  elevation: 25
  unit_system: metric
  time_zone: Europe/London
  customize: !include customize.yaml

You have lat and long reversed…

EDIT: I took londons lat and longitude, reversed them and got your numbers. Your lat should be around 50.5, your lon should be around 0.12.

1 Like

Thanks, can’t believe I didn’t notice that!

Also, double check your elevation as it plays into some of the calculations. If elevation is not set, it will pull the value using your lat/lon from google maps.