Thanks a bunch Tom, that fixed it, i ought to pay more attention to details.
For the rest, i have corrected below.
- platform: template
sensors:
moonphases:
entity_id: sensor.moon
friendly_name: 'Moon'
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 %}
EDIT: i missed the double {{ }} on the value template, corrected now.