Lovelace: Sun Card

Still having problems with my sensors.
With this configuration of the card:

              - type: custom:sun-card
                name: null
                meridiem: false
                entities:
                  elevation: sun.sun
                  max_elevation: sun.sun
                  sunrise: sensor.sunrisetoday
                  sunset: sensor.sunsettoday
                  moon: sensor.moon

I get this in UI

Schermata 2020-02-27 alle 13.04.18

Is that correct?

EDIT:
If i use this configuration:

                entities:
                  elevation: sun.sun
                  max_elevation: sun.sun
                  sunrise: sun.sun
                  sunset: sun.sun

I get this:

Schermata 2020-02-27 alle 13.12.21

But cannot see the moon…

I have the same problem with the missing moon.

What does the code look like if you display this in the new “card-mod” card (
since the old “card modder” card is no longer supported) ? Somehow it doesn’t work for me.

I’ve added issue on your Git - please let me know if you need additional information :slight_smile:

Is it possible to change sunrise and sunset icon and time color (above the event lines)? Thank you.

Hi

Great card.

I have a question.

Sunset shows an hour ago when sunset is actually 18:06.

It is using UTC not local time. How can I fix this?

Screenshot 2020-03-11 at 18.06.46

Also, there is no moon phase

sensor.time and sensor.moon shown for reference.

This is my card config:

entities:
  max_elevation: sun.sun
  moon: sensor.moon
  noon: sensor.solar_noon
  sunrise: sensor.sunrise
  sunset: sensor.sunset
  time: sensor.time
  moon_phase: sensor.moon
meridiem: false
name: Sun
type: 'custom:sun-card'

Otherwise super useful. Thanks

Please use sensor that provides current time in UTC, as sun component’s values are in UTC.

Thanks
That solved the time to sunset/sunrise issue.

The moon is still not visible.

With reference to the Moon not appearing, the browser is throwing this error:

Screenshot 2020-03-15 at 18.00.47

Looking at line 374, ‘waning_gibbous’ is missing from the constant t definition. I added it after ‘Full Moon’ and hey presto it showed up. But it goes away when you refresh the page.

In any case that is probably the cause of the disappearance of the moon.

Hey @mishaaq,
I updated to the latest Sun Card as to your close of the issue on Github with the Moon not being present.
Unfortunately it is still not shown. I even tried removing your card and reinstalled it - but no luck.
I see this in my console:

image

What am I missing / what have I not read :blush:?

I have the same errors with the latest version (4.3.0)

Could you guys show me the card config and a state of moon sensor from dev tools once again?

I don’t know if thsi helps or just confuses the issue, but I didn’t see the moon on my card either. My card configuration is:

entities:
  max_elevation: sun.sun
  moon: sensor.moon
  noon: sensor.solar_noon
  sunrise: sensor.sunrise
  sunset: sensor.sunset
  moon_phase: sensor.moon
meridiem: false
name: Sun
type: 'custom:sun-card'

Then I noticed that in the visual editor the entry under Moon in just said “Moon” unlike the the other entries which had sensor.??????? entries. I reselected from the dropdown list sensor.moon and now the moon shows up on my card.

Great! As you see, there are two entries related to moon phase in your configuration, but only the latter is the proper one. I discovered the README file was still containing the former name of the entry. I’ve updated the file. Probably this is the reason why some guys have problems with the moon phase.
Please configure the card using graphical editor to mitigate the risk of improper config.

Did you guys solve it?

It worked for me using UI editor and/or:

  moon_phase: sensor.moon

and not

  moon: sensor.moon
1 Like

Yes, it now works! Great… thanks.

Great plugin.
I Never got it working. So I thought, IL try again. A few net updates I saw. Removed the old version and started all over again. followed the installation manual.
Installed it via Hacs. so 50% of step 3 is done. But the last part I did not get.
What do you mean with “and update lovelace configuration accordingly”
I have no clue what I have to do. Can anyone point me in the right direction? I feel I`m missing a small step.

Greetings
Palermo.

You have to have sun and date entities available. Have you enabled ‘sun’ and ‘date_time’ integrations?

Hi, I’m trying to get the styles to work but for some reasons the options I set get simply ignored. Here’s my configuration:

type: 'custom:sun-card'
entities:
  time: sensor.time
  moon_phase: sensor.moon
  sunrise: sensor.sunrise
  sunset: sensor.sunset
style:
  '--sc-sunbeam-color': white
  '--sc-sun-color': blue
  '--sc-horizon-color': orange
animation: true
meridiem: false

What do I do wrong? Thanks in advance for your help, this plugin is really cool!