mishaaq / sun-card Goto Github PK
View Code? Open in Web Editor NEWLovelace card for sun component - Home Assistant
License: MIT License
Lovelace card for sun component - Home Assistant
License: MIT License
Describe the bug
The moon phases are seen differently in the Northern and Southern Hemispheres. There needs to be a capability where the hemisphere can be specified. See link: moon phases
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
The phases are shown based in the hemisphere of the location of home assistant instance.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
I'm probably missing something here, but the Sun card seems to be properly installed in HACS, but I still can't find it when trying to add a new card on lovelace.
Everything is updated and running on the most recent versions, no significant errors in the logs and I already rebooted several times after install.
Describe the bug
When language set to "Norwegian Bokmål" on the user profile, the card crashes due to unkown language code "no". If I change it to English the card works as expected.
To Reproduce
Click on your name in left menu and change to language "Norwegian Bokmål". Go back to the view where you have added the card and you will see that it doesn't render. In developer tools, you will find this:
Uncaught (in promise) Error: No language undefined.
doHumanization sun-card.js:452
humanize sun-card.js:452
renderDaylight sun-card.js:700
render sun-card.js:620
update sun-card.js:186
update sun-card.js:616
performUpdate sun-card.js:148
_enqueueUpdate sun-card.js:148
_requestUpdate sun-card.js:148
initialize sun-card.js:148
initialize sun-card.js:186
J sun-card.js:148
ne sun-card.js:186
a sun-card.js:616
createElement ute:1
s chunk.c136a66895309b59c3fe.js:13138
d chunk.c136a66895309b59c3fe.js:13138
d chunk.c136a66895309b59c3fe.js:13138
l chunk.c136a66895309b59c3fe.js:13138
Vt chunk.c136a66895309b59c3fe.js:12159
value chunk.c136a66895309b59c3fe.js:23707
value chunk.c136a66895309b59c3fe.js:24142
value chunk.c136a66895309b59c3fe.js:23707
n app.664a8247.js:1
d chunk.c136a66895309b59c3fe.js:13138
sun-card.js:452:212500
_enqueueUpdate sun-card.js:148
InterpretGeneratorResume self-hosted:1478
AsyncFunctionNext self-hosted:684
(Async: async)
_requestUpdate sun-card.js:148
initialize sun-card.js:148
initialize sun-card.js:186
J sun-card.js:148
ne sun-card.js:186
a sun-card.js:616
createElement ute:1
s chunk.c136a66895309b59c3fe.js:13138
d chunk.c136a66895309b59c3fe.js:13138
d chunk.c136a66895309b59c3fe.js:13138
l chunk.c136a66895309b59c3fe.js:13138
Vt chunk.c136a66895309b59c3fe.js:12159
value chunk.c136a66895309b59c3fe.js:23707
value chunk.c136a66895309b59c3fe.js:24142
value chunk.c136a66895309b59c3fe.js:23707
n app.664a8247.js:1
d chunk.c136a66895309b59c3fe.js:13138
Expected behavior
Fallback to a defined language if the card stumbles upon a unknown language. I would guess english is a good default language.
Desktop (please complete the following information):
Additional context
If given pointers to where I should add translations for "no" I can submit a PR
It's a nice graphical representation of the sun's elevation, but where do I see the current elevation as a number?
If this isn't available yet, I think it's a nice feature to add as I wanted to use this card to help me to decide what elevation to use to trigger my lightning automation.
Hello -
Thank you for the awesome work. I have a quick question: I've been trying to find a solution online, but have yet to do so.
I've configured Sun2, and the data is correct, as seen in the attached screen grab from the Developer's Tool. However, the displayed Sunrise info in the card is wrong - it adds a little to it each day, i.e. 13 hours 46 minutes will become 13 hours 52 minutes the following day. But the sunrise displayed info is wrong. I have also added a screen grab of the card configuration.
The sunrise info never gets below 13 hours.
I would greatly appreciate any assistance.
congrats for this !
i would suggest that 👍
Describe the bug
A clear and concise description of what the bug is.
The card does not work with HA 0.110. Nothing is displayed.
To Reproduce
Steps to reproduce the behavior:
Upgrade to HA 0.110
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Describe the bug
When sun-card is configured to show time using Clock format
24h it does not include leading 0.
To Reproduce
Expected behavior
Numbers under 10 usually have a zero in front as described in Wikipedia 24-hour clock. For example in the screen show below 6:10
should be 06:10
.
Desktop (please complete the following information):
Hello.
I'm using the card with sun2, moon sensor and the required time_utc sensor as well.
It seems that the "sunEntity.to_sunset.humanize(true)"
(line 192 of the card.ts) is using the fallback to english instead of the localized version. I find it quite strange, since the other information related to the daylight is displaying in the correct localized language.
I've tried other languages as well, but it's always using the english fallback.
Unfortunately I'm not sure if this problem is related to this card, the sensor or the humanize-duration itself.
Hi,
If I use your nice Integration on my Dashboard within a browser on a remote raspberry pi 3. I face an very high cpu load for it.
For trying to get an evidence that it comes realy from ha-sun2, I put the integration onto a new blank tab Page as the only element and all Time I switch onto that tab the Raspberry CPU load is going up to 75% - 90%. If I switch back to other Stuff on parallel Pages e.g. Weather or mini media panel it is alway goes down to less then 5% to 10% of CPU load.
If I let the browser window on that tab with your integration, CPU load raises until the raspberry shows up a temperatur alarm on the upper right corner.
I did no special configuration for the configuration on lovelace:
entities:
max_elevation: sun.sun
moon: sensor.moon
noon: sensor.solar_noon
sunrise: sensor.sunrise
sunset: sensor.sunset
meridiem: false
name: Sonnenstand
type: 'custom:sun-card'
Do someone have the same behavier or a hint to prevent it ?
Describe the bug
Unfortunately I can't see the Moon on the Custom Lovelace Card.
After updating the Sun-Card to the latest version (also version 4.0) is simply isn't present.
Browser has been cleaned an also different browsers has been used for testing.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The Sun-Card should show the Moon Position, but isn't.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional
What you mean by "UI is updating" - it occurs from time to time or it happens after page refresh or after after changing the UI config (card or whole UI?)?
When refreshing the UI (pulling down on ios apps (iPhone or iPad) , I havent seen it on chrome yet)
While individual cards are updating assync, the yellow message appears for a couple of seconds, then is replaced by the sun card wich displays correctly (albeit missing moon sensor).
Originally posted by @hugo929 in #16 (comment)
Describe the bug
Using Sun2, configuration:
entities:
max_elevation: sensor.max_elevation
noon: sensor.solar_noon
sunrise: sensor.nextsunrise
sunset: sensor.nextsunset
time: sensor.date_time_utc
meridiem: false
name: Sun
type: 'custom:sun-card'
The time to the predicted sunrise is missing and the predicted time to sunset is way off. This was taken at 22:21 local:
Expected behavior
Accurate times to the next sunrise/set
Screenshots
As above.
Desktop (please complete the following information):
Additional context
Sun2 configuration:
- platform: sun2
monitored_conditions:
- astronomical_dawn
- sunrise
- solar_noon
- sunset
- astronomical_dusk
- civil_daylight
- civil_night
- max_elevation
I've tried using the local time_date sensor but this made no difference.
My timezone (UTC+11) is set correctly as I have other sensors that depend on this and they are operating correctly.
Its possible to get moon data from ipgeolocation.io like:
- platform: rest
resource: https://api.ipgeolocation.io/astronomy?apiKey=MyKey&location=MyTown,MyCountry
name: Moon API
scan_interval: 1200
json_attributes:
- date
- current_time
- moonrise
- moonset
- moon_status
- moon_altitude
- moon_distance
- moon_azimuth
- moon_parallactic_angle
value_template: '{{value_json.moon_status}}'
date: 2022-11-24
current_time: 19:32:50.036
sunrise: 08:36
moonrise: 09:44
moonset: 15:09
moon_status: -
moon_altitude: -26.863470965430853
moon_distance: 364301.28898391494
moon_azimuth: 265.84440759063875
moon_parallactic_angle: 27.564141243389596
friendly_name: Moon API
Would be nice to see the Moon path in your card.
Hello, I'd first and foremost like to say I really enjoy your component and I have been waiting for something like this!
I'm having a small bit of trouble though. The card only display's Sunset. I know there's been some talk of an issue with the default sun component but there wasn't any indication of this affecting your component. Any ideas? Thanks!
Hardware: Raspberry Pi 3
System: HassIO
System Version: 0.92.2
Installation Method: Automatic - Custom_Updater
Card Version: 2.0
Describe the bug
After updated to 4.0 release with this configuration:
- type: custom:sun-card
name: Sole
meridiem: false
entities:
elevation: sun.sun
max_elevation: sun.sun
sunrise: sensor.sunrisetoday
sunset: sensor.sunsettoday
moon: sensor.moon
I don’t see any of the above sensors displayed in the card…
Desktop (please complete the following information):
First text size for AM/PM is too big
Add possibilty to disable AM/PM text
Add possibility to change to 24 hrs display
used config
card:
name: ' '
type: 'custom:sun-card'
style:
background-repeat: no-repeat
background-size: 100% 100%
border: 'solid 1.5px # rgba(57,128,228)'
border-radius: 10px
'--sc-sunbeam-color': white
'--sc-event-line-color': white
'--sc-horizon-color': null
'--sc-background': >-
linear-gradient(rgba(1, 1, 254, 0%), rgb(0, 191, 255) 46%, rgb(0, 250,
124) 54%, rgba(11, 1, 40, 0%))
type: 'custom:card-modder'
Describe the bug
I have sun2 installed and configured, however I've got an entity_namespace
setup to group the sensors that it creates - this prevents this card from using the sun2 sensors because the sensors the card is looking for is hard-coded
To Reproduce
Steps to reproduce the behavior:
Additional context
It would be good to be able to specify the names of the sensors required rather then relying on hardcoded values
Describe the bug
I want to get rid of the shadows seen at the top/bottom of the image. In the image below the shadows are purple, due to the theme I am using. In the default theme, the shadows are white.
I was trying to set box-shadow, background and the sc-background manually but that didn't solve the issue. It's most likely to be caused by the linear gradient opacity set in the background, but I cannot get it to work at opacity=1.
Can you point me in the right direction?
Also such behavior can me optional to anyone that would want it.
One of the coolest Lovelace cards!
If I may forward my wish list:
Cheers.
Describe the bug
The name:
field is optional, but blank or unset values do not hide the name from the card
To Reproduce
name:
property to False
or comment it out entirely in the configSun
still showing up on the card.Expected behavior
I would expect that a value of False
or an unset value would hide the label/name from the card
Additional context
I am trying to achieve a dense lovelace UI for a project. Every vertical pixel matters and i would like to reclaim the pixels that the name:
takes up.
Describe the bug
Moon sensor is not displayed
To Reproduce
Lovelace
- entities:
max_elevation: sun.sun
moon: sensor.moon
noon: sensor.solar_noon
sunrise: sensor.sunrise
sunset: sensor.sunset
meridiem: false
name: Soleil
type: 'custom:sun-card'
Sensors
sensor
- platform: moon
Config:
arch | x86_64
dev | false
docker | true
hassio | true
os_name | Linux
python_version | 3.7.6
timezone | America/Toronto
version | 0.105.5
virtualenv | false
Sunbeam animation is not visible in FF 68.0.1 despite it works in Chrome.
After upgrade to HA 2021.3.0 the following warning is given:
2021-03-04 09:29:54 WARNING (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'sun2'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'sun2'
hello
i have installed like this
UI:
file on the corresponding folder
created card with
type: 'custom:sun-card'
name: Sol
but does not work...returns unavaiable entity
what can i do
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.