aex351 / home-assistant-neerslag-app

Neerslag app for Home Assistant. All-in-one package (Sensors + Card).
59 stars 16 forks source link

where to change color graph line #6

Closed LRvdLinden closed 2 years ago

LRvdLinden commented 3 years ago

Hi, where can I change the color of the graph line?

aex351 commented 3 years ago

Currently there is no option to change the colors. The only way to change the colors is to modify the code.

LRvdLinden commented 3 years ago

I was searching in the code and have seen some RGBA colors. After changing that nothing happens

aex351 commented 3 years ago

You can make the changes to neerslag-card.js. That should work. Make sure to refresh your browser. In the same directory there could also be a .gz file. HACS generates that. The Neerslag App doesn't use it, but if the browser refresh doesn't help you can also try to delete that file to see if that helps. As a note: any changes you make are lost when you update the Neerslag App.

LRvdLinden commented 3 years ago

Refresh heeft niet geholpen. Hmmm

LRvdLinden commented 3 years ago

I have change rgba in to rgb on line 434 and 438. Reboot ha and clear cash. Nothing change. Also changes all the icons. Also noting happend. imageimage

aex351 commented 3 years ago

Maybe you have both the neerslag-app and the neerslag-card installed? There is no other reason, besides some caching mechanism, I can think of why the changes you make are not reflected.

LRvdLinden commented 3 years ago

Yes i have both. Do i need to delete the card?

aex351 commented 3 years ago

Correct, if you have installed the neerslag-app you should uninstall the neerslag-card. Because the neerslag-app contains the neerslag-card. If you install both separately, then depending on the inner workings of Home Assistant one or the other gets loaded. If you open the developer console you will probably see an error message which states that the particular card cannot be loaded again. In your current case, you are making changes to a file that actually never gets loaded.

In the readme file of the neerslag-app there is a big note stating to uninstall the neerslag-card package before using the neerslag-app package. Make sure to also remove the custom sensors.

This package contains the Neerslag Card. Make sure to uninstall this from Home Assistant before using the Neerslag App, to avoid unexpected behaviour. This includes manually removing the custom sensors.

aex351 commented 2 years ago

Unfortunately Home Assistant does not have a default or uniform standard specified for line colors in graphs. In the latest update of the neerslag-app the line color will now be set based on the primary color value of your Home Assistant theme. This is a first step in to making it 'dynamic' as opposed to it being hard coded.

LRvdLinden commented 2 years ago

Super man! Dankje! Thanks a lot!

LRvdLinden commented 2 years ago

It works here!

image

aex351 commented 2 years ago

@LRvdLinden, did you modify the graph configuration (Chart.js) yourself?

Because I see in your screenshot that the graph is not rendered correctly:

This is similar to the issue as reported here: https://github.com/aex351/home-assistant-neerslag-app/issues/18. This is caused by some other component / custom integration that is overriding the configuration of the neerslag-card. I have not found the solution yet or the actual root cause as to how other components are able to do this. Another user found that his problem was caused by the lovelace-buien-rain-card: https://github.com/aex351/home-assistant-neerslag-app/issues/18#issuecomment-926674226. Removing it resolved his issue.

LRvdLinden commented 2 years ago

I don't have installed the old card, only your app.

My card looks like this:


                      - type: 'custom:neerslag-card'
                        title: Voorspelling # <- translate the card name
                        icon: 'ios:cloud-rain'
                        style: |
                          ha-card {
                            border-radius: 10px;
                            padding-bottom: 10px;
                            background-color: var(--dwains-theme-primary)
                          }
                          :host {
                            --paper-item-icon-color: var(--dwains-theme-accent) !important;
                          }
                          .card-header {
                            padding: 5px 16px;
                            font-size: 15px;
                            font-weight: 700 !important;
                          }
                          #states {
                            padding-top: 0px !important;
                            padding-bottom: 0px !important;
                          }
                          .secondary {
                            color: darkgray !important;
                            margin-left: 2px !important;
                          }
                        entities:
                          - sensor.neerslag_buienalarm_regen_data
                          - sensor.neerslag_buienradar_regen_data
LRvdLinden commented 2 years ago

I installed the app again and still have this issue. Maby it is made by the dashboard i used. Dwains Dashboard.

image

aex351 commented 2 years ago

The problem is not with your configuration. It is caused by some other component that is conflicting with the internal configuration of the neerslag-card. It could be a component that you installed in the past and are now not using on your dashboard anymore. However, Home Assistant will still run it in the background. This is something you can check.

Next to this, I will add a check for known incompatible integrations on the next update/release of the neerslag card. If an incompatible integration is found. An error message will be displayed.

LRvdLinden commented 2 years ago

Okay, than I will wait for the update 😉

LRvdLinden commented 2 years ago

Okay I have to fix this.

image

aex351 commented 2 years ago

@LRvdLinden, I have created a specific issue for your case under https://github.com/aex351/home-assistant-neerslag-card/issues/28. You can fix your issue by removing buien-rain-forecast. You can do this via HACS (if you installed it via HACS) and otherwise manually by going to the config\www\community folder and delete the buien-rain-forecast plugin folder.