sbabcock23 / hass-tryfi

Home Assistant integration for TryFi Dog Collar GPS monitoring.
https://github.com/sbabcock23/hass-tryfi
Apache License 2.0
48 stars 16 forks source link
dog dog-collar gps hacs home-assistant homeassistant-integration iot python tryfi

TryFi for Home Assistant

beta_badge release_date hacs_badge

This allows you to integrate TryFi Smart GPS Collars with Home Assistant.

Features

Current functionality includes:

Donate

If you would like to donate you can use my TryFi referral code "395FX4" on your next purchase.

Installation

Pre-Requisities

Installation Methods

HACS Install

  1. Search for TryFi under Integrations in the HACS Store tab.
  2. Add the Integration to your HA and configure.

Manual Install

  1. In your /config directory, create a custom_components folder if one does not exist.
  2. Copy the tryfi folder and all of it's contents to your custom_components directory.
  3. Restart Home Assistant.
  4. Add the Integration to your HA and configure.

Configuration

  1. After installing TryFi go to Configuration --> Integrations and add a new Integration
  2. Search for TryFi
  3. Enter in your TryFi username and password. Optionally you can select a polling frequency option (in seconds). Suggestion is nothing less then 5.
  4. Click Submit

Setup

Validation

Once you have added the integration, you will see 1 or more devices and entities associated with this integration. To validate its accuracy, you can review the steps and distance counters for your pet or its current whereabouts.

Integration

Dog Device and Entities

Device

Dog Device

Entities

Dog Entities

Base Device and Entities

Base Device and Entities

How to Use

Light Collar

The light on your Pet's collar is represented as a light switch in HA. It can either be turned on or off. The color can be set. The collar only supports Red, Green, Blue, LightBlue, Purple, Yellow, and White. The closest color to your selection will be used.

Lovelace

Lost Dog Mode

TryFi is equiped with a "Lost Dog Mode" functionality. In HA this is represented by a select entity. Select Lost if your pet is lost or Safe if your pet is OK.

Lovelace

Lovelace

Entities

type: entities
entities:
  - entity: select.harley_lost_state
  - entity: sensor.harley_collar_battery_level
  - entity: binary_sensor.harley_collar_battery_charging
  - entity: sensor.home_base
  - entity: sensor.harley_daily_steps
  - entity: sensor.harley_weekly_steps
  - entity: sensor.harley_monthly_steps
  - entity: sensor.harley_daily_distance
  - entity: sensor.harley_weekly_distance
  - entity: sensor.harley_monthly_distance
  - entity: sensor.harley_daily_sleep
  - entity: sensor.harley_weekly_sleep
  - entity: sensor.harley_monthly_sleep
  - entity: sensor.harley_daily_nap
  - entity: sensor.harley_weekly_nap
  - entity: sensor.harley_monthly_nap

Light

type: light
entity: light.harley_collar_light

Automation Examples

Turn on the Collar Light After Dark

Turns on the collar light after dark if the pet is not home.

- id: '1604060166498'
  alias: Turn on Light After Dark If Not Home
  description: ''
  trigger:
  - platform: sun
    event: sunset
  condition:
  - condition: and
    conditions:
    - condition: device
      device_id: a7237a6c1144fcd90828b21de2572603
      domain: device_tracker
      entity_id: device_tracker.pet_tracker
      type: is_not_home
  action:
  - type: turn_on
    device_id: a7237a6c1144fcd90828b21de2572603
    entity_id: light.pet_collar_light
    domain: light
  mode: single

Fully Charged Notification

Sends notification when battery has charged to 100%.

- id: '1661129896868'
  alias: Pet's Collar - Fully Charged
  description: ''
  trigger:
  - platform: state
    entity_id:
    - sensor.pet_collar_battery_level
    to: '100'
    for:
      hours: 0
      minutes: 0
      seconds: 0
  condition:
  - condition: state
    entity_id: binary_sensor.pet_collar_battery_charging
    state: 'on'
  action:
  - service: notify.everyone_phone
    data:
      message: Pet's collar is fully charged!
  mode: single

Known Issues

Future Enhacements

Version History

0.0.23

Links