Issue with input_number within entities card

Strange issue I found after some recent update (do not recall which one it was, I assume after implementation of global number formatting in users settings). It is related to entities card displaying input_number entities. Previously if the number was integer, it was displayed without decimals. Now at least one decimal is always displayed, which I do not want. Here is the card code:

type: entities
entities:
  - entities:
      - input_number.watering_cycle
      - input_number.watering_start_time
      - input_number.sprinkler_time
    head:
      text: Configuration
      type: custom:text-divider-row
    type: custom:fold-entity-row
show_header_toggle: false

and the corresponding view of the card:
image

I used here small trick configuring input_number.watering_start_time (Start Time) as having :00 as measurement unit, so the value of 3 was displayed as 3:00. After recent change and addition of always displayed decimal part it is displayed as 3,0:00, which does not makes sense as time formatting :frowning:
I tried to use format option for individual entities in card, but it seems to be limited to only formatting timestamps.
Any idea how to remove decimal part? Or how to get this displayed properly? BTW, same applies (but not so much disturbing) to Days between watering cycles (2,0 days) and Cycle Duration (15,0 min)…

I think input_number has had the decimal for some time. When counter was introduced (last year?) I switched to that to get rid of it - would that help here?

Well, not really… indeed, I tested counter and it displays properly, but then I’d need to use some template to display its value formatted as time. It is also only controllable via services, so it is not possible to use slider to easily set its value. Of course soem combination of input_number to enter data and counter to just display value are possible, but this would overcomplicate solution over outcome. I’ll keep thinking about other ideas to get this to my liking and perhaps made it simple.

HA! I found easy solution; it is enough to replace entity in entities card witj slider-entity-row. Code below shows old and new rows:

type: entities
entities:
  - entities:
      - input_number.watering_cycle
      - input_number.watering_start_time
      - input_number.sprinkler_time
# replaced code:
      - entity: input_number.watering_cycle
        toggle: false
        type: custom:slider-entity-row
      - entity: input_number.watering_start_time
        toggle: false
        type: custom:slider-entity-row
      - entity: input_number.sprinkler_time
        toggle: false
        type: custom:slider-entity-row
    head:
      text: Configuration
      type: custom:text-divider-row
    type: custom:fold-entity-row
show_header_toggle: false

and here is the outcome, 3 bottom rows shows data as intended:
Screenshot 2021-06-28 at 8.17.30

1 Like