Sureflap Connect - Pet Door

Sorry for the Stupid Question, maybe I’m just blind. I Want to add theIntegration but it isn’t listed in my Webgui. Do I have to install it manualy? If Yes is there an Insttruction?
Thx

Heads up - unfortunately the component doesn’t load in 2021.4.0.

I’ve raised the error as issue 48794

1 Like
[quote="TazUk, post:414, topic:41488, full:true"]
Heads up - unfortunately the component doesn't load in 2021.4.0.

I've raised the error as [issue 48794](https://github.com/home-assistant/core/issues/48794)
[/quote]

same here after upgrading this morning: 
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 have made an alternative cloud integration for HA: https://github.com/Danielhiversen/home_assistant_petcare

Does your integration work for feeders or just flaps ?

Just flaps.
I do not have any feeders

Whereas my local integration is in the process of supporting all three. I have a feeder and pet door which is for the most part supported, and others have given me traces to support the cat flap.

Same issue here, I hope it is getting fixed soon.

@benleb you already fix this right? It only needs to be inplantend in this integration?

@peterl I checked your integration but it is hard to understand how to install in HA, besides I made my own counters for this current integration, I am not sure if everything works with your integration, I want to try your version but it needs a installation documentation for n00bs like me.

You mean:

And

I know altering your internal DNS and spinning up docker containers isn’t for everyone but there is a bit of documentation to follow.
The main point is there isn’t anything in HA you need to configure as it uses HA MQTT discovery to create the entities in HA so there isn’t anything you actually need to change in HA to get it working.

Think we’re getting confusion here about which integration is which, this thread was originally for the interaction using that reverse engineered API.

Is there a fix for 2021.4.6 yet?

Yes in the beta release 2021.5.0bx

1 Like

Thanks, I’ll take a look.

Hi,

Sorry for such n00b question but dont understand this integration. I had the integration up and running in 2021.3.x just fine - once I moved to 2021.4.x it failed on me. I’ve been reading the threads that there was a known issue (Git) and should be resolved in 2021.5.x (Release Notes + Git issue closed). I’ve succesfully upgraded to 2021.5.0, removed the depreacated entries from Configuration.yaml (only have user + pass in there) - rebooted, integration still fails! Question from me being: do I need to add a repository, copy files around or anything or should the config from the .yaml be enough or what? Again - sorry for the most likely stupid question but anyway…

Getting:

Error during setup of component surepetcare
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 248, in _async_setup_component
    result = await task
  File "/usr/src/homeassistant/homeassistant/components/surepetcare/__init__.py", line 88, in async_setup
    await spc.async_update()
  File "/usr/src/homeassistant/homeassistant/components/surepetcare/__init__.py", line 150, in async_update
    self.states = await self.surepy.get_entities()
  File "/usr/local/lib/python3.8/site-packages/surepy/__init__.py", line 253, in get_entities
    surepy_entities[entity_id] = Pet(data=entity)
  File "/usr/local/lib/python3.8/site-packages/surepy/entities/pet.py", line 37, in __init__
    self.state = PetState(data["status"])
KeyError: 'status'

Only adding the Configuration.yaml lines should do it:

surepetcare:
  username: !secret surepetcare_username
  password: !secret surepetcare_password

I don’t really understand it, either
Before the 2021.4 patch, I had the status of my 2 cats and the flap door (sensor).
Then it was broken for a month (no, it was not fixable when running HA OS).
And now 2021.5 is here, and I have removed every entry except the username and password.
The 2 cats shows just fine, but not the flap door anymore. I cannot see anywhere that a sensor is created for it.
Am I missing something here?

thanks.

Hey, thanks for the clarification then - however, same issue. I basically removed everything there is to the integration (configuration.yaml + lovelace references + removed the entities themselves) and rebooted. Error gone / integration gone. Added your suggestion above - back to square 0. Anyway - thanks and the hunt continues on my side.

Hi, first of all thanks for the hard work and countless hours ppl have spent on this integration.
I am a noob on HomeAssistant, but trying to get my hands dirty:

Issue/Error I am facing relates to a recent integration with HomeAssistantOS, after upgrading to version 2021.5.0, without using surepetcare in older versions.

I have an error each time I try to excute service “Sure Petcare: set_lock_state” with parameters:

service: surepetcare.set_lock_state
data:
  flap_id: xxxxxx
  lock_state: locked_in

The details of the error in log file are:

Logger: homeassistant.helpers.script.websocket_api_script
Source: components/surepetcare/__init__.py:164
First occurred: 14:23:04 (1 occurrences)
Last logged: 14:23:04

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'Surepy' object has no attribute 'lock_in'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 363, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 563, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1481, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1516, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/components/surepetcare/__init__.py", line 102, in handle_set_lock_state
    await spc.set_lock_state(call.data[ATTR_FLAP_ID], call.data[ATTR_LOCK_STATE])
  File "/usr/src/homeassistant/homeassistant/components/surepetcare/__init__.py", line 164, in set_lock_state
    await self.surepy.lock_in(flap_id)
AttributeError: 'Surepy' object has no attribute 'lock_in'

What scares me a bit is the last line. I cannot access the surepy integration files on homeassistant to check if my recent upgrade to lastest HA OS (docker) version has failed.

Any guidance regarding what I should check next would be mostly appreciated.

Note: Entities appear correctly (2x cats, 1x flap, 1x gateway, 1x battery), but status does not update automatically. Status of cats seems to only update when I restart Supervisor.

Apologies for any issues/wording above. still learning.

Try: GitHub - Danielhiversen/home_assistant_petcare: Petcare intgration for Home Assistant
Can be set up from the gui

1 Like

Oh wow you stole basically all the code without even mentioning it :smiley: nice job bro, that’s how opensource works! :clap:

Best of all he is asking for donations too.