Moon phases

Moon phases information

  - platform: rest
    resource: https://api.ipgeolocation.io/astronomy
    name: Moon API
    scan_interval: 1200
    params:
      apiKey: !secret ipgeolocation_api
      latitude: !secret latitude
      longitude: !secret longitude
    json_attributes:
      - date
      - current_time
      - moonrise
      - moon_status
      - moon_altitude
      - moon_distance
      - moon_azimuth
      - moon_parallactic_angle
    value_template: >
      {% if value_json.moon_altitude > 0 %}
        up
      {% else %}
        down
      {% endif %}
    icon: >
      {{ state_attr('sensor.moon', 'icon') }}            

Card:

type: custom:card-templater
card:
  type: custom:compass-card
  indicator_sensors:
    - sensor: sensor.moon_api
      attribute: moon_azimuth
      indicator:
        type: circle
        color: black
        show: true
      state_abbreviation:
        show: false
  value_sensors:
    - sensor: sensor.moon_api
      attribute: moon_altitude
      decimals: 1
      state_value:
        show: true
        color: yellow
  compass:
    circle:
      background_image_template: /local/pictures/moon_phases/{{states.sensor.moon_phase.state}}.png
      background_opacity: 0.8
    north:
      show: true
    east:
      show: true
    west:
      show: true
    south:
      show: true
entities:
  - entity: sensor.moon_phase

Good idea.

Edit: Deleted the rest as OT

Thanks, I’ll try it.

Hi all,

does anyone know, if you can also request the data for a specific date and time? e.g. the azimute and altitude for the date: “2024-12-24” at “22:00”? How is the syntax of the api-call to ipgeolocation?
Spartacus