Attempting to add my public domain name to allowlist_external_urls
in configuration.yaml
results in a 401 error.
Updated automation:
alias: 0Test Nest
description: ""
trigger:
- platform: device
device_id: [REDACTED]
domain: nest
type: camera_motion
condition: []
action:
- service: notify.discord
metadata: {}
data:
target: "[REDACTED]"
message: test camera
data:
images:
- >-
https://fqdn.com/api/nest/event_media/{{ trigger.event.data.device_id }}/{{
trigger.event.data.nest_event_id }}/thumbnail
Updated configuration.yaml
homeassistant:
allowlist_external_dirs:
- /tmp
allowlist_external_urls:
- https://fqdn.com
default_config:
api:
lovelace:
http:
ssl_certificate: !secret ssl_cert_loc
ssl_key: !secret ssl_key_loc
use_x_forwarded_for: true
trusted_proxies:
- 172.0.0.0/8
- 127.0.0.1
- ::1
Error message:
2024-01-20 16:13:42.755 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from unifi.local (192.168.1.1). Requested URL: '/api/nest/event_media/16015c01b7a49cafbfcdb5d184a8b3a1/WyJBVlBId0Vzb1hUUTY1S05RX21WZmExdmJLdmxiZlZ5SEhVYjNiQUlKR2NoMjdFOVBKRTcxblM3MzR3cWljelQyVE5fQ3JKdUJDMW5qRk5IaW1XbWUzdjMtWU5CeFpRIiwgIkNpVUEydnV4cjRvUkZaUzBDX1gwU0tUZkVEZ0ROZWsyTDhkaGZtamtyUndKQUlIc0dFWWdFb3NCQUczakw0WHVIMXc3TGFHZFd1bFpQRk5GQldSUTVYM3FBNHQ5UlVjaDVTTndKODBHTFVWMjBaeEN2dkNIT3lRQUh6RG5QaUdXUEItcy1BYkZSdlZIWExGS3pvdGxpTXdrOHpuOEkxQnlwWjNtamlzdnhCeVphbktuVEFtM01lZ0tvb2twZXJNNTMxNkdFWDZPT3dyRGw0X0UzMHlqSTlveGdpcTM1ZS1wb1BRY0JCQ2o3aVFKRmJ2alpnIl0=/thumbnail'. (HomeAssistant/2024.1.3 aiohttp/3.9.1 Python/3.11)
2024-01-20 16:13:42.772 ERROR (MainThread) [homeassistant.components.automation.0test_nest] 0Test Nest: Error executing script. Unexpected error for call_service at pos 1: 401, message='Unauthorized', url=URL('https://fqdn.com/api/nest/event_media/16015c01b7a49cafbfcdb5d184a8b3a1/WyJBVlBId0Vzb1hUUTY1S05RX21WZmExdmJLdmxiZlZ5SEhVYjNiQUlKR2NoMjdFOVBKRTcxblM3MzR3cWljelQyVE5fQ3JKdUJDMW5qRk5IaW1XbWUzdjMtWU5CeFpRIiwgIkNpVUEydnV4cjRvUkZaUzBDX1gwU0tUZkVEZ0ROZWsyTDhkaGZtamtyUndKQUlIc0dFWWdFb3NCQUczakw0WHVIMXc3TGFHZFd1bFpQRk5GQldSUTVYM3FBNHQ5UlVjaDVTTndKODBHTFVWMjBaeEN2dkNIT3lRQUh6RG5QaUdXUEItcy1BYkZSdlZIWExGS3pvdGxpTXdrOHpuOEkxQnlwWjNtamlzdnhCeVphbktuVEFtM01lZ0tvb2twZXJNNTMxNkdFWDZPT3dyRGw0X0UzMHlqSTlveGdpcTM1ZS1wb1BRY0JCQ2o3aVFKRmJ2alpnIl0=/thumbnail')
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 476, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 713, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 675, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 265, in _async_notify_message_service
await self.async_send_message(**kwargs)
File "/usr/src/homeassistant/homeassistant/components/discord/notify.py", line 167, in async_send_message
file = await self.async_get_file_from_url(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/discord/notify.py", line 80, in async_get_file_from_url
async with session.get(
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1187, in __aenter__
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 689, in _request
resp.raise_for_status()
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://fqdn.com/api/nest/event_media/16015c01b7a49cafbfcdb5d184a8b3a1/WyJBVlBId0Vzb1hUUTY1S05RX21WZmExdmJLdmxiZlZ5SEhVYjNiQUlKR2NoMjdFOVBKRTcxblM3MzR3cWljelQyVE5fQ3JKdUJDMW5qRk5IaW1XbWUzdjMtWU5CeFpRIiwgIkNpVUEydnV4cjRvUkZaUzBDX1gwU0tUZkVEZ0ROZWsyTDhkaGZtamtyUndKQUlIc0dFWWdFb3NCQUczakw0WHVIMXc3TGFHZFd1bFpQRk5GQldSUTVYM3FBNHQ5UlVjaDVTTndKODBHTFVWMjBaeEN2dkNIT3lRQUh6RG5QaUdXUEItcy1BYkZSdlZIWExGS3pvdGxpTXdrOHpuOEkxQnlwWjNtamlzdnhCeVphbktuVEFtM01lZ0tvb2twZXJNNTMxNkdFWDZPT3dyRGw0X0UzMHlqSTlveGdpcTM1ZS1wb1BRY0JCQ2o3aVFKRmJ2alpnIl0=/thumbnail')
2024-01-20 16:13:42.794 ERROR (MainThread) [homeassistant.components.automation.0test_nest] While executing automation automation.0test_nest
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 669, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1587, in async_run
return await asyncio.shield(run.async_run())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 426, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 479, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 502, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 476, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 713, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 675, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 265, in _async_notify_message_service
await self.async_send_message(**kwargs)
File "/usr/src/homeassistant/homeassistant/components/discord/notify.py", line 167, in async_send_message
file = await self.async_get_file_from_url(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/discord/notify.py", line 80, in async_get_file_from_url
async with session.get(
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1187, in __aenter__
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 689, in _request
resp.raise_for_status()
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://fqdn.com/api/nest/event_media/16015c01b7a49cafbfcdb5d184a8b3a1/WyJBVlBId0Vzb1hUUTY1S05RX21WZmExdmJLdmxiZlZ5SEhVYjNiQUlKR2NoMjdFOVBKRTcxblM3MzR3cWljelQyVE5fQ3JKdUJDMW5qRk5IaW1XbWUzdjMtWU5CeFpRIiwgIkNpVUEydnV4cjRvUkZaUzBDX1gwU0tUZkVEZ0ROZWsyTDhkaGZtamtyUndKQUlIc0dFWWdFb3NCQUczakw0WHVIMXc3TGFHZFd1bFpQRk5GQldSUTVYM3FBNHQ5UlVjaDVTTndKODBHTFVWMjBaeEN2dkNIT3lRQUh6RG5QaUdXUEItcy1BYkZSdlZIWExGS3pvdGxpTXdrOHpuOEkxQnlwWjNtamlzdnhCeVphbktuVEFtM01lZ0tvb2twZXJNNTMxNkdFWDZPT3dyRGw0X0UzMHlqSTlveGdpcTM1ZS1wb1BRY0JCQ2o3aVFKRmJ2alpnIl0=/thumbnail')