Hi all.
After upgrading to v0.73 HA is complaining that the sun component cannot be set up. According to the release-notes there hasn’t been any change in the sun component and I haven’t changed my configuration.yaml regarding this component either (it just says: sun:).
The log says:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 143, in _async_setup_component
hass, processed_config)
File "/usr/lib/python3.5/asyncio/coroutines.py", line 210, in coro
res = func(*args, **kw)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sun.py", line 47, in async_setup
sun = Sun(hass, get_astral_location(hass))
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/sun.py", line 28, in get_astral_location
hass.data[DATA_LOCATION_CACHE][info] = Location(info)
File "/srv/homeassistant/lib/python3.5/site-packages/astral.py", line 575, in __init__
self.latitude = info[2]
File "/srv/homeassistant/lib/python3.5/site-packages/astral.py", line 620, in latitude
self._latitude = float(latitude)
TypeError: float() argument must be a string or a number, not 'NoneType'
For all I know the sun component hasn’t any additional mandatory parameters to set, has it?
Anybody experiencing the same issue?
Btw: I’m running HA on my raspberry 3B+.
Thx for any advice.
Raymond.
Yes, you’re right about that @Tinkerer. Thing is that I did not had a longitude and latitude element in the homeassistant: part in the config, only in the zone: part. HA did not complain about that in the previous versions. Just added this and now it works.
Thanks for the reply!
I am having issues with this as well. It seems on the last update my time zone setting went screwy. I changed them using raspi-config, after which I lost my sun component. Here are the logs
2018-08-20 10:54:03 ERROR (MainThread) [homeassistant.setup] Error during setup of component sun
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sun.py", line 47, in async_setup
sun = Sun(hass, get_astral_location(hass))
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/sun.py", line 19, in get_astral_location
Hi I am having similar problems, I can not setup sun component due python astral is looking for Africa/Lagos, but the configuration file indicates my correct lat and long:
latitude: 22.140829
longitude: -101.007534
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 0
# metric for Metric, imperial for Imperial
unit_system: metric
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Mexico_City
# Customization file
customize: !include customize.yaml
This is the errorlog:
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
self._callback(*self._args)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/event.py", line 373, in pattern_time_change_listener
hass.async_run_job(action, event.data[ATTR_NOW])
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 327, in async_run_job
target(*args)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sun.py", line 138, in timer_update
self.update_sun_position(time)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sun.py", line 120, in update_sun_position
self.solar_azimuth = self.location.solar_azimuth(utc_point_in_time)
File "/srv/homeassistant/lib/python3.5/site-packages/astral.py", line 1173, in solar_azimuth
self.astral = Astral()
File "/srv/homeassistant/lib/python3.5/site-packages/astral.py", line 1540, in __init__
self.geocoder = geocoder()
File "/srv/homeassistant/lib/python3.5/site-packages/astral.py", line 1348, in __init__
location = Location(info)
File "/srv/homeassistant/lib/python3.5/site-packages/astral.py", line 571, in __init__
self.timezone = info[4]
File "/srv/homeassistant/lib/python3.5/site-packages/astral.py", line 679, in timezone
raise ValueError("Timezone '%s' not recognized" % name)
ValueError: Timezone 'Africa/Lagos' not recognized