Skip to content

Add Support for TryFi Series 3+ New Metrics #7

@adamjacobmuller

Description

@adamjacobmuller

Add Support for TryFi Series 3+ New Metrics

Overview

The TryFi Series 3+ collar includes new AI-powered behavior tracking features that are not currently exposed in the pytryfi library. This issue documents the new features and proposes adding support for them.

New Series 3+ Features

Based on TryFi's official documentation and research, the Series 3+ collar includes:

AI-Powered Behavior Tracking

  • Barking detection - Track when and how often your dog barks
  • Licking detection - Monitor excessive licking behaviors
  • Scratching detection - Track scratching frequency
  • Eating detection - Know when your dog is eating
  • Drinking detection - Track water consumption patterns

Enhanced Metrics

  • Signal strength indicators - Better connectivity information
  • Enhanced GPS accuracy - 2x faster and more accurate tracking
  • Sleep quality score - More detailed sleep analysis

Implementation Plan

1. New GraphQL Fragments Needed

We need to add new GraphQL fragments to query these behavior metrics:

fragment BehaviorDetails on Pet {
  __typename
  behaviorMetrics {
    __typename
    barking {
      count
      duration
      lastDetected
    }
    licking {
      count
      duration
      lastDetected  
    }
    scratching {
      count
      duration
      lastDetected
    }
    eating {
      count
      duration
      lastDetected
    }
    drinking {
      count  
      duration
      lastDetected
    }
  }
}

fragment EnhancedDeviceDetails on Device {
  __typename
  signalQuality {
    strength
    type
  }
  gpsAccuracy
  firmwareVersion
  hardwareVersion
}

2. Update Query Methods

  • Add new query methods in query.py to fetch behavior data
  • Update existing queries to include new fragments

3. Update Pet Model

Add new properties to FiPet class:

  • barking_count, barking_duration, barking_last_detected
  • licking_count, licking_duration, licking_last_detected
  • scratching_count, scratching_duration, scratching_last_detected
  • eating_count, eating_duration, eating_last_detected
  • drinking_count, drinking_duration, drinking_last_detected

4. Update Device Model

Add new properties to FiDevice class:

  • signal_strength
  • signal_type
  • gps_accuracy
  • firmware_version
  • hardware_version

Testing Requirements

  • Test with actual Series 3+ collar to verify API responses
  • Ensure backward compatibility with older collar versions
  • Handle cases where behavior data is not available

Related Work

  • This will also need to be implemented in hass-tryfi after pytryfi is updated
  • Home Assistant sensors will need to be added for each new metric

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions