Surepetcare integration stopped working in 2021.4.0 (and .1)

Since upgrading to 2021.4.0 yesterday, the Surepetcare integration had stopped working. I’ve upgrade to 2021.4.1 today and I’m getting the same error.

I’m running on a Pi4 with the Home Assistant SD image.

Note, I updated both the core and OS yesterday via supervisor.

My configuration.yaml has the following config

surepetcare:
  username: !secret surepetcare_user
  password: !secret surepetcare_pass
  flaps: [xxxxxx]
  pets: [xxxxx,xxxxx,xxxxx,xxxxx]

In the logs, I have a warning

Logger: homeassistant.util.async_
Source: util/async_.py:131 
First occurred: 17:04:42 (1 occurrences) 
Last logged: 17:04:42

Detected I/O inside the event loop. This is causing stability issues. Please report issue for surepetcare doing I/O at homeassistant/components/surepetcare/__init__.py, line 116: device_data = await surepy.device(device[CONF_ID])

Then an error

Logger: homeassistant.setup
Source: util/async_.py:139 
First occurred: 17:04:42 (1 occurrences) 
Last logged: 17:04:42

Error during setup of component surepetcare
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 240, in _async_setup_component
    result = await task
  File "/usr/src/homeassistant/homeassistant/components/surepetcare/__init__.py", line 116, in async_setup
    device_data = await surepy.device(device[CONF_ID])
  File "/usr/local/lib/python3.8/site-packages/surepy/__init__.py", line 184, in device
    device: Dict[str, Any] = (await self.devices).get(device_id, {})
  File "/usr/local/lib/python3.8/site-packages/surepy/__init__.py", line 181, in devices
    return await self.get_entities("devices")
  File "/usr/local/lib/python3.8/site-packages/surepy/__init__.py", line 244, in get_entities
    await self._get_resource(resource=MESTART_RESOURCE)
  File "/usr/local/lib/python3.8/site-packages/surepy/__init__.py", line 262, in _get_resource
    self.get_token()
  File "/usr/local/lib/python3.8/site-packages/surepy/__init__.py", line 410, in get_token
    raw_response: requests.Response = requests.post(
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1266, in _send_request
    self.putrequest(method, url, **skips)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 214, in putrequest
    return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 150, in protected_loop_func
    check_loop()
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 139, in check_loop
    raise RuntimeError(
RuntimeError: I/O must be done in the executor; Use `await hass.async_add_executor_job()` at homeassistant/components/surepetcare/__init__.py, line 116: device_data = await surepy.device(device[CONF_ID])

I couldn’t see anything else on the forum or GitHub, I just wondered if this is a bug that needs raising?

Already mentioned here

Github issue logged here Surepetcare: component does not load in 2021.4.0 · Issue #48794 · home-assistant/core · GitHub

Thanks Stuart, I swear I search both before posting. It must be Friday :grin:

Had the same problem, which seemed to fix itself recently (either in 2021.5, or because I migrated from a Pi4 to a NUC - both happened close together and I can’t say at exactly what point the surepetcare integration started working again).

In the last week or so, I’ve noticed that my cat flap is constantly showing as unavailable, but the battery, link and pet entities are all OK. The pet status doesn’t update though. Everything is working fine in the surepetcare app itself. Reboots don’t seem to help.

Anyone else had this problem? Had a quick search and couldn’t find anything, but may have missed a post

since updating home assistant my cat flap is showing as online, but it only updates if i reboot home assistant? is anyone else having this issue or know of a fix? i know the scan_interval is now depreciated, so not sure if theres anthing else i can do.

I have exactly the same issue. Battery and connectivity status seems to be coming through, but the ‘pets’ only get updated when I restarted HA

i’ve highlighted it on the github for the integration. hopefully it’ll get looked into :crossed_fingers:

Hi,

Yes, same problem for me. I found another custom componet that works in this thread:
Sureflap Connect - Pet Door - #522 by snwtoy.
Can be found in HACS.

1 Like

cheers. ill give it a try!

is there any prospect of a solution for the non-functioning integration?

I tried to paste the custom component in the folder t, but unfortunately that doesn’t help…

Having recently updated and seeing my Sure Petcare feeders offline in HA, I’m seeing the following in the logs… is there any intel on why it’s being deprecated, if it’ll be back, workarounds, anything?

Logger: homeassistant.components.surepetcare
Source: helpers/config_validation.py:748
Integration: Sure Petcare (documentation, issues)
First occurred: June 30, 2021, 6:21:12 PM (2 occurrences)
Last logged: June 30, 2021, 6:21:12 PM

  • The ‘feeders’ option is deprecated, please remove it from your configuration
  • The ‘pets’ option is deprecated, please remove it from your configuration

You’ll either need to disable it for now, or use the beta in this thread

hi,
does this still work?

My setup (according to the link in prevous post) still works fine.