The Cat app (Cat.cs) provides comprehensive automation for pet care, including automatic feeding schedules, litter box monitoring, and pet device management for Pixel the cat.
- Scheduled Feeding: Multiple daily feeding times with configurable portions
- Manual Feeding: On-demand feeding via button control
- Portion Tracking: Monitors daily and lifetime food consumption
- Smart Scheduling: Configurable feeding times and amounts
- Daily Totals: Tracks total food given per day
- Lifetime Statistics: Cumulative feeding data
- Manual vs Automatic: Separate tracking for different feeding types
- Food Level Monitoring: Alerts when food storage is low
- Usage Monitoring: Tracks when Pixel uses the litter box
- Automatic Cleaning: Triggers cleaning cycles after use
- Error Detection: Monitors for litter box malfunctions
- Manual Controls: Override options for cleaning and emptying
- Status Monitoring: Ensures water fountain stays operational
- Alert System: Notifications when fountain goes offline
- Automatic Recovery: Attempts to restore fountain operation
- Feeding Alerts: Rich notifications for all feeding events
- Device Status: Updates on litter box and fountain status
- Emergency Alerts: Critical notifications for device failures
private void AutoFeedCat()
{
foreach (var autoFeed in Collections.GetFeedTimes(Entities))
{
var feedTime = TimeSpan.Parse(autoFeed.Key.State ?? "00:00:00");
var amount = Convert.ToInt32(autoFeed.Value.State);
Scheduler.RunDaily(feedTime, () =>
{
if (Entities.InputBoolean.Pixelskipnextautofeed.IsOff())
{
FeedCat(amount);
UpdateFeedingRecords(amount, isAutomatic: true);
}
Entities.InputBoolean.Pixelskipnextautofeed.TurnOff();
});
}
}private void ButtonFeedCat()
{
Entities.InputButton.Feedcat.StateChanges().Subscribe(_ =>
{
var amount = Convert.ToInt32(Entities.InputNumber.Pixelnumberofmanualfood.State ?? 0);
FeedCat(amount);
UpdateManualFeedingRecords(amount);
UpdateLastManualFeedTime();
});
}private void FeedCat(int amount)
{
// Update daily total
var dailyTotal = (Entities.InputNumber.Pixeltotalamountfeedday.State ?? 0) + amount;
Entities.InputNumber.Pixeltotalamountfeedday.SetValue(dailyTotal);
// Update lifetime total
var lifetimeTotal = (Entities.InputNumber.Pixeltotalamountfeedalltime.State ?? 0) + amount;
Entities.InputNumber.Pixeltotalamountfeedalltime.SetValue(lifetimeTotal);
// Control physical feeder
Services.Localtuya.SetDp(new LocaltuyaSetDpParameters
{
DeviceId = ConfigManager.GetValueFromConfig("ZedarDeviceId"),
Dp = 3,
Value = amount
});
}- Protocol: LocalTuya integration
- Control: Portion dispensing via data point 3
- Configuration: Device ID stored in config.json
- Portions: Configurable portion sizes (typically 5-15g per portion)
- Protocol: LocalTuya integration
- Monitoring: Usage detection, cleaning cycles, error states
- Controls: Manual cleaning (DP 9), manual emptying (DP 109)
- Status Tracking: Pet usage, cleaning events, error conditions
- Monitoring: Online/offline status detection
- Alerts: Notifications when fountain becomes unavailable
- Recovery: Automatic status checking and alerts
- Manual Feed Button:
input_button.feedcat - Manual Amount:
input_number.pixelnumberofmanualfood - Daily Total:
input_number.pixeltotalamountfeedday - Lifetime Total:
input_number.pixeltotalamountfeedalltime - Last Manual Feed:
input_datetime.pixellastmanualfeed - Last Auto Feed:
input_datetime.pixellastautomatedfeed
- Feed Time 1:
input_datetime.pixelfeedtime1 - Feed Amount 1:
input_number.pixelfeedamount1 - Feed Time 2:
input_datetime.pixelfeedtime2 - Feed Amount 2:
input_number.pixelfeedamount2 - (Additional feeding times as configured)
- Skip Next Feed:
input_boolean.pixelskipnextautofeed - Give Next Early:
input_button.pixelgivenextfeedeary - Clean Litter Box:
input_button.cleanpetsnowy - Empty Litter Box:
input_button.emptypetsnowy
- Litter Box Status:
sensor.petsnowy_litterbox_status - Litter Box Errors:
sensor.petsnowy_litterbox_errors - Water Fountain:
switch.petsnowy_fountain_ison
{
"ZedarDeviceId": "your-zedar-feeder-device-id",
"PetSnowyDeviceId": "your-petsnowy-device-id",
"Discord": {
"Pixel": "https://discord.com/api/webhooks/pixel-channel-url"
}
}- Morning Feed (e.g., 7:00 AM): 8 portions automatic feeding
- Evening Feed (e.g., 6:00 PM): 7 portions automatic feeding
- Manual Treats: On-demand feeding via button
- Daily Reset: Total consumption resets at 23:59
- Next Feed Early: Button to give next scheduled meal immediately
- Skip Feed: Option to skip next automatic feeding
- Manual Override: Direct control of portion amounts
- Usage Detection: Automatic monitoring of litter box usage
- Cleaning Triggers: Automatic cleaning after each use
- Manual Controls: Override cleaning and emptying functions
- Error Handling: Alerts for maintenance issues
- Food Level Monitoring: Alerts when Zedar feeder food storage is low
- Consumption Analysis: Tracks eating patterns and amounts
- Schedule Flexibility: Easy adjustment of feeding times and amounts
- Usage Patterns: Monitors frequency and timing of litter box use
- Proactive Cleaning: Cleaning cycles based on usage
- Health Monitoring: Unusual usage patterns can indicate health issues
Rich notifications with feeding details:
var discordNotification = new DiscordNotificationModel
{
Embed = new Embed
{
Title = "Pixel heeft eten gehad",
Thumbnail = new Location("https://cdn.pixabay.com/photo/cat-icon.png"),
Fields = new[]
{
new Field { Name = "Eten gegeven", Value = $"{amount} porties" },
new Field { Name = "Totaal vandaag", Value = $"{dailyTotal} porties" },
new Field { Name = "Type", Value = isAutomatic ? "Automatisch" : "Handmatig" }
}
}
};- Daily Consumption: Tracks if Pixel is eating normal amounts
- Feeding Schedule: Ensures regular feeding times are maintained
- Device Status: Monitors all pet devices for proper operation
- Feeder Malfunction: Immediate notification if feeding fails
- Litter Box Offline: Alert if litter box becomes unresponsive
- Water Fountain Down: Critical alert for water system failures
- Food Level Low: Warning when food storage needs refilling
- Daily Summary: End-of-day consumption and activity report
- Weekly Trends: Feeding pattern analysis
- Device Health: Regular status updates for all pet devices