I couldn’t add an update to this older post : Moon Platform, so I created this new topic. Maybe not the way to go, but I saw no other option.
More than a year later, the component moon python code did change a little bit, so that the given solution did not work anymore out of the box.
(https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/sensor/moon.py#L68)
Working configuration at the moment of writing: add this to your configuration.yaml file under the sensor entry:
See the older post for more pre-information.
sensor:
# the original moon component
- platform: moon
# the template for the moon phase pictures using the original moon component
- platform: template
sensors:
moon_phases:
entity_id: sensor.moon
friendly_name: 'FillHereYourOwnSensorName'
value_template: '{{ states.sensor.moon.state }}'
entity_picture_template: >-
{% if is_state('sensor.moon', 'new_moon') %}
/local/MoonPhases/NNewMoon.jpg
{% elif is_state('sensor.moon', 'waxing_crescent') %}
/local/MoonPhases/NWaxingCrescent.jpg
{% elif is_state('sensor.moon', 'first_quarter') %}
/local/MoonPhases/NFirstQuarter.jpg
{% elif is_state('sensor.moon', 'waxing_gibbous') %}
/local/MoonPhases/NWaxingGibbous.jpg
{% elif is_state('sensor.moon', 'full_moon') %}
/local/MoonPhases/NFullMoon.jpg
{% elif is_state('sensor.moon', 'waning_gibbous') %}
/local/MoonPhases/NWaningGibbous.jpg
{% elif is_state('sensor.moon', 'last_quarter') %}
/local/MoonPhases/NLastQuarter.jpg
{% elif is_state('sensor.moon', 'waning_crescent') %}
/local/MoonPhases/NWaningCrescent.jpg
{% endif %}