I always want to have a more realistic moon “phase” and its orientation shown on my HA and website, instead of a “guestimate” phase with fixed orientation. Ideally, it could be derived by mathematic formula to come up with a svg file; but I don’t have enough knowledge to do it. Therefore, I managed to crop the moon phase and its information from an excellent website which displays “live” moon phase, based on your location: Timeanddate Moonphase . You need to change the url to reflect your location.
Here is the end result shown on my Lovelace dashboard:
What I did (on my ubuntu server) is to use Firefox command line to extract part of the website, and command line to further crop it to my liking. All being done by a bash script and cron job.These are all the cropped images which I can use for several projects:
Thanks for your interest. The latest links are here: http://gofile.me/6oR3C/STX7vvluk http://gofile.me/6oR3C/L7r6cQxTF http://gofile.me/6oR3C/CBtGkWEi0
Two of the above links are two bash script files. The other is output from the first script file. I do not include all other output cropped images as shown in previous post.
Please also note that the bash scripts also include other screenshot (skychart) which part can be deleted before you use it.
Please also bear in mind the moon phase full website was revised a few times since my post here. The latest change was in Dec 2020. I need to adjust the cropping positions every time the original layout changes. The link to the script above should produce the correct cropping because I’m still using them.
Good luck
Hi,
Since I posted this, I have revised the way to get such Moon phase without much worrying about potential changes on the source website (timeanddate.com) in the future. I also have 2 other ways to produce a more realistic Moon phase with the right phase orientation as seen from your location. All three methods are described in more details, with downloadable codes, in my blog here: How to create a Moon Phase with correct phase orientation as seen from your location
Here is the output sample produced by the three methods I mentioned.
Scheduling to produce the Moon phase image file and copy it to home assistant config folder every, say, 5 minutes. Create a Glance card and specify an entity named “camera.moonphasefilename” without .png