Skip to content
/ sureha Public

SureHA ๐Ÿพ monitor & control your Sure Petcare devices via Home Assistant

License

Notifications You must be signed in to change notification settings

benleb/sureha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SureHA ๐Ÿพ

documentation is currently in a bad state. I am aware of this and working on it!

Entities

This project creates the following entities in your Home Assistant instance:

sensor.cat_flap

There will be 1 entity per cat flap with the following attributes

Click to expand!

This is a non-exhaustive list

Attribute Example
ID 123456
Parent device ID 123456
Product ID 6
Household ID 123456
Name Rivendell
Serial number XXXX-XXXXX
MAC address 2c549188c9e3
Index 0
Version ODM2
Created at December 19, 2018, 1:43:25 AM
Updated at December 19, 2018, 1:43:25 AM
Pairing at December 19, 2018, 1:43:25 AM
Control curfew:
- enabled:true
lock_time:"22:00"
unlock_time: "07:30"
locking: 0
fast_polling:false
Parent
Status locking:
mode: 0
version:
battery: 5.07
learn_mode:
online:true
Tags
Move

sensor.cat_flap_battery

Click to expand!
Attribute Example
Voltage 5.09
Voltage per battery 1.27
Alt-battery 16.82560000000002

binary_sensor.hub

Click to expand!
Attribute Example
Device rssi -35.00
Hub rssi -35.00

binary_sensor.pet

Click to expand!
Attribute Example
Since September 18, 2021, 4:09:42 PM
Where 1
ID 123456
Name Thorin
Gender 1
Comments Such a good cute boy
Household ID 123456
Breed ID 384
Photo ID 123456
Species ID
Tag ID 123456
Version Mg==
Created at April 1, 2021, 11:00:07 AM
Updated at April 1, 2021, 11:00:07 AM
April 2, 2021, 10:20:49 PM
Photo id: 238217
location https://surehub.s3.amazonaws.com/user-photos/thm/imageURL.jpg
Position tag_id: 1233456
user_id: 123456
where: 1
since: date
Status activity:
tag_id: 123456
user_id: 123456
where: 1
since: date

binary_sensor.flap_connectivity

Services

This project allows you to use the following services in Home Assistant:

SureHA: Set Pet location

This service call allows you to update the location of a pet.
Data needed:
- pet_id = this is the surepetcare id for your pet.
- where = options are "Inside" or "Outside"

example:

service: sureha.set_pet_location
data:
  pet_id: 31337
  where: Inside

SureHA: Set lock state

This service call allows you to update the lock state of a flap.

Data needed:
- flap_id = this is the surepetcare id for the flap you want to change.
- lock_state =

example:

service: sureha.set_lock_state
data:
 flap_id: 123456
 lock_state: locked

Useful stuff

The following script and button card code was create by xbmcnut to set pets location to inside

script:
  set_kobe_inside:
    alias: 'Set Kobe Inside'
    sequence:
      - service: sureha.set_pet_location
        data:
          pet_id: '123456' #Kobe's Code
          where: Inside      

Button card code:

entity: binary_sensor.pet_kobe
icon: mdi:cat
layout: icon_name_state
show_name: false
show_state: true
styles:
  icon:
    - color: >
        [[[ if (states['binary_sensor.pet_kobe'].state === 'on') return "green";
        return "red"; ]]]
tap_action:
  action: more-info
hold_action:
  action: call-service
  service: script.set_kobe_inside
type: custom:button-card

The following script was created by sasgoose to toggle the location of a pet

script:
  toggle_thorin_location:
      alias: 'Toggle Thorin location'
      sequence:
        choose:
        - conditions:
            - condition: state
              entity_id: binary_sensor.pet_thorin_2
              attribute: where
              state: 1
          sequence:
            - service: sureha.set_pet_location
              data:
                pet_id: '123456' # Thorin's pet id
                where: Outside
        - conditions:
            - condition: state
              entity_id: binary_sensor.pet_thorin_2
              attribute: where
              state: 2
          sequence:
            - service: sureha.set_pet_location
              data:
                pet_id: '123456' # Thorin's pet id
                where: Inside
                

Upgrade surepetcarebeta to sureha

Do a backup of your HA first. Its probably not needed but a backup is never a bad idea ;)
The cleanest way will be to delete the surepetcarebeta integration completely and handle sureha completely independent. It will create the same entity/unique ids as before so your automations and graphs should not be affected.

enable the debug logging in configuration.yaml if something does not work as expected

# logging
logger:
  default: info
  logs:
    surepy: debug
    custom_components.sureha: debug
    custom_components.sureha.binary_sensor: debug
    custom_components.sureha.sensor: debug

Naming confusion for surepetcarebeta users ๐Ÿพ ๐Ÿคช ๐Ÿคฆ

Sorry for the bad naming and resulting confusion and chaos ๐Ÿ™„ To "fix" this, I renamed surepetcarebeta to sureha.

Name Repo Type Description Need Help?
surepy ๐Ÿพ github.com/benleb/surepy Python Library Library to interact with the API of Sure Petcare. Also provides Classes for the various Sure Petcare Devicess. Use this if you write an own python tool/app and want to interact with the Sure Petcare API Issues
surepetcare HA Favicon github.com/home-assistant/core Home Assistant Integration Official Home Assistant Integration for the Sure Petcare Devices like Doors, Flaps, Feeders, ... Issues, HA Forum
sureha surepetcarebeta benleb/surepetcare github.com/benleb/sureha Home Assistant Integration Home Assistant Integration developed in my own repo without reviews from the HA Team. This can be installed via HACS and is something like a preview integration for advanced users. Usually this provides more (experimental) features and faster fixes but lacks the code quality (reviews) and such from HA Issues
pethublocal github.com/plambrechtsen/pethublocal Home Assistant Integration Home Assistant Integration developed by @plambrechtsen which works completely independent from Sure Petcare. Check outs his repo for more information! Issues, HA Forum