I have two nearly identical automations, one that sends a snapshot of doorbell motion and another that sends a snapshot of driveway motion. The driveway automation always gives me an error that stops the rest of the automation from running. I completely scrapped it, duplicated my doorbell automation that never gives the error, and as soon as I changed the entities to my driveway cam instead of doorbell cam it started with the HTTP error again. The error is not in the cameras, it is in my living room Chromecast so I am losing my mind trying to figure out how changing the camera that captures a snapshot breaks my chromecast. And what’s even weirder is the automation works fine. It does what I want, but as long as it stops I can’t add a 5 minute wait to stop it from sending rapid fire notifications. When these cameras detect motion I get a notification every 5 seconds so some kind of cool down period is a must.
Error:
Logger: homeassistant.components.automation.notification_driveway_motion
Source: components/nfandroidtv/notify.py:150
Integration: Automation (documentation, issues)
First occurred: 09:56:29 (20 occurrences)
Last logged: 18:06:40
Notification - Driveway Motion: Error executing script. Unexpected error for call_service at pos 3: HTTPConnectionPool(host='192.168.50.111', port=7676): Read timed out. (read timeout=5)
While executing automation automation.notification_driveway_motion
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/lib/python3.10/http/client.py", line 1374, in getresponse
response.begin()
File "/usr/local/lib/python3.10/http/client.py", line 318, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.10/http/client.py", line 279, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/lib/python3.10/socket.py", line 705, in readinto
return self._sock.recv_into(b)
TimeoutError: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python3.10/site-packages/urllib3/packages/six.py", line 770, in reraise
raise value
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 451, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 340, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='192.168.50.111', port=7676): Read timed out. (read timeout=5)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 684, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1808, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1845, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 264, in _async_notify_message_service
await self.async_send_message(**kwargs)
File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 240, in async_send_message
await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/nfandroidtv/notify.py", line 150, in send_message
self.notify.send(
File "/usr/local/lib/python3.10/site-packages/notifications_android_tv/notifications.py", line 147, in send
response = requests.post(
File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 578, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='192.168.50.111', port=7676): Read timed out. (read timeout=5)
Working YAML, never gives an error:
alias: Notification - Front Door Motion
description: ""
trigger:
- type: turned_on
platform: device
device_id: 8c0e11e40b5acd57e3b1f5ba10149eb3
entity_id: binary_sensor.doorbell_person
domain: binary_sensor
condition: []
action:
- service: camera.snapshot
data:
filename: /config/www/images/doorbell.jpg
target:
entity_id: camera.doorbell_sub
- service: notify.only_phones
data:
message: Front door motion
data:
image: /local/images/doorbell.jpg
ttl: 0
priority: high
action: URI
title: Open Reolink
uri: app://com.mcu.reolink
clickAction: app://com.mcu.reolink
title: Tap to open Reolink app
- service: notify.living_room_tv_notifications
data:
message: Front Door Motion
data:
duration: 10
fontsize: max
position: top-left
image:
path: /config/www/images/doorbell.jpg
ttl: 0
priority: high
mode: single
The same automation but entities changed for driveway instead of doorbell, gives me the above error every time it runs:
alias: Notification - Driveway Motion
description: ""
trigger:
- type: turned_on
platform: device
device_id: 1d2dcf7f3300e122b6b7a7fc21a2150d
entity_id: binary_sensor.driveway_person
domain: binary_sensor
- type: turned_on
platform: device
device_id: 1d2dcf7f3300e122b6b7a7fc21a2150d
entity_id: binary_sensor.driveway_pet
domain: binary_sensor
- type: turned_on
platform: device
device_id: 1d2dcf7f3300e122b6b7a7fc21a2150d
entity_id: binary_sensor.driveway_vehicle
domain: binary_sensor
condition:
- type: is_not_open
condition: device
device_id: 99c9d9eda13e2a8e1657d1ecdb14d405
entity_id: binary_sensor.pressure_washer_sensor_contact
domain: binary_sensor
action:
- service: camera.snapshot
data:
filename: /config/www/images/driveway.jpg
target:
entity_id: camera.driveway_sub
- service: notify.only_phones
data:
message: Driveway Motion
data:
image: /local/images/driveway.jpg
ttl: 0
priority: high
action: URI
title: Open Reolink
uri: app://com.mcu.reolink
clickAction: app://com.mcu.reolink
title: Tap to open Reolink app
- service: notify.living_room_tv_notifications
data:
message: Driveway Motion
data:
duration: 10
fontsize: max
position: top-left
image:
path: /config/www/images/driveway.jpg
ttl: 0
priority: high
- delay:
hours: 0
minutes: 3
seconds: 0
milliseconds: 0
mode: single