I am also encountering similar inconsistancies after upgrading to 2023.04. When starting up the webapp/Mobile app, badges are appearing with the wrong colors. After some time the badge color change to the right color in alignment with the state. I did not have this problem on 2023.01
eg location
“badges”: [
{
“entity”: “person.bart”,
“name”: “Bart”,
“style”: “:host { --label-badge-red: {% if is_state(‘person.bart’, ‘Home’) %} green {% else %} red {%endif %}; --label-badge-text-color: {% if is_state(‘person.bart’, ‘Home’) %} green {% else %} red {%endif %}; }”
Same here. After updating to 2023.04 the badge colors cannot be modified manually.
After saving the configuration file they look good (correct modified colors), but after refresh the browser it goes back to default color.
Problem is seen both with Chrome browser and with the Android app.
Have you guys found a solution. I’m having the same issue the colour updates after a while. If I fully close the app and open it again it falls back to default colours and then take a little to get the right colour reflected in the badges
I am experiencing the same problem on the 2023.06 using thelatest app. Colors are fine when starting up and after a while it switches back to the default colors. I am using a card_mod in badges:
I’m using the card_mod under badges just like you and wondering how come no one else raising this an issue or is there a better/or another way to do that ?
You have errors in the code.
Missing “;”.
Wrong state value for a “person”.
Not to mention a fact that custom:badge-card does not have ha-card.
Seems that you copy-posted a code from somewhere.