Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/benleb/sureha

SureHA ðŸū monitor & control your Sure Petcare devices via Home Assistant
https://github.com/benleb/sureha

home-assistant home-automation homeassistant surepet surepetcare surepy

Last synced: about 1 month ago
JSON representation

SureHA ðŸū monitor & control your Sure Petcare devices via Home Assistant

Awesome Lists containing this project

README

        

# 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:
```yaml
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:
```yaml
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
```yaml
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:
```yaml
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

```yaml
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

```yaml
# 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](https://github.com/benleb/surepy) ðŸū** | [github.com/benleb/surepy](https://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](https://github.com/benleb/surepy/issues) |
| **[surepetcare](https://www.home-assistant.io/integrations/surepetcare)** ![HA Favicon](https://www.home-assistant.io/images/favicon.ico) | [github.com/home-assistant/core](https://github.com/home-assistant/core) | [Home Assistant](https://github.com/home-assistant/core) Integration | **Official Home Assistant Integration** for the Sure Petcare Devices like Doors, Flaps, Feeders, ... | [Issues](https://github.com/home-assistant/core/issues), [HA Forum](https://community.home-assistant.io) |
| | | | | |
| **[sureha](https://github.com/benleb/sureha)** ~~surepetcarebeta~~ ~~[benleb/surepetcare](https://github.com/benleb/sureha)~~ | [github.com/benleb/sureha](https://github.com/benleb/sureha) | [Home Assistant](https://github.com/home-assistant/core) Integration | Home Assistant Integration developed in my own repo without reviews from the HA Team. This can be installed via [HACS](https://hacs.xyz/) 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](https://github.com/benleb/sureha/issues) |
| | | | | |
| **[pethublocal](https://github.com/plambrechtsen/pethublocal)** | [github.com/plambrechtsen/pethublocal](https://github.com/plambrechtsen/pethublocal) | [Home Assistant](https://github.com/home-assistant/core) Integration | Home Assistant Integration developed by [@plambrechtsen](https://github.com/plambrechtsen) which works **completely independent from Sure Petcare**. Check outs his repo for more information! | [Issues](https://github.com/plambrechtsen/pethublocal/issues), [HA Forum](https://community.home-assistant.io) |