Madelena / hass-config-public

My Dashboards for Home Assistant - Advanced data visualizations, responsive design, a neat maximalist Metro Live Tile layout, and an ultraminimal tablet layout!
700 stars 55 forks source link

Network rail card with new ping sensor #34

Open simenopsahl opened 1 month ago

simenopsahl commented 1 month ago

The new ping integration moved the travel time attributes into separate sensor entities. Have you updated your rail card, and how did you manage it?

fx-zone commented 5 days ago

I have the same problem. Is there already a solution?

MarineroCro commented 4 days ago

I found a workaround.

I created a new template binary_sensor that gets the data from the new ping integration where you can also enable the additional sensor for round trip time avg and then i am feeding that same state to the template binary sensor attribute named the same way that it is expected by the template "round_trip_time_avg"

You will have to create a template for each ping sensor like that and suggest to name them differently to distinguish from the ones comming from integration and also keep in mind that you will have to change your network.yaml accordingly with the new sensors.

Example of template sensor:

- platform: template
  sensors:
    template_ping_cloudflare:
      friendly_name: "Ping Cloudflare"
      value_template: "{{ states('binary_sensor.ping_cloudflare') }}"
      attribute_templates:
        round_trip_time_avg: "{{ states('sensor.ping_cloudflare_round_trip_time_average') }}"