core: Yale Smart Alarm integration unresponsive

Home Assistant release with the issue:

0.80.0

Last working Home Assistant release (if known): 0.79.0

Operating environment (Hass.io/Docker/Windows/etc.):

Hassbian - PI B+

Component/platform:

https://www.home-assistant.io/components/alarm_control_panel.yale_smart_alarm/

Description of problem: After upgrading to 0.80.0 on 12 Oct the Yale Smart Alarm no longer is responding. The alarm is still working via the native Yale app.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):


Traceback (if applicable):

Log Details (ERROR)
Sun Oct 14 2018 09:16:42 GMT+0100 (BST)

Update for alarm_control_panel.yale_smart_alarm fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connection.py", line 326, in connect
    ssl_context=context)
  File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.5/ssl.py", line 385, in wrap_socket
    _context=self)
  File "/usr/lib/python3.5/ssl.py", line 760, in __init__
    self.do_handshake()
  File "/usr/lib/python3.5/ssl.py", line 996, in do_handshake
    self._sslobj.do_handshake()
  File "/usr/lib/python3.5/ssl.py", line 641, in do_handshake
    self._sslobj.do_handshake()
socket.timeout: _ssl.c:704: The handshake operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/util/retry.py", line 357, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/packages/six.py", line 686, in reraise
    raise value
  File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 349, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
  File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 309, in _raise_timeout
    raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='www.yalehomesystem.co.uk', port=443): Read timed out. (read timeout=5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
    await self.async_device_update()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
    await self.hass.async_add_job(self.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/alarm_control_panel/yale_smart_alarm.py", line 84, in update
    armed_status = self._client.get_armed_status()
  File "/srv/homeassistant/lib/python3.5/site-packages/yalesmartalarmclient/client.py", line 54, in get_armed_status
    alarm_state = self._post_authenticated(self._ENDPOINT_GET_MODE, params=params)
  File "/srv/homeassistant/lib/python3.5/site-packages/yalesmartalarmclient/client.py", line 86, in _post_authenticated
    response = requests.post(endpoint, params=params, cookies=self.cookies, timeout=self._DEFAULT_REQUEST_TIMEOUT)
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/adapters.py", line 526, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='www.yalehomesystem.co.uk', port=443): Read timed out. (read timeout=5)```

**Additional information:**
Not sure if this is related to the Yale server upgrade/ system outage on 12 October. Perhaps the Yale API being used by the HA integration has changed... 

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 50 (22 by maintainers)

Most upvoted comments

Sorry all, been very busy. I have pushed my code here: https://github.com/evoio/bridge-yale

I’ve just tested it and it still works with the same tokens that were extracted way back when the switch happened. Couple things, 1) sorry it was originally only written with my consumption in mind, I’ll try and add more docs, 2) I want to use MQTT + NodeRED for my logic layer and HA only for presentation so it includes some MQTT stuff.

To use it:

  1. run “npm install”
  2. set the following environment variables:
  • USER_ID - yale email address
  • PASSWORD - yale password
  • MQTT_BROKER - can use mqtt://test.mosquitto.org for testing purposes, but do not use for prolonged periods since it is completely unsecured
  1. run “node app.js”

If all goes well you should see output something like this:

Logging in… Logged in successfully! Syncing state: 1543775936962 Running on http://0.0.0.0:3000 Connected to MQTT broker Syncing state: 1543775952168 Syncing state: 1543775967171 (…)

This exposes an API on port 3000 and MQTT.

GET /alarm/mode PUT /alarm/mode { “mode”: “arm / disarm / home” }

@evoio Thank you so much.

I’m not much of a python coder but I’ll start converting the existing hass plugin over to this. I’ll keep everyone up to date here unless someone else comes in and does it before me 😃

Indeed, the only issue with this new API is the client key which isn’t exactly publicised…

Changing the component to use the new API calls shouldn’t be an issue and would probably benefit from the refresh token rather than constant logins, too. Although that’d require a slight modification to the HA component rather than just the client. I haven’t had much time to look into updating the client over at https://github.com/domwillcode/yale-smart-alarm-client yet but I had issues getting the ‘requests’ library to play nice. Bare with me (or feel free to PR), I’ll try and find some time in the coming weeks for an official/unofficial component 😃

The real solution would be for Yale to provide a client application key specifically for HA but they won’t talk to me. So unless someone fancies taking to Twitter/Social Media to get their attention…

Looks good and works fine @domwillcode 😃

@laf In that case, thank you to you and @evoio 👍

@itshusi thanks for testing. To be honest it was all @evoio really

@evoio, can I buy you a beer or two? If so, my email is in my profile, drop me a message and I’ll send some money you’re way.

@laf I have tested your client.py update and it is now working great! Cheers for your hard work on fixing this!

I have something working, but unfortunately its in Node.js…

would you be able to share this code so someone else might be able to port it to python?

If this new method involves a few unofficial steps. Could it be created as a custom component instead of an official HA component?

It unfortunately seems as though the API is redirecting to the Yale home page. As you say, it could be due to the upgrade but I’m concerned the API may have been discontinued. I’ve sent an email to Yale to discuss an alternative solution and should hopefully hear back this week. I’ll look into it, it could be worth disabling/removing the component within HA until I can find a solution. @balloob, thoughts?