GitHub - jwardbond/forecats: Daily cat pictures on your home assistant server

4 min read Original article ↗

Wake up every morning (more) excited to look at the forecast! This is a custom Home Assistant integration which uses forecast data, pictures of your pets, and Google's Nano Banana API to generate and serve weather-themed drawings of your precious babies every morning.

Blog post here.

A picture of two cats and a snowy, cloudy forecast combine to make a drawing of two cats in scarves looking out a window

Features

  • Home assistant integration to generate pictures
  • Customizable automation template to control drawing styles, generation times, etc.
  • Optional optimization for E-ink screens (currently limited to spectra6 panels)

Examples

You can display it on an e-ink screen

A cat in front of an e-ink screen

Or on your HA Dashboard

Home Assistant app screenshot

Works in better weather

Two cats with sunglasses

Getting Started

Warning

This will cost money. You get (I think) $300 of Gemini credits upon sign up, but eventually you will have to pay ~$0.14 every time this runs.

Requirements

Setup

Option A: Install via HACS (recommended)

  1. Install HACS if you haven't already.
  2. In HACS, click Custom repositories and add https://github.com/jwardbond/forecats with category Integration.
  3. Search for "Daily Forecats" in HACS and install it.
  4. Restart Home Assistant, then continue from step 2 below.

Option B: Manual install

Do the following in your HA server, using the Terminal & SSH addon, or docker exec if you are running a container on a host system

  1. Create the necessary directory structure in your Home Assistant server:
mkdir -p /config/custom_components && mkdir -p /config/forecats_data/input_images
  1. Download and copy the integration files
cd /tmp && git clone https://github.com/jwardbond/forecats.git && cp -r forecats/custom_components/forecats /config/custom_components/

  1. Select and upload pet images using one of the following workflows:

Option 1 — Media Browser (no SSH required, recommended for new users)

  • In HA, go to Media > Local Media and create a folder called forecats.
  • Upload your pet photos directly from the browser.
  • In the blueprint, set Input image directory to /config/media/forecats and leave Input image paths blank.

Option 2 — Legacy directory (existing users)

  • If you already have images at /config/forecats_data/input_images/, no change needed.
  • Set Input image directory to /config/forecats_data/input_images/.

Option 3 — Explicit paths

  • Provide a list of exact file paths via Input image paths (useful when you want fine-grained control over which images are used).
  • input_image_dir and input_image_paths can be used together; images from both sources are merged.

In all cases: choose clear photos of your pets and rename the files so the pets' names are in the filenames.

  1. Enable the custom integration by adding forecats: to your configuration file:
# configuration.yaml

default_config:

# ...existing data

automation: !include automations.yaml

forecats:
  1. Set up the automation using one of the following options:

Option A: Blueprint (recommended)

  • Go to Settings > Automations & Scenes > Blueprints and click Import Blueprint.
  • Paste the URL: https://github.com/jwardbond/forecats/blob/master/blueprints/automation/forecats/forecats.yaml
  • Create an automation from the blueprint and fill in your details.

Option B: Manual

  • Copy the automation template into config/automations.yaml.
  • Fill out or remove any <> placeholders.
  1. Restart your server

That's it! Every morning at 5:00 am, the forecats integration will generate the following images in the config/www/daily_forecats/ directory:

  • forecats_original.png: the unprocessed output image from Gemini
  • forecats_optimized.png: the output image cropped to your desired size and adjusted for display on your screen (currently only supports color adjustments for Spectra6 e-ink)

These images should be accessible on your local network at (e.g.): <YOUR HA URL>/local/daily_forecats/forecats_original.png

Note

It takes 10-30 seconds for gemini to generate the image. If you have any automations grabbing the image, then I recommend setting them to run a minute after the generate forecats autmation is set to run.

Note

To test the automation, go to developer tools > actions > generate forecats and run it manually.

Local Testing

I got annoyed testing out new prompts on HA, so I made a folder to experiment locally. If you would like to use it:

  1. Clone the repo and enter the testing folder:
git clone https://github.com/jwardbond/forecats.git && cd forecats/local_testing
  1. Add your cat images to the forecats_data/input_images folder.
  2. Create a .env file with your Gemini API key.
  3. Copy the data from your automation into test.py.
  4. Run:

(Optional) Sending to an e-ink screen

You will need a screen controllable with ESPHOME. I used seeed studio's e10002 spectra6 display. I've included the esphome config I use here. The basic idea is to set the automation to run every day at a 5:00 am, and have the screen wake up every day slightly before that, download the picture at 5:01 am (to leave time to generate), and then go into deep sleep until the next day.

TODO

  • Enrol in HACS for easier install
  • Option to save images to dir
  • Make automation into blueprint for easier install
  • Separate e-ink instructions
  • See if I can make it more configurable from GUI
  • Support for multiple cities