Is it possible to override on-off display text for the ping binary_sensor?

Hi Everyone,

Haven’t had much luck searching for an answer to this. Basically, I have these two ping sensors:

  - platform: ping
    host: 8.8.8.8
    name: ping_google_dns1
    scan_interval: 60

  - platform: ping
    host: 8.8.4.4
    name: ping_google_dns2
    scan_interval: 60

I have a basic entity card that looks like this:

type: entities
entities:
  - entity: binary_sensor.ping_google_dns1
  - entity: binary_sensor.ping_google_dns2

Based on the Binary Sensor Docs, the actual state of the sensor is either on or off, which ends up being displayed as Connected or Disconnected. Is is possible to override the Connected or Disconnected to something like Up or Down?

On some other cards, I’m using the multiple-entity-row plugin, and the Connected or Disconnected text is a bit too long, I’d love to be able to shorten it a bit.

Thanks!

Welcome to HA! :slightly_smiling_face:
Take a look at the device-class in the docs you linked.

Hi VDRainer, thanks! I noticed that section, but I’m not clear on how to use it based on the docs. Would I be creating a device_class in customize:, where I can manually define what up and down display as? I didn’t see anything like that, but I might have misunderstood.

You can only choose from the defined device classes.
If you want your own states for a sensor, you can add a template sensor.

Ok, thanks! I’ll look into that.