thomasloven / lovelace-card-mod

🔹 Add CSS styles to (almost) any lovelace card
MIT License
1.05k stars 169 forks source link

Casting a dashboard with Card_Mod generates millions of system_log events #314

Open robotpandarocket opened 7 months ago

robotpandarocket commented 7 months ago

My Home Assistant version: 2023.11.2

My lovelace configuration method (GUI or yaml): YAML

What I am doing: casting a dashboard

What I expected to happen: Dashboard to cast, even if the css doesn't render, no errors should be thrown.

What happened instead: Millions of system_log events (see below) swamped my events table (700mb -> 8gb in data base size)

Minimal steps to reproduce: Cast (using built in integration) dashboard with a card_mod card.

# The least amount of code possible to reproduce my error
card_mod:
  style: |
    :host {
      --ha-card-border-width: {% if ((states['sensor.pwr_grid_total_power'].state  | int) >  100) %} 
                            3px
                            {% else %}
                            1px
                            {% endif %};
}
# End of code
event_type: call_service
data:
  domain: system_log
  service: write
  service_data:
    logger: frontend.js.latest.202310302
    message: >-
      Unhandled promise rejection from Chrome 116.0.0.0 on Chromecast
      1.56.500000

      TypeError: t.refresh is not a function

      /hacsfiles/lovelace-card-mod/card-mod.js:5:1382
    level: debug
origin: LOCAL
time_fired: "2023-11-15T07:50:07.011631+00:00"
context:
  id: 01HF8ZAXX3WN63TWTJ5XM2V64T
  parent_id: null
  user_id: 8e3c53bd9cdc43b19f84da083767fb88

Error messages from the browser console:


By putting an X in the boxes ([]) below, I indicate that I:

thomasloven commented 6 months ago

I think this should be fixed by 3.4.0

ProjectDomotic commented 6 months ago

version 3.4.0 doesn't work well my entire configuration got damaged after the update as well as the log page scrolls like never before

thomasloven commented 6 months ago

That's impressive. Updating a resource shouldn't change your configuration.

ProjectDomotic commented 6 months ago

Could you check your configuration as soon as possible or I'll have to stop using it because clsi is pretty useless

ProjectDomotic commented 6 months ago

I used a configuration based on CSS thanks to the card-mod. However, I updated and the initial configuration was not as before but totally changed. I tried to configure it on a totally empty server with no other configurations and the card mod always had the same problem. while if I use an older version it works correctly

thomasloven commented 6 months ago

I have no idea what you are trying to say.

You're going to have to show me something.

ProjectDomotic commented 6 months ago

I don't know if the image is visible, this was before the update

2ed31ba9-e2b1-4266-9d92-0ddbb5ed4d96

and so after the update :(

603b185b-2d73-4911-97be-8ce2289355ea

ProjectDomotic commented 6 months ago

I don't know how else to show it to you since I don't know anything about programming

thomasloven commented 6 months ago

The code (configuration) you're using, perhaps? And in what way that was changed.