Lovelace: mini graph card

There’s an issue open for this.

I have recreated the history graph of a climate component. But I think I have a refresh problem. Many times when I open the panel that contains the graph, it shows like this, (green graphs area is more on the left that should be).

mal

when I press F5 in my browser, the graph is already updated correctly.

ok

You can see the difference of the green part, it seems to show old data.

Can I do something about it?

Thangs in advance.

1 Like

Ok, I see. I will keep an eye on that thread :slight_smile:

There’s an issue open for that too.

Still not getting it to work? I can’t reproduce that issue unfortunately.
It’s however not really optimal that we cache the mapped values, if the user ever want to change the state_map structure later the cached data will not be remapped.

@dutchguy, @DendelX, @tom_l
Thanks for your reports.
Can hopefully make some progress on those issues during the weekend, one of them should be fairly easy to solve, the other one could require some experimentation.

1 Like

Basically if I use the input_number I did create originally it does work perfectly.
If I use the binary_sensor you suggested it doesn’t.
I have checked and the binary sensor it is correctly setting on/off depending on the tod rules, but the graph it doesn’t seems to be “translating” on/off to 1/0, therefore it is not showing the graph when I use that…

Very odd indeed :slight_smile:

Hi Kalkih, I have to report another bug. If you compare both graphs I attached before, at begining you can see that first green area is different. I have seen that some times, this graph and blue one (second and third entities) mantains fixed a value instead real values. This is always with the oldest data that graph shows, and not is fixed refreshing browser.

In this example the correct is the first graph attached. If you need more information tell me.

Thanks for your work! I love this card.

Sorry, I’m not entirely sure what you mean.
Could you please explain the issue one more time in more detail?
Please open an issue regarding this on github, it’s easier for me to track it that way.
Thanks!

Just looking at his posted graphs I’m pretty sure it’s this issue:

Has anyone been able to use the tap_action option? This was introduced in v0.7.0.

I’m trying to open a popup with Browser Mod on the tap_action as shown below, but it isn’t working. It’s simply opening the more-info view (default behaviour I guess).

card:
  type: custom:mini-graph-card
  ...
  tap_action:
    action: call-service
    service: browser_mod.command
    service_data:
      command: popup
      title: 'title_x'
      card:
        type: custom:more-info-card
        entity: 'entity_id_x'
        title: ' '
      style:
        border-radius: var(--theme-border-radius)
        background: var(--theme-background)
      deviceID:
        - this

Everything under tap_action is also used on other cards and it works fine when used on a button (custom:button-card) for example.

1 Like

I am not 100 sure, but I do use the popup differently and it works (not on mini-graph-card but on a single entity)

                      action: call-service
                      service: browser_mod.popup
                      service_data:

This instead of using the command and then the popup, so your should look more like this:

card:
  type: custom:mini-graph-card
  ...
  tap_action:
    action: call-service
    service: browser_mod.popup
    service_data:
      title: 'title_x'
      card:
        type: entities
        entity: 'entity_id_x'
        title: ' '
      style:
        border-radius: var(--theme-border-radius)
        background: var(--theme-background)
      deviceID:
        - this

I have also removed the more-info-card which sound pointless for me, you should use the “entities” card and list the entities you want to show in the popup, so for instance my whole card looks like this:

              - type: glance
                show_state: false
                columns: 3
                show_header_toggle: false
                entities:
                  - name: HASP Desk
                    entity: sensor.hasp_desk_status
                    tap_action:
                      action: call-service
                      service: browser_mod.popup
                      service_data:
                        title: HASP Desk
                        card:
                          type: entities
                          entities:
                            - sensor.hasp_desk_status
                            - light.hasp_desk_display
                            - sensor.hasp_desk_ip_address
                            - sensor.hasp_desk_signal_strenght
                            - sensor.hasp_desk_uptime
                            - sensor.hasp_desk_esp_version
                            - sensor.hasp_desk_esp_update_available
                            - sensor.hasp_desk_lcd_version
                            - sensor.hasp_desk_lcd_update_available

And looks like this (on click):

Hope it helps :slight_smile:

1 Like

Thanks for trying to help out.

I actually have the Browser Mod popups working. I tried your way (browser_mod.popup) which works fine, but so does the way I specified it.

The thing that isn’t working is the tap_action on the Mini Graph Card, because if it would, it would have showed my popup.

I even tried something more simplified like:

tap_action:
  action: navigate
  navigation_path: /lovelace/some-path

This also does not work. It just performs the default, which is more-info.

On another note, thanks for your tip about the entities card. I was actually already thinking of a way to filter some attributes which are on the more-info-card. So, thanks for that. Definitely going to use that.

Sounds like your browser isn’t loading the latest version of the card.
Make sure you’ve updated the card and the old version isn’t loading from cache.
If using HACS, check this: https://github.com/kalkih/mini-graph-card/issues/169

Oh, wow. Thanks for pointing that out! That was indeed it.

I am using HACS and even though I’ve seen you say this to some other people earlier in this thread I never thought to look for this issue myself since everything worked fine up until I wanted to use the popup from Browser Mod.

Also @SeLLeRoNe earlier I said that service: browser_mod.popup was working fine for me, but in fact it didn’t. Because I wasn’t using the correct resource, it looked like it was working, but it wasn’t. I was using an older version of Browser Mod. So, I also updated to the latest version of that and started to use the new configuration (service: browser_mod.popup over service: browser_mod.command and a separate command: popup) and everything is working fine now.

Thanks!

2 Likes

Is there a way to force aspect ratio 1/1 (height/width) for mini graph card?

@kalkih thanks for an awesome card!
I use it to show graph over my energy consumtion.
Is it possible to group the bars weekly? I manage only to group the bars as last 7 days, not as week (mon-sun). Is that possible, and if so, how? Want also to start to show the bars at the 1. of each month, so it`s more logical to the values I use.

sorry for this small error-report, but there’s a typo in the GitHub at https://github.com/kalkih/mini-graph-card#grouping-by-date

- type: type: custom:mini-graph-card
  entities:
    - entity: sensor.energy_daily
  name: Energy consumption
  hours_to_show: 168
  aggregate_func: max
  group_by: date
  show:
    graph: bar

should be:

- type: custom:mini-graph-card
  entities:
    - entity: sensor.energy_daily
  name: Energy consumption
  hours_to_show: 168
  aggregate_func: max
  group_by: date
  show:
    graph: bar

couldn’t find the edit button on the GitHub page, so hope you don’t mind me reporting here.

Hi Tom, sorry for the late reply, only just getting back to this now. I already have some style config for this card and with a bit of playing around I couldn’t get it working. How can I uses both your style code and my existing style code for this card? I tried simply having my code under your example (without having ‘style’ twice) but HA wasn’t happy…

            style:
              top: 15%
              left: 50%
              width: 75%

Got a strange thing here: since updating to latest HA version (0.101.3, running on latest Hass.io) i got no graphs anymore?!

No clue whats wrong here, showing below an example from my temp graph. The temp is shown finde (see screenshot below).

  - type: 'custom:mini-graph-card'
              entities:
                - sensor.mywetter_temp
              show:
                labels: false
                fill: true
              color_thresholds:
                - value: 20
                  color: "#e74c3c"
                - value: 21
                  color: "#1db954"
                - value: 21.5
                  color: "#3498db"
              name: Temperatur
              hours_to_show: 72
              points_per_hour: 1

Screenshot from the temp graph:
screenshot%20temp%20graph

Already tried to re-install the mini-graph add-on using hacs, but with no effect.

Thanks in adavance for your help!
/ Ralf

I’ve added a graph for my gas and power consumption for 1 week.
The graph is working but it will not update after the initial time i open home assistant.
If i delete the browser cache or remove the ios update the graph is updated one again.
How can i solve this problem?

- entities:
          - entity: sensor.daily_gas_2
        hour24: true
        hours_to_show: 168
        icon: 'mdi:fire'
        name: Gas Verbruik Dagelijks
        group_by: date
        aggregate_func: max
        show:
          average: true
          extrema: true
          graph: bar
          labels: true
        type: 'custom:mini-graph-card'