should be in configuration.yaml … which I did.
But I don’t see any of the values that the sensors was supposed to return.
I just want to create an entity card that shows the moon phase and an image of it.
Appreciate help since I am not so good in yalm coding … an example of moon phase entity card would help.
Did you restart Home Assistant after adding the Moon integration? You need to restart before Home Assistant detects the addition of the Moon integration.
OK - I moved
sensor:
- platform: moon
to another place in the ‘configuration.yalm’ and now the moon showed up
Good. That explains the original problem you presented in your first post: you probably have TWO instances of sensor: in your configuration.yaml file.
However, you indicated you moved everything, including the word sensor: so that means your configuration.yaml file may still contain TWO instances of the word sensor: and you definitely don’t want that. Ensure you only have ONE instance of sensor: in your file.
The issue with moon-phase images is a completely separate problem. The names of the image files must match the Moon sensor’s state exactly. For example, the current moon phase is waning_gibbous so, according to your template, the image file’s name must be waning_gibbous.jpg otherwise it will not be found.
You provided the names of two image files:
NWaxingGibbous.jpg
NFirstQuarter.jpg
As far as I know, the Moon sensor’s state will never be “NFirstQuarter” and so those image files will never be used by the card. The Moon sensor is likely to indicate first_quarter. Either rename the image files to match what the sensor reports, or create a more sophisticated template that converts the sensor’s state (first_quarter) to match the image file’s name (NFirstQuarter). My choice would be to rename the files.
EDIT
In addition, I believe the correct path begins with /local/ as opposed to /config/www/.
Assuming you rename the image files to match Moon sensor’s states, this should work:
Thanks for the clarification.
I understand where I missed in the moon images but I don’t get the configuration.yalm correct … tried several times but still gets error.
Here is my original configuration.yalm …
Thanks for your support … now everything works like a Swiss clock.
I got also the moon images to work … though I have a question.
The moon phase is displayed in English (‘waning_gibbous’) … I want to translate it to Swedish.
Not sure how that can be done in configuration.yalm … guess it has to be done in value_template
Glad to hear that it works well. Please consider marking my post (above) with the Solution tag. By doing that, it will automatically place a check-mark next to the topic’s title which indicates, to other users, that this topic is resolved. It will also place a link under your first post that leads to the post containing the Solution. All of this helps other people find answers to similar questions.
I would do it like this (replace Måne with the actual Swedish terms) :
Do you know or if you have and idea how to validate what will be the next “moon.phase” tomorrow or in x days?
I’d like to do something like that:
IF in x days Moon Phase EQUAL Full Moon THEN
Hey honey… Full moon is coming !
ELSE
IF Today is the Full Moon THEN
My sweet LOVER, today is your lucky day
ELSE
Just another day
ENDIF
ENDIF