Skip to content

Tools to use the Pimoroni Galactic Unicorn as a display for Home Assistant

Notifications You must be signed in to change notification settings

raphv/galactic-home

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Galactic Home

A simulation of the Galactic Home Display

Displaying data from Home Assistant on the Pimoroni Galactic Unicorn

How the setup works:

Tip: This requires some experience with Home Assistant. I've tried to put links to the Home Assistant documentation where I deemed it necessary

Part 1: YAML Configuration Files

This folder contains 2 files:

  • configuration.yaml which contains the lines to be added to the main Home Assistant configuration.
  • template.yaml which contains the display logic to show text and icons on the Galactic Unicorn.

In order to change the configuration of the Galactic Unicorn display without the need for a USB cable, the contents of the display are configured in a YAML file in Home Assistant as a template sensor

This configuration file creates 2 sensors:

  • sensor.galactic_icons, which is a list of 11x9 icons displayed in the middle part of the screen
  • sensor.galactic_home, which has an attribute named display which provides all data used by the galactic unicorn

This configuration allows the Galactic Unicorn to retrieve all data in a single HTTP request.

The configuration provided is an example that displays:

In order to use the doorbell function, you can add it to an automation or script, and trigger the RESTful command defined in configuration.yaml

Part 2: Micropython files for the Galactic Unicorn

  • main.py is the file that is loaded when the Galactic Unicorn launches. It does nothing except call the next Python file.
  • galactichome.py contains the main application logic.
  • gh_visual_assets.py contains additional assets, such as the font used for the clock digits and the HTML code that shows when querying the Galactic Unicorn over the web.
  • gh_config.py where you configure your WiFi network details and the hostname for Home Assistant, among others. You need to generate an API key a.k.a. long-lived access token in Home Assistant to put in this file.
  • wave_player.py a wrapper to play wave files on the Unicorn. Relies on the files inside the lib folder.

Additional files (batteries not included, sorry!) are needed to make it work:

  • Wave files for different times of the day (must be mono, 16-bit, 22050 Hz). Be careful of the limited space on the Pico W. At 43KB/second and less than a megabyte of free space on the controller, you need to keep the total duration under 20 seconds.
  • A wave file for when someone rings the door

Part 3: Web-based utilities

  • icon-maker.html: A tool to create icon codes for the galactichome.yaml
  • display-simulator.html: A tool to try out how the display would look like and export it as SVG.

To-do list/Future features

  • Use it as an alarm (similar to the door bell, but using Pimoroni's synthesizer functions)

About

Tools to use the Pimoroni Galactic Unicorn as a display for Home Assistant

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published