github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/doc/content/en/docs/plugins/moon.md (about)

     1  
     2  ---
     3  title: "Moon"
     4  linkTitle: "moon"
     5  date: 2021-10-20
     6  description: >
     7    
     8  ---
     9  
    10  {{< figure src="/smart-home/moon1.png" width="300" >}}
    11  
    12  &nbsp;
    13  
    14  &nbsp;
    15  
    16  In the **Smart Home** system, there is a "moon" plugin that allows displaying various parameters related to the phases of the moon and its position in the sky. This plugin provides access to the following parameters:
    17  
    18  1. `horizonState`: The `horizonState` parameter indicates the moon's state relative to the horizon. It can be either "aboveHorizon" or "belowHorizon".
    19  
    20  2. `phase`: The `phase` parameter displays the current phase of the moon. For example, "new_moon", "waxing_crescent", "first_quarter", "waxing_gibbous", "full_moon", "waning_gibbous", "third_quarter", "waning_crescent".
    21  
    22  3. `azimuth`: The `azimuth` parameter indicates the azimuthal position of the moon in degrees.
    23  
    24  4. `elevation`: The `elevation` parameter displays the angle of elevation of the moon above the horizon.
    25  
    26  5. `aboveHorizon`: The `aboveHorizon` parameter indicates whether the moon is above the horizon (true/false).
    27  
    28  6. `belowHorizon`: The `belowHorizon` parameter indicates whether the moon is below the horizon (true/false).
    29  
    30  Additionally, the "moon" plugin has settings `lat` and `lon`, which allow specifying the latitude and longitude for determining the moon's position in the sky.
    31  
    32  Here's an example of using the "moon" plugin to retrieve moon parameters:
    33  
    34  ```javascript
    35  const moonParams = EntityGetAttributes('moon.moon1')
    36  console.log(moonParams.horizonState);
    37  console.log(moonParams.phase);
    38  console.log(moonParams.azimuth);
    39  console.log(moonParams.elevation);
    40  console.log(moonParams.aboveHorizon);
    41  console.log(moonParams.belowHorizon);
    42  ```
    43  
    44  You can use these parameters to display information about the moon in your **Smart Home** project.