Setting input min and max number using another input number

Ohh okeii, it works. Thankyou very much

1 Like

Hello there,

i want to do almost the same as michael382:
“set input min and max number using another input number”
(or may be an teplate: sensor in the future)

Background:
I have a Wallbox and want to set the current state of charge (soc) of my car (manually cause my car has no wireless interface)

input_number.auto_links_soc_start

and I want to enter the soc up to which it should be loaded.

input_number.auto_links_soc_soll

It makes only sense if the second one is always above the first one.
So the min (and initial?) Value of the one custom:numberbox-card has to be an other input_number

As state-storage-helper i created

input_number.auto_links_soc_soll_min

I added this in configuration.yaml (i have not template.yaml !?)

template:
  - number:
      - name: min_soc
        state: "{{ states('input_number.auto_links_soc_soll_min') }}"
        set_value:
          - service: input_number.set_value
            data:
              value: "{{ value }}"
            target:
              entity_id: input_number.auto_links_soc_soll_min
        step: 1
        min: "{{ states('input_number.auto_links_soc_start') | int }}"
        max: 100
        availability: "{{ states('input_number.auto_links_soc_start') | is_number }}"

and this in a Lovelace Card:

  - type: custom:numberbox-card
    border: true
    entity: input_number.auto_links_soc_soll
    min: min_soc
    max: 100
    step: 1
    name: Ladung Soll %

In Studio-Code-Server I get in the configuration.yaml after “step: 1” and “max: 100” the error-message “Incorrect type. Expected “string”.”

May be i am to new to HASS to understand, but i would need a “Step 3” in you example, how to put the things in configuration.yaml, Lovelace and the Helpers to work together.
I guessed to enter “min_soc” as the value for “min:” in the numberbox card - but since it doesn’t work, maybe I guessed badly…
And why do i get errors in configuration.yaml?

Can you please help again?

“How to make things work together” is very broad question… that’s basically the question being asked by the totality of every thread on this forum :slight_smile:




It looks like you should be using min_entity instead of min:

  - type: custom:numberbox-card
    border: true
    entity: input_number.auto_links_soc_soll
    min_entity: number.min_soc
    max: 100
    step: 1
    name: Ladung Soll %

The rest of your post jumps around a lot and I can’t tell exactly where else you need help. Please clarify if you have any further questions.