Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moon phase integration not recognized after 2024.4 update #122

Closed
Nakiros opened this issue Apr 4, 2024 · 49 comments · Fixed by #127 or #134
Closed

Moon phase integration not recognized after 2024.4 update #122

Nakiros opened this issue Apr 4, 2024 · 49 comments · Fixed by #127 or #134

Comments

@Nakiros
Copy link

Nakiros commented Apr 4, 2024

Moon integration fail 2024 4 update
After 2024.4 update, "(!)" appeared next to moon phase. I reinstalled Moon integration, I reinstalled Horizon card, did HA restart several times, and the "(!)" still won't go away.

@Maraptor
Copy link

Maraptor commented Apr 4, 2024

I have the same problem with moon phases after the update.

@MDV85
Copy link

MDV85 commented Apr 5, 2024

I have the same problem with moon phases after the update...

изображение_2024-04-05_060315046

@iva2019528
Copy link

I have the same problem with moon phases after the update.

@pbranly
Copy link

pbranly commented Apr 7, 2024

Hi same issue and Furthemore, it is in English while the moon phase sensor gives the information in my native French language

@nepozs
Copy link

nepozs commented Apr 7, 2024

The same issue, but problems with Moon are language independent - it is always English only and wrong phase with "(!)" for sure it is HA core 2024.4.x dependent.

@Nakiros
Copy link
Author

Nakiros commented Apr 8, 2024

moon integration
Update: the moon phase updated to "new moon" as expected from "waning crescent", so i believe that it connects to the Moon integration, retrevies information from it, but form some unknown reason, it also writes the "(!)"

@RaynePhantasm
Copy link

RaynePhantasm commented Apr 8, 2024

Screenshot 2024-04-08 175039

Additional information: This message appears when you hover over "new_moon (!)":
"Install Moon integration to get localized Moon phase name" even though the integration is already installed.

@doctorkb
Copy link

doctorkb commented Apr 8, 2024

connects to the Moon integration

No, it displayed that much before I installed the Moon integration. It's just the translation that needs the integration.

@ThomDietrich
Copy link

Hey all, thanks for all the reports.
Anyone amongst you brave enough to submit a fixing PR? :)

@tigers75
Copy link

I don't know how to fix it, just to add that it does not work even if forcing the language with the option instead of relying on the card getting the HA language.

@Embout
Copy link

Embout commented Apr 14, 2024

There is a typo in the code. Line 2740:

     var moon_phase_localized = i18n.localize("component.sensor.state.moon__phase.".concat(phase.state));

Double underscore in entity name

@RogMoe
Copy link

RogMoe commented Apr 14, 2024

There is a typo in the code. Line 2740:

     var moon_phase_localized = i18n.localize("component.sensor.state.moon__phase.".concat(phase.state));

Double underscore in entity name

...but fixing that does not solve the issue...

@rmd-gh
Copy link

rmd-gh commented Apr 15, 2024

I took a look at the moon source strings.json and it appears that line 2740 needs to be

var moon_phase_localized = i18n.localize("component.moon.entity.sensor.phase.state.".concat(phase.state));

Making that change fixed it for me

@RogMoe
Copy link

RogMoe commented Apr 15, 2024

sun3
sun2
sun1

@rmd-gh
Copy link

rmd-gh commented Apr 15, 2024

Screenshot 2024-04-15 at 9 07 10 PM

It could be that my "fix" is a fluke that only works for English (not a js guy and no idea how the localisation class works). Do make sure that you don't have a cached lovelace-horizon-card.js in your browser though. I had to clear the cache and reload that file.

@rmd-gh
Copy link

rmd-gh commented Apr 15, 2024

I should add that I had to edit the gz file. That seems to be the one that is served

@mateuszdrab
Copy link

mateuszdrab commented Apr 15, 2024

@rmd-gh that worked for me too - even when I switched language to Polish

By the way, you can remove the gz file when editing, it's simply a compressed version to speed up loading but the script loads just fine without it.

Perhaps PR it?

@RogMoe
Copy link

RogMoe commented Apr 15, 2024

It could be that my "fix" is a fluke that only works for English (not a js guy and no idea how the localisation class works). Do make sure that you don't have a cached lovelace-horizon-card.js in your browser though. I had to clear the cache and reload that file.

Cache cleared and reloaded the page. Not working for me (in Dutch).

@JokeRsevilla
Copy link

var moon_phase_localized = i18n.localize("component.moon.entity.sensor.phase.state.".concat(phase.state));

works for me in Spanish, just by reloading the page, modifying .js and removing .gz

@JokeRsevilla
Copy link

I took a look at the moon source strings.json and it appears that line 2740 needs to be

var moon_phase_localized = i18n.localize("component.moon.entity.sensor.phase.state.".concat(phase.state));

Making that change fixed it for me

thank you so much!

@RogMoe
Copy link

RogMoe commented Apr 15, 2024

Fixed it too! Thx @rmd-gh !

@ThomDietrich
Copy link

Whoever publishes the PR gets mentioned in the release notes! :)

@rmd-gh
Copy link

rmd-gh commented Apr 15, 2024

If anyone wants to do a PR, feel free. I don't know enough about building typescript to test, or using github to do that. The actual source location appears to be lovelace-horizon-card/src/utils/HelperFunctions.ts:32

@maatx
Copy link

maatx commented Apr 16, 2024

I took a look at the moon source strings.json and it appears that line 2740 needs to be

var moon_phase_localized = i18n.localize("component.moon.entity.sensor.phase.state.".concat(phase.state));

Making that change fixed it for me

Thanks so much, it also worked for the Italian version !

@JokeRsevilla
Copy link

@nepozs has already created a pull request

#127 👍

@jm314159
Copy link

I took a look at the moon source strings.json and it appears that line 2740 needs to be
var moon_phase_localized = i18n.localize("component.moon.entity.sensor.phase.state.".concat(phase.state));
Making that change fixed it for me

Thanks so much, it also worked for the Italian version !

My settings are PL in general apart from language which is EN. The solution is working fine. I only had to convince ;) my browser to refresh the settings effectively. A restart of the core was insufficient. Neither was a common F5 or CTRL+F5. Cleaning the browser cache of past two hours was what only helped.

It is just worth noting I think, in another browser that I did not use to use for HA, just after I logged in, there was no exclamation mark at all.

@Bilo2110
Copy link

I took a look at the moon source strings.json and it appears that line 2740 needs to be
var moon_phase_localized = i18n.localize("component.moon.entity.sensor.phase.state.".concat(phase.state));
Making that change fixed it for me

Thanks so much, it also worked for the Italian version !

I've try to do this fix, but for me not working in Italian language

@Bilo2110
Copy link

I took a look at the moon source strings.json and it appears that line 2740 needs to be
var moon_phase_localized = i18n.localize("component.moon.entity.sensor.phase.state.".concat(phase.state));
Making that change fixed it for me

Thanks so much, it also worked for the Italian version !

Can you help me @maatx for italian language?

@nepozs
Copy link

nepozs commented Apr 17, 2024

Can you help me @maatx for italian language?

This issue is language independent, clear cache in browser.

@Bilo2110
Copy link

Bilo2110 commented Apr 17, 2024 via email

@jm314159
Copy link

Have you tried in secure/private mode? Or on another computer/laptop/phone?

@nepozs
Copy link

nepozs commented Apr 17, 2024

Maybe italian translation is incomplete? Does Moon integration work OK?

@Bilo2110
Copy link

Have you tried in secure/private mode? Or on another computer/laptop/phone?

I've try whit private mode in Chrome by smartphone, but same problem

@Bilo2110
Copy link

Maybe italian translation is incomplete? Does Moon integration work OK?

Moon integration work, and give me correct italian translation. Not work in this card.
I've tried to add new card... Same problem

@jm314159
Copy link

Perhaps, if not yet attempted, you could try with changing the language for a while with
language: en
or setting the least config

type: custom:horizon-card
fields:
  moon_phase: true

followed each time by restarting the Core and browser cache/history cleaning (or private mode).

@Bilo2110
Copy link

Bilo2110 commented Apr 17, 2024 via email

@jm314159
Copy link

jm314159 commented Apr 17, 2024

Well, indeed, I forgot that step in my first message. I have also recreated .gz
gzip lovelace-horizon-card.js -k

Congrats to you! :)

@ThomDietrich
Copy link

Hello everyone, sadly I didn't have the time to merge this one yet (or rather other PRs I want to publish alongside this fix).
Will take care of it this evening!

@ThomDietrich
Copy link

Hey all,
I did merge the PR but sadly our build release pipeline isn't happy with it. Could you @nepozs or someone else please look into this? I am not a js/ts developer.

https://github.com/rejuvenate/lovelace-horizon-card/actions/runs/8807266271

@nepozs
Copy link

nepozs commented Apr 24, 2024

Nor I am… sorry, looks it needs more changes…

@Bilo2110
Copy link

Bilo2110 commented Apr 24, 2024 via email

@tormentor22
Copy link

tormentor22 commented Apr 25, 2024

Wait wait wait... After deleting the .gz file, edit line 2740, cleared cache, finally WORK!!! Thx for all

________________________________ From: jm314159 @.> Sent: Wednesday, April 17, 2024 10:51:12 PM To: rejuvenate/lovelace-horizon-card @.> Cc: Bilo2110 @.>; Comment @.> Subject: Re: [rejuvenate/lovelace-horizon-card] Moon phase integration not recognized after 2024.4 update (Issue #122) Perhaps, if not yet attempted, you could try with changing the language for a while with language: en or setting the least config type: custom:horizon-card fields: moon_phase: true followed each time by restarting the Core and browser cache/history cleaning (or private mode). — Reply to this email directly, view it on GitHub<#122 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BA6FD6MGTN3WAJFO4HHGGXDY53OEBAVCNFSM6AAAAABFWS5YFOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRSGI4DEMRRGU. You are receiving this because you commented.Message ID: @.***>

Same in German. After editing line 2740 and delete *.gz it work now. Thank you guys

@ThomDietrich
Copy link

@avataar @edwardtfn are you guys around to have a look at this?

@MelleD
Copy link

MelleD commented Apr 26, 2024

For me the fix do not work.

I need this as entity: component.moon.entity.sensor.phase.state. Then everything is working. The fix without "moon" is not working. I saw also some test issue with the persia language tests. I ignore them for the first time. Maybe someone who speak the lang should add tests for that :-).

I had some trouble with the build pipeline.
My changes were not taken into the release.

#131

Bildschirmfoto 2024-04-27 um 00 51 54

@s-hutter
Copy link

s-hutter commented May 4, 2024

Quick fix using Card Mod without modifying files (English only):

type: custom:horizon-card
time_format: 24
fields:
  moonrise: true
  moon_phase: true
  moonset: true
card_mod:
  style: |
    .horizon-card-field-value-moon-phase span {display: none;}
    .horizon-card-field-value-moon-phase:before {content: "{{states('sensor.moon_phase')|replace('_',' ')|title}}";}

@DJaeger
Copy link

DJaeger commented May 5, 2024

Quick fix with modifying file (incl. localized) from terminal/ssh:

cd config/www/community/lovelace-horizon-card/
sed -i 's/component.sensor.state.moon__phase./component.moon.entity.sensor.phase.state./g' lovelace-horizon-card.js
rm -f lovelace-horizon-card.js.gz &&  gzip lovelace-horizon-card.js -k
ha core restart

Clear your browser cache and reload afterwards!

@MelleD
Copy link

MelleD commented May 6, 2024

I already fixed it, PR is still open.

Meanwhile you could try it with my repo. It's released here:
https://github.com/MelleD/lovelace-horizon-card

@dunxd
Copy link

dunxd commented May 6, 2024

Looking forward to the PR that fixes this being merged.

@ThomDietrich
Copy link

Dear all,
this bug is now fixed in the most recent release https://github.com/rejuvenate/lovelace-horizon-card/releases/tag/v1.1.0 - there are a lot more changes in that release.

This repository is hosted under the rejuvenate organization. We are always open to new contributions and happy for anyone participating in discussions and the review process! If you are a passionate js/ts developer and would like to be more involved with this project please also check the open feature suggestions ;)

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet