Change the sensor status names?

Hi, I was wondering if it is possible to change the sensor status names, for example:

instead of appearing as “on” and “off” I want to tell HASSIO that “on” stands for “Currently online” and “off” stands for “Currently offline

example

it’s possible? thank you

If it’s a binary sensor pick a device class: https://www.home-assistant.io/integrations/binary_sensor/#device-class (connectivity is probably the closest).

Set it either using the UI or manually using customize.

If you want custom device classes rather than the core ones vote here:

1 Like

Thanks a lot, but it doesn’t work because I already have another binary_sensor done like this:

binary_sensor:
    
  - platform: rest

    resource: http://192.168.1.150:***/api.cgi?cmd=GetMdState&user=***&password=***

    name: Reolink_Ingresso

    device_class: motion

    value_template: "{{ value_json[0].value.state }}"

    scan_interval: 2

When I go to add:

device_class:
  - binary_sensor:
      - binary_sensor.rtx2070:
          state_off: 'Attualmente Offline'
          state_on: 'Attualmente Online'
          icon_off: mdi:account-badge-outline
          icon_on: mdi:account-badge

I go to check the configuration it gives me an error.

Do not use the format suggested in the Feature Request. Feature requests are just that, requests for new features. Thy have not been implemented and may never be implemented. All you do there is vote for it if you want it. Like I said:

What you need to do until that gets implemented is follow the instructions in the first two links I provided:

Or since you are using the rest sensor just do this:

binary_sensor:
  - platform: rest
    resource: http://192.168.1.150:***/api.cgi?cmd=GetMdState&user=***&password=***
    name: Reolink_Ingresso
    device_class: connectivity #### <-----Changed here ###
    value_template: "{{ value_json[0].value.state }}"
    scan_interval: 2

However I suspect that is a completely unrelated movement sensor (no idea why you posted it). So don’t change that particular one.

1 Like

I explained myself badly, if I add:

device_class:
  - binary_sensor:
      - binary_sensor.rtx2070:
          state_off: 'Attualmente Offline'
          state_on: 'Attualmente Online'
          icon_off: mdi:account-badge-outline
          icon_on: mdi:account-badge

it gives me an error because there is this:

binary_sensor:
    
  - platform: rest

    resource: http://192.168.1.150:***/api.cgi?cmd=GetMdState&user=***&password=***

    name: Reolink_Ingresso

    device_class: motion

    value_template: "{{ value_json[0].value.state }}"

    scan_interval: 2

But if I remove the latter and just leave this other one:

device_class:
  - binary_sensor:
      - binary_sensor.rtx2070:
          state_off: 'Attualmente Offline'
          state_on: 'Attualmente Online'
          icon_off: mdi:account-badge-outline
          icon_on: mdi:account-badge

works perfectly, now my question is, how do I get both to work without errors??

That is not possible. That is not how you customize a device. That is config you have copied from a feature REQUEST that has not been implemented.

Delete all of that and do this instead (for the third and final time):