[Solved] Entity not found - Sun

Hi guys. As from 0.105 update I think, I have “entity not found” for Sun on lovelace. Not a big deal, I maybe don’t need it at all, but since this is the part of default_config: I cannot figure out where to start looking for resolving issue.

I have default_config: line in my configuration.yaml
I even tried to add sun: line to configuration.yaml , nothing was changed
I’m running HA on Arch Linux desktop, installed from Arch official repositories.
Current version is: home-assistant-0.105.5-1-any.pkg.tar.zst

Lovelace:

2020-02-19 11_14_59-Home Assistant

Notifications:

notifi

Do anyone has idea?

Thanks

What is the error in the log? It should hopefully have more info.

Hi. Thanks for answer. Below part is related, but not sure what to do with it:

2020-02-19 15:28:29 ERROR (MainThread) [homeassistant.setup] Error during setup of component sun
Traceback (most recent call last):
File “/usr/lib/python3.8/site-packages/homeassistant/setup.py”, line 169, in _async_setup_component
result = await component.async_setup( # type: ignore
File “/usr/lib/python3.8/site-packages/homeassistant/components/sun/init.py”, line 82, in async_setup
Sun(hass)
File “/usr/lib/python3.8/site-packages/homeassistant/components/sun/init.py”, line 106, in init
update_location(None)
File “/usr/lib/python3.8/site-packages/homeassistant/components/sun/init.py”, line 103, in update_location
self.location = get_astral_location(self.hass)
File “/usr/lib/python3.8/site-packages/homeassistant/helpers/sun.py”, line 22, in get_astral_location
from astral import Location
ImportError: cannot import name ‘Location’ from ‘astral’ (/usr/lib/python3.8/site-packages/astral/init.py)
2020-02-19 15:28:30 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: sun

Full log from today is below. Please, don’t pay attention on lot of errors (PS4, yeelight), devices were turned off from power and they are working properely with HA when they are turned on. I am interested here for sun component.

2020-02-19 01:37:48 ERROR (SyncWorker_4) [homeassistant.components.yeelight] Unable to update device 192.168.0.14, bulb: A socket error occurred when sending the command.
2020-02-19 06:17:27 ERROR (MainThread) [homeassistant.components.ps4.media_player] Could not find data in region: United States for PS ID: CUSA02012
2020-02-19 06:17:28 ERROR (SyncWorker_3) [homeassistant.components.pushbullet.notify] No such target: device/telephone
2020-02-19 06:17:28 ERROR (SyncWorker_0) [homeassistant.components.pushbullet.notify] No such target: device/telephone
2020-02-19 06:17:28 ERROR (SyncWorker_3) [homeassistant.components.pushbullet.notify] No such target: channel/my_home
2020-02-19 06:17:28 ERROR (SyncWorker_0) [homeassistant.components.pushbullet.notify] No such target: channel/my_home
2020-02-19 06:18:43 ERROR (SyncWorker_1) [homeassistant.components.pushbullet.notify] No such target: device/telephone
2020-02-19 06:18:44 ERROR (SyncWorker_1) [homeassistant.components.pushbullet.notify] No such target: channel/my_home
2020-02-19 06:18:48 ERROR (SyncWorker_6) [homeassistant.components.pushbullet.notify] No such target: device/telephone
2020-02-19 06:18:49 ERROR (SyncWorker_6) [homeassistant.components.pushbullet.notify] No such target: channel/my_home
2020-02-19 07:33:34 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.playstation_4 is taking over 10 seconds
2020-02-19 07:33:35 WARNING (MainThread) [homeassistant.components.media_player] Updating ps4 media_player took longer than the scheduled update interval 0:00:10
2020-02-19 07:33:46 WARNING (MainThread) [homeassistant.components.media_player] Updating ps4 media_player took longer than the scheduled update interval 0:00:10
2020-02-19 07:33:57 WARNING (MainThread) [homeassistant.components.media_player] Updating ps4 media_player took longer than the scheduled update interval 0:00:10
2020-02-19 07:34:08 WARNING (MainThread) [homeassistant.components.ps4.media_player] PS4 could not be reached
2020-02-19 09:12:57 ERROR (SyncWorker_4) [homeassistant.components.pushbullet.notify] No such target: device/telephone
2020-02-19 09:12:58 ERROR (SyncWorker_4) [homeassistant.components.pushbullet.notify] No such target: channel/my_home
2020-02-19 09:13:21 ERROR (MainThread) [homeassistant.components.ps4.media_player] Could not find data in region: United States for PS ID: CUSA00556
2020-02-19 09:13:22 ERROR (SyncWorker_0) [homeassistant.components.pushbullet.notify] No such target: device/telephone
2020-02-19 09:13:23 ERROR (SyncWorker_0) [homeassistant.components.pushbullet.notify] No such target: channel/my_home
2020-02-19 11:09:40 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-02-19 11:09:44 ERROR (MainThread) [homeassistant.setup] Error during setup of component sun
Traceback (most recent call last):
File “/usr/lib/python3.8/site-packages/homeassistant/setup.py”, line 169, in _async_setup_component
result = await component.async_setup( # type: ignore
File “/usr/lib/python3.8/site-packages/homeassistant/components/sun/init.py”, line 82, in async_setup
Sun(hass)
File “/usr/lib/python3.8/site-packages/homeassistant/components/sun/init.py”, line 106, in init
update_location(None)
File “/usr/lib/python3.8/site-packages/homeassistant/components/sun/init.py”, line 103, in update_location
self.location = get_astral_location(self.hass)
File “/usr/lib/python3.8/site-packages/homeassistant/helpers/sun.py”, line 22, in get_astral_location
from astral import Location
ImportError: cannot import name ‘Location’ from ‘astral’ (/usr/lib/python3.8/site-packages/astral/init.py)
2020-02-19 11:09:46 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: sun
2020-02-19 11:09:46 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: Could not set up all dependencies.
2020-02-19 11:10:00 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry UPnP/IGD for upnp
Traceback (most recent call last):
File “/var/lib/hass/deps/lib/python3.8/site-packages/async_upnp_client/aiohttp.py”, line 103, in async_do_http_request
async with self._session.request(method, url, headers=headers, data=body) as response:
File “/usr/lib/python3.8/site-packages/aiohttp/client.py”, line 1012, in aenter
self._resp = await self._coro
File “/usr/lib/python3.8/site-packages/aiohttp/client.py”, line 480, in _request
conn = await self._connector.connect(
File “/usr/lib/python3.8/site-packages/aiohttp/connector.py”, line 523, in connect
proto = await self._create_connection(req, traces, timeout)
File “/usr/lib/python3.8/site-packages/aiohttp/connector.py”, line 858, in _create_connection
_, proto = await self._create_direct_connection(
File “/usr/lib/python3.8/site-packages/aiohttp/connector.py”, line 980, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File “/usr/lib/python3.8/site-packages/aiohttp/connector.py”, line 936, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa
File “/usr/lib/python3.8/asyncio/base_events.py”, line 1006, in create_connection
sock = await self._connect_sock(
File “/usr/lib/python3.8/asyncio/base_events.py”, line 920, in _connect_sock
await self.sock_connect(sock, address)
File “/usr/lib/python3.8/asyncio/selector_events.py”, line 494, in sock_connect
return await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.8/site-packages/homeassistant/config_entries.py”, line 214, in async_setup
result = await component.async_setup_entry( # type: ignore
File “/usr/lib/python3.8/site-packages/homeassistant/components/upnp/init.py”, line 148, in async_setup_entry
device = await async_discover_and_construct(hass, config_entry.data.get(“udn”))
File “/usr/lib/python3.8/site-packages/homeassistant/components/upnp/init.py”, line 117, in async_discover_and_construct
return await Device.async_create_device(hass, ssdp_description)
File “/usr/lib/python3.8/site-packages/homeassistant/components/upnp/device.py”, line 57, in async_create_device
upnp_device = await factory.async_create_device(ssdp_description)
File “/var/lib/hass/deps/lib/python3.8/site-packages/async_upnp_client/client_factory.py”, line 52, in async_create_device
root = await self._async_get_url_xml(description_url)
File “/var/lib/hass/deps/lib/python3.8/site-packages/async_upnp_client/client_factory.py”, line 290, in _async_get_url_xml
await self.requester.async_http_request(‘GET’, url)
File “/var/lib/hass/deps/lib/python3.8/site-packages/async_upnp_client/client.py”, line 66, in async_http_request
await self.async_do_http_request(method,
File “/var/lib/hass/deps/lib/python3.8/site-packages/async_upnp_client/aiohttp.py”, line 113, in async_do_http_request
resp_body = None
File “/usr/lib/python3.8/site-packages/async_timeout/init.py”, line 55, in aexit
self._do_exit(exc_type)
File “/usr/lib/python3.8/site-packages/async_timeout/init.py”, line 92, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
2020-02-19 11:10:00 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.8/site-packages/homeassistant/data_entry_flow.py”, line 109, in async_init
result = await self._async_handle_step(flow, flow.init_step, data)
File “/usr/lib/python3.8/site-packages/homeassistant/data_entry_flow.py”, line 172, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File “/usr/lib/python3.8/site-packages/homeassistant/components/homekit_controller/config_flow.py”, line 234, in async_step_zeroconf
existing = find_existing_host(self.hass, hkid)
File “/usr/lib/python3.8/site-packages/homeassistant/components/homekit_controller/config_flow.py”, line 61, in find_existing_host
if entry.data[“AccessoryPairingID”] == serial:
KeyError: ‘AccessoryPairingID’
2020-02-19 11:10:22 ERROR (MainThread) [homeassistant.components.ps4.media_player] Could not find data in region: United States for PS ID: CUSA00556
2020-02-19 11:31:48 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.playstation_4 is taking over 10 seconds
2020-02-19 11:31:49 WARNING (MainThread) [homeassistant.components.media_player] Updating ps4 media_player took longer than the scheduled update interval 0:00:10
2020-02-19 11:31:49 ERROR (SyncWorker_0) [homeassistant.components.yeelight] Unable to update device 192.168.0.14, bulb: Bulb closed the connection.
2020-02-19 11:32:00 WARNING (MainThread) [homeassistant.components.media_player] Updating ps4 media_player took longer than the scheduled update interval 0:00:10
2020-02-19 11:32:11 WARNING (MainThread) [homeassistant.components.media_player] Updating ps4 media_player took longer than the scheduled update interval 0:00:10
2020-02-19 11:32:22 WARNING (MainThread) [homeassistant.components.media_player] Updating ps4 media_player took longer than the scheduled update interval 0:00:10
2020-02-19 11:32:33 WARNING (MainThread) [homeassistant.components.media_player] Updating ps4 media_player took longer than the scheduled update interval 0:00:10
2020-02-19 11:32:43 WARNING (MainThread) [homeassistant.components.media_player] Updating ps4 media_player took longer than the scheduled update interval 0:00:10
2020-02-19 11:32:54 WARNING (MainThread) [homeassistant.components.ps4.media_player] PS4 could not be reached
2020-02-19 13:53:48 ERROR (SyncWorker_7) [homeassistant.components.yeelight] Unable to update device 192.168.0.14, bulb: Bulb closed the connection.
2020-02-19 14:27:16 ERROR (SyncWorker_1) [homeassistant.components.pushbullet.notify] No such target: device/telephone
2020-02-19 14:27:17 ERROR (SyncWorker_1) [homeassistant.components.pushbullet.notify] No such target: channel/my_home
2020-02-19 14:27:38 ERROR (MainThread) [homeassistant.components.ps4.media_player] Could not find data in region: United States for PS ID: CUSA00556
2020-02-19 15:27:46 ERROR (MainThread) [homeassistant.config] Invalid config for [homeassistant]: not a directory @ data[‘whitelist_external_dirs’][0]. Got ‘/usr/var/dumping-ground’. (See /var/lib/hass/configuration.yaml, line 14).
2020-02-19 15:27:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.8/site-packages/homeassistant/core.py”, line 1201, in async_call
raise ServiceNotFound(domain, service) from None
homeassistant.exceptions.ServiceNotFound: Unable to find service persistent_notification/create
2020-02-19 15:28:25 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-02-19 15:28:29 ERROR (MainThread) [homeassistant.setup] Error during setup of component sun
Traceback (most recent call last):
File “/usr/lib/python3.8/site-packages/homeassistant/setup.py”, line 169, in _async_setup_component
result = await component.async_setup( # type: ignore
File “/usr/lib/python3.8/site-packages/homeassistant/components/sun/init.py”, line 82, in async_setup
Sun(hass)
File “/usr/lib/python3.8/site-packages/homeassistant/components/sun/init.py”, line 106, in init
update_location(None)
File “/usr/lib/python3.8/site-packages/homeassistant/components/sun/init.py”, line 103, in update_location
self.location = get_astral_location(self.hass)
File “/usr/lib/python3.8/site-packages/homeassistant/helpers/sun.py”, line 22, in get_astral_location
from astral import Location
ImportError: cannot import name ‘Location’ from ‘astral’ (/usr/lib/python3.8/site-packages/astral/init.py)
2020-02-19 15:28:30 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: sun
2020-02-19 15:28:30 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: Could not set up all dependencies.
2020-02-19 15:28:45 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry UPnP/IGD for upnp
Traceback (most recent call last):
File “/var/lib/hass/deps/lib/python3.8/site-packages/async_upnp_client/aiohttp.py”, line 103, in async_do_http_request
async with self._session.request(method, url, headers=headers, data=body) as response:
File “/usr/lib/python3.8/site-packages/aiohttp/client.py”, line 1012, in aenter
self._resp = await self._coro
File “/usr/lib/python3.8/site-packages/aiohttp/client.py”, line 480, in _request
conn = await self._connector.connect(
File “/usr/lib/python3.8/site-packages/aiohttp/connector.py”, line 523, in connect
proto = await self._create_connection(req, traces, timeout)
File “/usr/lib/python3.8/site-packages/aiohttp/connector.py”, line 858, in _create_connection
_, proto = await self._create_direct_connection(
File “/usr/lib/python3.8/site-packages/aiohttp/connector.py”, line 980, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File “/usr/lib/python3.8/site-packages/aiohttp/connector.py”, line 936, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa
File “/usr/lib/python3.8/asyncio/base_events.py”, line 1006, in create_connection
sock = await self._connect_sock(
File “/usr/lib/python3.8/asyncio/base_events.py”, line 920, in _connect_sock
await self.sock_connect(sock, address)
File “/usr/lib/python3.8/asyncio/selector_events.py”, line 494, in sock_connect
return await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.8/site-packages/homeassistant/config_entries.py”, line 214, in async_setup
result = await component.async_setup_entry( # type: ignore
File “/usr/lib/python3.8/site-packages/homeassistant/components/upnp/init.py”, line 148, in async_setup_entry
device = await async_discover_and_construct(hass, config_entry.data.get(“udn”))
File “/usr/lib/python3.8/site-packages/homeassistant/components/upnp/init.py”, line 117, in async_discover_and_construct
return await Device.async_create_device(hass, ssdp_description)
File “/usr/lib/python3.8/site-packages/homeassistant/components/upnp/device.py”, line 57, in async_create_device
upnp_device = await factory.async_create_device(ssdp_description)
File “/var/lib/hass/deps/lib/python3.8/site-packages/async_upnp_client/client_factory.py”, line 52, in async_create_device
root = await self._async_get_url_xml(description_url)
File “/var/lib/hass/deps/lib/python3.8/site-packages/async_upnp_client/client_factory.py”, line 290, in _async_get_url_xml
await self.requester.async_http_request(‘GET’, url)
File “/var/lib/hass/deps/lib/python3.8/site-packages/async_upnp_client/client.py”, line 66, in async_http_request
await self.async_do_http_request(method,
File “/var/lib/hass/deps/lib/python3.8/site-packages/async_upnp_client/aiohttp.py”, line 113, in async_do_http_request
resp_body = None
File “/usr/lib/python3.8/site-packages/async_timeout/init.py”, line 55, in aexit
self._do_exit(exc_type)
File “/usr/lib/python3.8/site-packages/async_timeout/init.py”, line 92, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
2020-02-19 15:28:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.8/site-packages/homeassistant/data_entry_flow.py”, line 109, in async_init
result = await self._async_handle_step(flow, flow.init_step, data)
File “/usr/lib/python3.8/site-packages/homeassistant/data_entry_flow.py”, line 172, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File “/usr/lib/python3.8/site-packages/homeassistant/components/homekit_controller/config_flow.py”, line 234, in async_step_zeroconf
existing = find_existing_host(self.hass, hkid)
File “/usr/lib/python3.8/site-packages/homeassistant/components/homekit_controller/config_flow.py”, line 61, in find_existing_host
if entry.data[“AccessoryPairingID”] == serial:
KeyError: ‘AccessoryPairingID’
2020-02-19 15:29:03 ERROR (MainThread) [homeassistant.components.ps4.media_player] Could not find data in region: United States for PS ID: CUSA00556

Many thanks in advance.

Looks like your location could be set incorrectly.

This isn’t related with sun. This is related with Playstation 4. CUSA00556 is Sony ID for game “The Last of Us Remastered” EU version. I cannot know for sure what happened above, but I noticed today that cover art was missing on Playstation card on lovelace, during Las of Us playing, so “could not find data in region (data = photo)…” could be logical (and I am registered on US Sony store, on Playstation). Anyway, Playstation card in HA works like a charm and I think this is not related with topic.

Thx anyway.

Looks like a similar issue to Appdaemon => inactive (dead)
For some reason, you have the wrong version of the python astral library https://pypi.org/project/astral/. Is there any requirements.txt file in the repository you installed HA from, and if so, does it specify a version required for astral?

You are my man, thx a lot.

I simple done:

sudo pip3 uninstall astral
sudo pip3 install astral==1.10.1
sudo systemctl restart home-assistant

Problem solved, my sun is back :slight_smile:

This is not fully aligned with Archlinux philosophy where we have always latest packages, but who care, life goes on and sun is back :slight_smile:

1 Like