Notification's not working

Hello, I have a recurring issues with the iOS notifications. They will randomly stop working. I have 2 iPhones which are both setup to receive the notifications. Once i realise that they are not working I have to various steps (incl. reset and delete the app, delete the .ios.conf file) which do or don’t always work.

Its hassle and really annoying as some important notifications (such as alarm conditions) come through notifications.

Any suggestions?

Only idea I have is to check the HASS logs to see if there are errors. It will also report there if you’re hitting the quota limit which IIRC is 100 pushes/day.

Ive just tried a notification and this shows up in the log:

2018-08-25 11:54:01 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'mappingproxy object' has no attribute 'timestamp'
2018-08-25 11:54:02 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall notify.ios_philips_iphone (c:9f472b5bb1f34403846f54d4052e5c39): message=<homeassistant.helpers.template.Template object at 0x725d4fb0>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 171, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 56, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/local/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 314, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 180, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x727df550>: Failed to establish a new connection: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ios-push.home-assistant.io', port=443): Max retries exceeded with url: /push (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x727df550>: Failed to establish a new connection: [Errno -3] Try again',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1115, in _event_to_service_call
    await service_handler.func(service_call)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/notify/__init__.py", line 137, in async_notify_message
    yield from notify_service.async_send_message(**kwargs)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/notify/ios.py", line 94, in send_message
    req = requests.post(PUSH_URL, json=data, timeout=10)
  File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 513, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='ios-push.home-assistant.io', port=443): Max retries exceeded with url: /push (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x727df550>: Failed to establish a new connection: [Errno -3] Try again',))

Any ideas?

your very first error, look at line one and two. there is an error in your template data of the message. I had the same issue trying to send a message from an action with the trigger data but I had the trigger data template wrong. If the template fails evaluation, the message will not send.

This is what i have in the automation as the action:

  - service: notify.ios_philips_iphone
    data:
      message: 'Alarm Tirggered! Sensor'

Hmmm, that’s odd. I have similar notifications but I don’t have them wrapped in single quotes. If you remove the single quotes does it work? I do have one notification with the whole message wrapped in double quotes but it contains a template within the text:

action:
    - service: notify.ios_ipad
      data:
        title: Update Available!
        message: "Home Assistant {{ states.updater.updater.state }} is now available."

Hi there,

I dont believe that it is an issue with the message itself. I have used that exact action before and it works no problem. However i have done a test with your action and I still do not get a notification.

Its definitely something wrong with the add-in

So yesterday my notification started working again… i have no idea why. i had completed a full system reboot. so maybe that helped. i will try that as the first thing next time and see.

Hey, just curious, what sort of system and version are you running? is it a RPi ir linux and is it in a docker container? im trying to figure out why my notifications arent working either and im wondering if its a problem with a certain kind of install method.

If anyone comes across this again, reboot the host machine. I was running Hass.io and tried rebooting Home Assistant and that didn’t work. Had to reboot the host itself.

1 Like

Just want to report that this also worked for me. Restarting Home Assistant from the UI did nothing, but restarting the Docker Container fixed the problem.