Enhanced Sun component

this might be a bug:

Scherm­afbeelding 2023-11-14 om 09.04.50

identical attributes too.

Those translations were provided by another user who had first requested internationalization support. I don’t speak that language, so I can’t comment. :smiley:

I did think about this, and even tried to make the names & entity IDs closer to what it was before, but I started having to override code from the core implementation, and it just seemed too shaky and risky and could break at any time, so I just “went with the flow.” I know it’s different, but it seems to be more like what the core team would want and how other things work. And, besides, I had to make sure not to have conflicts with the standard sun integration, which people might (and probably are) still be using.

Yeah, I might try to translate the default names for these other types of sensors. Not sure how easy that will be.

That’s because it will only update entries if they change in YAML, but will not delete entries that were previously in YAML. Once items get added, the only way to get rid of them is via the Settings page.That is on purpose, and the main reason is, I eventually hope to allow adding entries, and reconfiguring them, via the UI.

I can look into those, but the docs seemed to imply this requires frontend support and currently only works for climate entities.

You can still use the older style config. If you add these back in using the older style config, do they have the same values as these, or are they different and more like you expect?

yes those are as expected:

compared to the new format, which somehow does not see the correct ‘setting’

Weird. I just tried it myself and they provide the correct results (i.e., the values of the new entities are the same as the old.)

What version are you using? 3.0.0b2?

Can you share privately your location configuration (e.g., send me a copy of your .storage/core.config file)?

yes, I just updated, and it made no difference.

sure.

wait, I decided to give it another restart:

seems pitch perfect now?

Ok. It might have been one of the bugs fixed in b2, and after upgrading, it needed a restart to apply???

Let me know if you notice any other problems. I’ll look into translating those default names and attributes.

1 Like

need to have a chat with Metbril as he concocted these translations, and to me ‘Zonne-middernacht’ makes no sense as there is no sun since setting… why just not call it Middernaght

unless the Solar aspect needs to be included in all entities ofc.

            "solar_midnight": {
                "name": "Zonne-middernacht"
            },
            "solar_noon": {
                "name": "Middagzon"
            },

replace with

            "solar_midnight": {
                "name": "Middernacht"
            },
            "solar_noon": {
                "name": "Middagzon"
            },

One could even argue that Middag would suffice, as it literally means mid day.

Well for translation purposes in English the names are indeed known significant astronomical terns.

For instance ‘noon’ refers to 12:00

Solar Noon is the point when the sun is at its highest point overhead for your specific point on the globe and they don’t necessarily match up.

Id bet there are specific translation for each term.

Yes just looked up a few translations. The full terms are significant. I don’t know if they’re CORRECT but the full term is required.

I’ll let those of you that use the nl language setting hash this out. For now, it seems I should leave it as it is.

Released 3.0.0b3

There was a bug that would prevent the time_at_elevation sensors whose direction is setting from working properly if the sun2 config was removed from the YAML configuration. This release fixes that bug.

1 Like

Released 3.0.0b4

Add translations for default names of “non-simple” entities. Also allow configuration to contain just:

sun2:

which is equivalent to:

sun2:
  - unique_id: home

Plus, some internal reorganization.

Released 3.0.0b5

This is a BREAKING CHANGE.

See Release for details.

Released 3.0.0b6

Adds reload service (sun2.reload), which also adds SUN2 to the Developers Tools → YAML page.

This is the last beta release, unless I need to fix any issues found. After a few days, I’ll release it as 3.0.0.

Released 3.0.0b7

Ok, so it wasn’t the last beta. :sweat_smile:

I realized not all languages have the same sentence structure, so instead of translating individual words in some cases, I changed it so they are always complete sentences or phrases and added placeholder support to substitute in dynamic values.

Hopefully my brain will take a break now and this will be the last beta release (barring fixes.)

If anyone would care to provide additional feedback on the nl.json translation file, or would like to provide a translation file for another language, I’d really appreciate the help. You can send your suggestions to me, or better yet, create a PR against the config_flow branch in the repo.

Released 3.0.0b8

And yet another beta release! :laughing:

I decided to go ahead and implement UI based config flow, including reconfiguration of “locations” created via the UI.

Having sun2: in the YAML configuration is no longer required, although it’s still supported.

Also, for locations entered via YAML, if they are removed from YAML, they will be deleted. So, if you want sensors defined in YAML, leave them in the YAML config.

And speaking of YAML configuration, the following will no longer create the “home” location by default:

sun2:

If you want that, you need to have at least:

sun2:
  - unique_id: home

The translations files are now quite large. For nl.json, I did a first pass using Google translate. I’d really appreciate any feedback.

And, as always, please let me know how it works if you give it a try, good or bad.

Removing release 3.0.0b8

I forgot to update the version in manifest.json. I will release 3.0.0b9, which is equivalent to what 3.0.0b8 was, but with some minor tweaks/fixes.

UPDATE:

Released 3.0.0b9

1 Like

only bugger is all my entities now have new names and no easy way to rename so I had to screw around changing automations etc. but otherwise all good.

Yeah, the names and entity IDs kind of had to change. Long story.

You could always change either or both via the entity registry (i.e., via the Settings option on the entity’s “more info” dialogue, or, if you know how, via editing .storage/core.entity_registry directly.) Or just adjust to the new names & IDs as you said.

I’ve done a lot of testing, but I might have missed something. By all means, let me know if you run into any issues.

Also, I’m still looking for feedback on the translation files, or input for new translation files. (That comment is for everyone. :smiley: )

Thanks for giving it a try and providing feedback. It’s much appreciated!

1 Like

I toyed with doing that but eventually this bites you on the ass so it’s better to take the pain upfront

Released 3.0.0b10

  • Additional entities configured can now be removed without having to remove an entire location.
  • Use only newer style selectors. Specifically, latitude & longitude are now specified via a map.
  • Miscellaneous fixes & enhancements.
1 Like