2021.4 and comma values

Starting from 2021.4, I have this issue:
I see all my input_number as float in the frontend (ex: “3,0” instead of “3”).

I am aware that they are indeed float numbers but I don’t know where to put the cast of.

For example I have this input number:

clean_shelf:
    name: "Clean Shelf"
    max: 14
    min: 0
    step: 1

and this automation:

- id: 'CleanTheShelf
  alias: add clean
  initial_state: true
  trigger:
    platform: time
    at: "8:30:00"

  action:
    - service: input_number.increment
      entity_id: input_number.clean_shelf

then in my ui-lovelace.yaml

   - input_number.clean_shelf

Where I am supposed to cast it to int ?

Thanks

1 Like

When this is a change you don’t like, caused by a HA Core update, create an Issue here: Issues · home-assistant/core · GitHub

On second thought, this could be a HA Frontend-topic, in that case go here: Issues · home-assistant/frontend · GitHub

2 Likes

i have this exact issue and its causing my log to go nuts for using an input_numer casted to a timecode automation convering 5 (now shown as 5.0) to HH:MM:SS , and in my code as

  - service: timer.start
    data_template: 
      entity_id: timer.floatdown
      duration: "00:{{ '%0.2d' % states('input_number.floatdowns')|int }}:00"

  - delay: "00:{{ '%0.2d' % states('input_number.floatdowns')|int }}:00" 

gives me errors about the decimal not being allowed

I also did not know where to post this issue when overlooking the catagories…

I believe this is on Github as:
https://github.com/home-assistant/frontend/issues/8770

not exactly sure, but hopeful.

While digging a bit, I think the referenced PR #8811 is actually the reason now the number is shown as a float.

1 Like