junkfix / numberbox-card

Replace input_number sliders with plus and minus buttons
109 stars 9 forks source link

Reset input_number #81

Closed mstassenp closed 1 year ago

mstassenp commented 1 year ago

Good morning, Do you have a solution for my little problem. I use several numberbox-card and I reset the different input_number with a script. The values are indeed reset to 0 but the display in the numberbox-card does not reset to 0. On the other hand if I use the + or the minus, then the display becomes correct. Thanks for reading. Michael.

htmltiger commented 1 year ago

I have just tried using input_number.set_value service from developer tools and it works fine. Can you show me a minimal test code/script that I can reproduce the behaviour?

mstassenp commented 1 year ago

Bonjour, In lovelace :

        entities:
          - entity: sensor.cnc_point_xa
            name: Xa
          - entity: sensor.cncxa
            name: Xa corrigé
          - type: custom:numberbox-card
            border: true
            entity: input_number.inxa
            name: Corr.
            state_color: true

In configuration.yaml

In script

alias: cnc_reset sequence:

Resetting "input_number.inxa" works fine. "input_number" is indeed reset to 0. But in the numberbox-card the display does not reset to 0

ildar170975 commented 1 year ago

@mstassenp I suggest you to use a proper formatting for the posted code (use triple "`") - otherwise not possible to be sure that the posted code is correct.

My test, no issues:

service: input_number.set_value
data:
  value: 10
target:
  entity_id: input_number.test_number
type: entities
entities:
  - entity: input_number.test_number
  - type: custom:numberbox-card
    border: true
    entity: input_number.test_number
    name: Corr.
    state_color: true

image

ildar170975 commented 1 year ago
  • platform: template

Also, this sensor seems to be not related to the issue.

htmltiger commented 1 year ago

if you reset to any other value for eg. value: 2 does it update the display correctly?

mstassenp commented 1 year ago

Sorry, it's the same problem. The value is good but the display of the value in the numbox-card does not change.

mstassenp commented 1 year ago

Good morning. I just updated and now it works great. Thank you.