Ping 8.8.8.8 connectivity check

Yes, see my answer above.

Alright, I’ve added the code into the configuration.yaml. Thank you.

But it still doesn’t show on the dashboard.

I’ve added the following into a manual card. As said above.

color_thresholds:
  - color: '#e45e65'
    value: 40
  - color: '#e0b400'
    value: 30
  - color: '#0da035'
    value: 20
  - color: '#039BE5'
    value: -1
color_thresholds_transition: hard
entities:
  - entity: binary_sensor.ping
group: false
height: 300
hour24: true
line_width: 4
name: Ping
points_per_hour: 10
show:
  extrema: true
  average: true
  fill: fade
  icon: true
  labels: false
  name: true
  state: true
type: custom:mini-graph-card

This is not the name of your sensor (in the card):

entities:
  - entity: binary_sensor.ping

Your sensors will be called:

color_thresholds:
  - color: '#e45e65'
    value: 40
  - color: '#e0b400'
    value: 30
  - color: '#0da035'
    value: 20
  - color: '#039BE5'
    value: -1
color_thresholds_transition: hard
entities:
  - entity: sensor.wan_ping
  - entity: sensor.lan_ping
group: false
height: 300
hour24: true
line_width: 4
name: Ping
points_per_hour: 10
show:
  extrema: true
  average: true
  fill: fade
  icon: true
  labels: false
  name: true
  state: true
type: custom:mini-graph-card

Also your second template sensor seems to be using the wrong binary sensor. Should be:

  - sensor:
      - name: "LAN Ping"
        icon: "mdi:speedometer"
        unit_of_measurement: "ms"
        state: "{{ state_attr('binary_sensor.default_gateway_ping', 'round_trip_time_avg')|round(2) }}"

Hi Tom,
sorry for posting off tpoic.
Can’t figure out whats wrong with my code …

  - sensor:
      - name: "LAN Ping"
        icon: "mdi:speedometer"
        unit_of_measurement: "ms"
        state: "{{ state_attr('binary_sensor.router_ping', 'round_trip_time_avg')|round(2) }}"

    color_thresholds:
      - color: '#e45e65'
        value: 40
      - color: '#e0b400'
        value: 30
      - color: '#0da035'
        value: 20
      - color: '#039BE5'
        value: -1
    color_thresholds_transition: hard
    entities:
      - entity: sensor.wan_ping
      - entity: sensor.lan_ping
        group: false
        height: 300
        hour24: true
        line_width: 4
        name: Ping
        points_per_hour: 10
        show:
            extrema: true
            average: true
            fill: fade
            icon: true
            labels: false
            name: true
            state: true
        type: custom:mini-graph-card   

getting the error:
Invalid config for [template]: [color_thresholds] is an invalid option for [template]. Check: template->color_thresholds.

All of this belongs in the card config, not the sensor config.


    color_thresholds:
      - color: '#e45e65'
        value: 40
      - color: '#e0b400'
        value: 30
      - color: '#0da035'
        value: 20
      - color: '#039BE5'
        value: -1
    color_thresholds_transition: hard
    entities:
      - entity: sensor.wan_ping
      - entity: sensor.lan_ping
        group: false
        height: 300
        hour24: true
        line_width: 4
        name: Ping
        points_per_hour: 10
        show:
            extrema: true
            average: true
            fill: fade
            icon: true
            labels: false
            name: true
            state: true
        type: custom:mini-graph-card   

It all stored in configuration.yaml at the very bottom…

Which is wrong. As I said, this bit goes in a Lovelace card:

    color_thresholds:
      - color: '#e45e65'
        value: 40
      - color: '#e0b400'
        value: 30
      - color: '#0da035'
        value: 20
      - color: '#039BE5'
        value: -1
    color_thresholds_transition: hard
    entities:
      - entity: sensor.wan_ping
      - entity: sensor.lan_ping
        group: false
        height: 300
        hour24: true
        line_width: 4
        name: Ping
        points_per_hour: 10
        show:
            extrema: true
            average: true
            fill: fade
            icon: true
            labels: false
            name: true
            state: true
        type: custom:mini-graph-card   

Remove it from your ping sensor config.

thanks for information.
i opened the “Raw-Configurationeditor” and paste it at the very bottom, restartet it but still the same style
wan ping

The ping sensor goes in your sensor.yaml file.

The card config goes in a Lovelace card, not the raw view. And not indented that far either.

hey @tom_l

with Lovelacecard you mean the card config itself?

Visual editor is not supported for this configuration:

  • Key ‘color_thresholds’ is not expected or not supported by the visual editor.
  • Key ‘color_thresholds_transition’ is not expected or not supported by the visual editor.
  • Key ‘entities’ is not expected or not supported by the visual editor.

You can still edit your config in YAML.

Do i need something like lovelace.yaml?

No. That is correct. The mini graph card does not have a gui editor. You can edit it in that card YAML window (if you ever need to).

thanks for the answeres :slight_smile :slight_smile:

i think i need to learn more about configuration of cards etc… i stick to the standard view without color tresholds…

edit: was missing the mini-graph-card :slight_smile:

@aruffell
Any chance you can send me over your mini-graph template. Im trying to replicate here and for the life of me, I cant get it changed away from the single line graph.

@Rattlehead

These are my template sensors:

  - sensor:
      - name: "WAN Ping"
        icon: "mdi:speedometer"
        unit_of_measurement: "ms"
        state: "{{ state_attr('binary_sensor.google_dns_ping', 'round_trip_time_avg')|float(0)|round(2)|default(0) }}"

  - sensor:
      - name: "LAN Ping"
        icon: "mdi:speedometer"
        unit_of_measurement: "ms"
        state: "{{ state_attr('binary_sensor.router_ping', 'round_trip_time_avg')|float(0)|round(2)|default(0) }}"

And these are the mini-graphs:

type: custom:mini-graph-card
name: LAN Ping
entities:
  - entity: sensor.lan_ping
group: false
height: 320
hour24: true
line_width: 4
points_per_hour: 12
show:
  extrema: true
  average: true
  fill: fade
  icon: true
  labels: false
  name: true
  state: true
color_thresholds:
  - color: '#e45e65'
    value: 40
  - color: '#e0b400'
    value: 30
  - color: '#0da035'
    value: 20
  - color: '#039BE5'
    value: -1
color_thresholds_transition: hard

and

type: custom:mini-graph-card
name: WAN Ping
entities:
  - entity: sensor.wan_ping
group: false
height: 320
hour24: true
line_width: 4
points_per_hour: 12
show:
  extrema: true
  average: true
  fill: fade
  icon: true
  labels: false
  name: true
  state: true
color_thresholds:
  - color: '#e45e65'
    value: 40
  - color: '#e0b400'
    value: 30
  - color: '#0da035'
    value: 20
  - color: '#039BE5'
    value: -1
color_thresholds_transition: hard

Is this what you were asking for?

1 Like

That’s exactly it, thank you very much @aruffell .
I was wracking my brain as the colouring wasn’t working, I couldn’t see the error. Just c&p yours there and boom job done. Appreciate it.

1 Like

Just to add that as of now, mini-graph-card supports attributes so there is no longer need to create a template sensor to extract the values from the binary sensor - GitHub - kalkih/mini-graph-card: Minimalistic graph card for Home Assistant Lovelace UI

1 Like

@ariel I experimented with removing the Template Sensors and it seemed to prevent the ping card from updating at all.