Lovelace: mini graph card

Not changing after saving, clearing cache or restarting :frowning:

Make sure your input_number.nighttime entity work correctly.

I copied your Node-Red code and get following issue. What code needs to go into data? :slight_smile:

Sorry that’s not my code, that’s a fellow contributors code, I personally don’t use node-red.
Check this thread, maybe it can be of help:

I would have done it this way:

2 Likes

Any ideas on how to make a template for the color_thresholds?
So that e.g. all temperatures are shown using the same threshold colors?

I was testing with a separate. yaml file, containing the color values, but I could not get it to work.

Search for “YAML anchors”. Or there is this: Lovelace: Decluttering Card

I still think there is something odd with the state_map in my opinion.

I have now been using the input_number and it is working fine, but I also left the binary sensor there to check it and start to use it when the time was right… and now that binary sensor it’s apparently working fine, but when I add it to the graph to replace the input_number, it does not appear, feels like the on/off is not transalated to 1/0

I see the same issue here. My config:

aggregate_func: max
entities:
  - entity: sensor.hourly_gas
hour24: true
group_by: hour
hours_to_show: 24
line_width: 2
name: Gas consumption
points_per_hour: 60
show:
  graph: bar
  labels: true
type: 'custom:mini-graph-card'

When I compare to the normal history graph, I could see abnormalities, so I opened the same graph in a new private tab in FF, then I get a correct graph. Here an example:
Original graph:
(PNG%20Image%2C%20411%C2%A0%C3%97%C2%A0143%20pixels)

Wrong graph:
image

Correct graph:
image

1 Like

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.