Found my booboo… In my environment (virtualenv) custom_components is not located under config but directly under ~/.homeassistant and I had the directory sure_petflap located under custom_components/sensors in stead of under custom_components
Fixed my mistakes and now I have my Sure Catflap connected to HASS
Thanks for the write up, finally go this up and running in hassio. Can you give me some pointers as how to create a Lovelace card for individual items please or to see the list of items. ATM I can only see the list in devtools/States
Sooo, after a battery change in the pet_door and a modem reset (speed upgrade), this happened:
Error while setting up platform sure_petflap
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/sure_petflap/sensor.py", line 61, in setup_platform
add_devices([SurePetConnect(username, password)])
File "/config/custom_components/sure_petflap/sensor.py", line 80, in __init__
self.update()
File "/usr/local/lib/python3.7/site-packages/homeassistant/util/__init__.py", line 224, in wrapper
result = method(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/homeassistant/util/__init__.py", line 224, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/sure_petflap/sensor.py", line 105, in update
with self.sure:
File "/config/custom_components/sure_petflap/__init__.py", line 646, in __enter__
raise SPAPICacheLocked()
custom_components.sure_petflap.SPAPICacheLocked
Any ideas? Worked like a charm before. Thanks to @asif 's write-up.
If you can get this added as an HA component that supports the cat flap and multiple feeders, I’ll buy you a feeder.
I have two of the feeders and they are really excellent. Just like the cat flap. Very well made and thought out. I’m delighted with them and having them integrated with HA as a supported component would be awesome.
When trying to get the pet i got a valid response (fist line)
After this there are a lot of errors.
as expected hass didn’t understand this.
Do i mis some components?
Thanks
Mark
root@Hass01:/home/homeassistant/.homeassistant/sure_petcare# python sp_cli.py ls_pets
Catname (*number*) is Inside
Traceback (most recent call last):
File "sp_cli.py", line 156, in <module>
main( sys.argv )
File "sp_cli.py", line 80, in main
CMDS[args.cmd[0]]( sp, args )
File "sp_cli.py", line 110, in cmd_ls_pets
print( '%s (%s) is %s' % (pdata['name'], pid, sp.get_current_status( pid ),) )
File "/home/homeassistant/.homeassistant/sure_petcare/sure_petcare/__init__.py", line 761, in get_current_status
loc = self.get_pet_location( pet_id, household_id )
File "/home/homeassistant/.homeassistant/sure_petcare/sure_petcare/__init__.py", line 200, in get_pet_location
raise SPAPIUnknownPet()
sure_petcare.SPAPIUnknownPet
root@Hass01:/home/homeassistant/.homeassistant/sure_petcare# python sp_cli.py ls_pets
Traceback (most recent call last):
File "sp_cli.py", line 7, in <module>
import sure_petcare
File "/home/homeassistant/.homeassistant/sure_petcare/sure_petcare/__init__.py", line 9, in <module>
import requests
ImportError: No module named requests