What do I need to create to make a non-editable display?

I wish to create a variable that I can set in an automation. To-date, I have used a Number Helper. The problem with this is, that when displayed in an Entity Card, it is editable. And looks different.
What sort of helper do I need that will display like a sensors?
image

I want the lower display to look and look like the top one and be read only.
In the hope that a YAML snippet makes my question clearer

  - service: input_number.set_value
    target:
      entity_id:
        - input_number.kwh_at_night_rate_start
    data:
      value: "{{ states('sensor.smart_meter_electricity_import') }}"

Apologies if the language is not correct, still not got my head around all of this!
Regards, Martin

does it have to show in the entity card? you could use something like a title card. however if you click through on the title card and get to the underlying entity, then you can still modify that.

the other alternative is to create a template sensor. have the template be {{ input_number.kwh_at_night_rate_start }}

then show that template sensor in your card.

tom’s answer :point_down:

1 Like

There’s an option called simple-entity you can use in the card to make the number read only:

e.g. same entity different display:

type: entities
entities:
  - entity: input_number.upstairs_ac_temp_set_heat
  - entity: input_number.upstairs_ac_temp_set_heat
    type: simple-entity

Screenshot 2024-03-14 at 09-11-23 Administration – Home Assistant

Note however that if you click on the entity it is editable in the more-info pop-up.

To prevent this:

type: entities
entities:
  - entity: input_number.upstairs_ac_temp_set_heat
  - entity: input_number.upstairs_ac_temp_set_heat
    type: simple-entity
    tap_action:
      action: none
2 Likes

Another option: sometimes you need to keep displaying helpers as helpers - but read-only with disabled sliders, edits, checkboxes; and with grey “disabled” color. Also if this “read-only mode” is supposed to be conditional like “if user = someone” or “if anything = something”. This may be done by card-mod.

Thank you all for your suggestions. I’ve been working with Tom’s suggestion which gets me near what I was hoping for but… Isn’t there always!
Adding the type: simple-entity stops the Entities card from using the Visual Editor.


To me (a simple-entity :grinning:) it seems that it is complaining that Entity Card will only accept a string? Is this a correct understanding?
Regards, M.

Correct. You can only edit this in YAML.