Creating Realistic Moon Phases in Home Assistant

I’ve always been fascinated by the moon and its phases, so I decided to bring that realism into my Home Assistant setup! :full_moon::sparkles: I wanted something more dynamic than the generic moon phase icons, so I came up with a solution using live data from Timeanddate Moonphase. Here’s how I did it:

  1. Extracting Moon Data: I used Firefox’s command line to extract moon phase images from the website. This gives me accurate, real-time moon phases based on my location.
  2. Automating with Bash: I created a bash script that runs via cron job to update the moon phase images daily. This ensures the moon phase is always up-to-date!
  3. Custom Dashboard Integration: I cropped the images to fit my Lovelace dashboard perfectly. The result? A seamless, realistic moon phase display that changes daily! :waning_gibbous_moon::sparkles:

If you’re interested in replicating this, I’ve shared the script and sample outputs on Google Drive. Feel free to modify it to suit your location! :earth_africa::sparkles:

It’s been a fun project, and I love how it adds a touch of nature to my smart home setup. If you give it a try, let me know how it goes! :crescent_moon::heart: