# Control by moon phases

**URL:** <https://community.homey.app/t/control-by-moon-phases/114303>\
**Category:** Questions & Help\
**Created:** [August 12, 2024, 6:38pm UTC](https://community.homey.app/t/control-by-moon-phases/114303 "2024-08-12T18:38:51Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philippe\_Mucher](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philippe_mucher/32/73654_2.png) [@Philippe\_Mucher](https://community.homey.app/u/Philippe_Mucher)\
**Post date:** [August 12, 2024, 6:38pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/1 "2024-08-12T18:38:51Z")

</div>

Heyas fellow home gadget enthusiasts,

I created a moon light that I want to hang in the bathroom that shows and transitions between different lighting set-ups, based on the **current moon phase**. I searched all apps for triggers I could use, I found that the Openweather API gives you the moonphase but I think it is the current phase in text, not a number indicating the transitional stage.  
Also paying for another API is kind of not my thing at the moment.

Anyone know any other apps, or ways, or scripts or anyting?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [August 12, 2024, 6:45pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/2 "2024-08-12T18:45:51Z")

</div>

[This API](https://moon-api.com/) is free for 500 requests/month.

---

<div class="post-metadata">

**Author:** ![Philippe\_Mucher](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philippe_mucher/32/73654_2.png) [@Philippe\_Mucher](https://community.homey.app/u/Philippe_Mucher)\
**Post date:** [August 12, 2024, 6:57pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/3 "2024-08-12T18:57:05Z")

</div>

Wonderful. Thank you!  
Are there any apps using this?

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [August 12, 2024, 8:43pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/4 "2024-08-12T20:43:22Z")

</div>

Can’t find app store imfo, or forum topics regardig moon events.  
But OpenWeather app provides for it.  
This is [an example](https://community.homey.app/t/how-do-i-save-multiple-json-objects-from-an-array-to-multiple-tags/68404/13) of OpenWeather moondata:

```auto
"dt":1707130800,"sunrise":1707116380,"sunset":1707149293,"moonrise":1707104820,"moonset":1707128340,"moon_phase":0.83,"

```

Moon phase is presented as a number 😉

It’s also present @ [OpenWeather app](https://homey.app/a/nu.baretta.openweathermap/), most probably as numeric value as well:

> ![1000020072](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/f/dfd65e165e62e9297c28cb628bbdf750fe9a407e.jpeg)

Just install it to find out, or ask in the OW app topic:

> [@\[App\]\[Pro\] OpenWeather](https://community.homey.app/t/61482):
>
> [[large]](https://homey.app/de-de/app/nu.baretta.openweathermap/OpenWeather/) This app brings the OpenWeatherMap API to Homey. Get current weather data and forecasts for any number of locations. The following weather data is available: Current weather data (and location) Hourly forecasts up to 48 hours Daily forecasts up to 7 days Different values are provided for each variant, such as temperature, air pressure, humidity, weather conditions and many other values. A description of the API and example data can be found at [https://openweathermap.org/api/one-ca…](https://openweathermap.org/api/one-call-api)

---

<div class="post-metadata">

**Author:** ![Philippe\_Mucher](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philippe_mucher/32/73654_2.png) [@Philippe\_Mucher](https://community.homey.app/u/Philippe_Mucher)\
**Post date:** [August 14, 2024, 10:50pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/5 "2024-08-14T22:50:42Z")

</div>

Thank you for that!  
The moon phase card in the app lets you check for 8 phases, it doesn’t pass on the gradient value. But in the end that will work out better, I think, I’m going with it. Thanks again!

---

<div class="post-metadata">

**Author:** ![Philippe\_Mucher](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philippe_mucher/32/73654_2.png) [@Philippe\_Mucher](https://community.homey.app/u/Philippe_Mucher)\
**Post date:** [September 17, 2024, 11:50pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/6 "2024-09-17T23:50:00Z")

</div>

Heyhey @Peter_Kawa Peter,

coming back to this. If I want the numeric float moon phase I am going to have to start sending http calls to openweather or the moon api and parse the return json, correct?  
The 8-slice moon pizza just doesn’t work for me, I need gradual color change in my moonlamp :-/ so I’m back here 🙂

Edit01: I tried with the moon phase changed “when” card, but that also seems to trigger only 8 times a month, when it moves from one pizza slice to the next. I’ve been tracking since last weeks full moon, and it only triggered twice, at 0.59 and 0.7 phase number, to move to waning moon and waning half moon three days later.  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/c/3c2c3182f422020e05ba52bf98e9616b39b3b8ed.png)

---

<div class="post-metadata">

**Author:** ![Philippe\_Mucher](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philippe_mucher/32/73654_2.png) [@Philippe\_Mucher](https://community.homey.app/u/Philippe_Mucher)\
**Post date:** [September 23, 2024, 7:04am UTC](https://community.homey.app/t/control-by-moon-phases/114303/7 "2024-09-23T07:04:43Z")

</div>

Let me ask an actual question. Could anyone help me out and give me a starting point for how to query API’s with flow cards and how to parse the return JSON?

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [September 25, 2024, 8:28am UTC](https://community.homey.app/t/control-by-moon-phases/114303/8 "2024-09-25T08:28:21Z")

</div>

Hi, just read your post. Perhaps it’s better if I add a new numeric capability for the moon phase to OpenWeather app.  
Just as tag and flow trigger hidden in device details.

---

<div class="post-metadata">

**Author:** ![Philippe\_Mucher](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philippe_mucher/32/73654_2.png) [@Philippe\_Mucher](https://community.homey.app/u/Philippe_Mucher)\
**Post date:** [September 25, 2024, 1:54pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/9 "2024-09-25T13:54:12Z")

</div>

> Just as tag and flow trigger hidden in device details.

I don’t know exactly what a hidden trigger is, and I haven’t used tags so far, but if I can use it, I’m up for it. So thank you in advance, @RonnyW !!!

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [September 30, 2024, 8:10pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/10 "2024-09-30T20:10:06Z")

</div>

I will take a look at the moon phase next week. Still on 🏖. So please be patient 🙂

---

<div class="post-metadata">

**Author:** ![Theo\_de\_Koning](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/theo_de_koning/32/136062_2.png) [@Theo\_de\_Koning](https://community.homey.app/u/Theo_de_Koning)\
**Post date:** [January 8, 2025, 5:53pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/11 "2025-01-08T17:53:40Z")

</div>

Now I understand, by here, how JSON is working then Moon-API was the next project.

Sadly I may not get a Plan for them.  
Not directly (Account) or indirectly (Google) because I have no authority to do so.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [January 8, 2025, 6:08pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/12 "2025-01-08T18:08:25Z")

</div>

The moonphase was added to OpenWeather app. Perhaps you can use this?

> [@\[App\]\[Pro\] OpenWeather](https://community.homey.app/t/app-pro-openweather/61482/412):
>
> New test version 1.6.1: added capability and flow trigger for moonpase value (0…1) for OneCall daily forecast.@Philippe_Mucher FYI and to test Based on [Control by moon phases](https://community.homey.app/t/control-by-moon-phases/114303) Testversion:

---

<div class="post-metadata">

**Author:** ![Theo\_de\_Koning](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/theo_de_koning/32/136062_2.png) [@Theo\_de\_Koning](https://community.homey.app/u/Theo_de_Koning)\
**Post date:** [January 8, 2025, 6:30pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/13 "2025-01-08T18:30:44Z")

</div>

Which virtual device have I to take for getting the moon phases?

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [January 8, 2025, 6:36pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/14 "2025-01-08T18:36:50Z")

</div>

The daily forecast (OneCall).  
But first you need a current weather device (OneCall) for your location - needing an OneCall API key and suscription with 1000 calls free.

---

<div class="post-metadata">

**Author:** ![Theo\_de\_Koning](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/theo_de_koning/32/136062_2.png) [@Theo\_de\_Koning](https://community.homey.app/u/Theo_de_Koning)\
**Post date:** [January 8, 2025, 8:39pm UTC](https://community.homey.app/t/control-by-moon-phases/114303/15 "2025-01-08T20:39:49Z")

</div>

In the API for Openweathermap is a lot of data for the weather.

The place for the data is Amsterdam. Not really local.

After the current situation is there for 1 hour precipitation/minute  
Then hourly data for 48 hour.  
And last for 7 day temperature for the parts of the day and min & max  
There are also some Moon data: rise & set and moon\_phase.

That’s not what I was looking for and it took a lot of time in the effort to find out.
