#Perform action: number.set_value to increment a number value

1 messages · Page 1 of 1 (latest)

whole mountain
#

Having a helluva time getting number.set_value to work correctly from a Button card.

When I fire number.set_value in Developer Tools, works great. When I do the exact same action from the Button card, I get the following error:

Failed to perform the action number/set_value. expected float for dictionary value @ data['value']

Here's the relevant YAML:
Works - Developer Tools

action: number.set_value
target:
  entity_id: number.nintendo_switch_play_time_limit
data:
  value: "{{ states('number.nintendo_switch_play_time_limit') | float + 30 }}"

No workee - dashboard

show_name: true
show_icon: true
type: button
name: Add 30 minutes to Nintendo Time
icon: mdi:nintendo-switch
tap_action:
  action: perform-action
  perform_action: number.set_value
  target:
    entity_id: number.nintendo_switch_play_time_limit
  data:
    value: "{{ states('number.nintendo_switch_play_time_limit') | float + 30 }}"

Can't figure out what in the world I'm doing wrong. I'm relatively new to some of this templating/liquid syntax... been able to get away with some fairly basic stuff, but starting to wander into more advanced controls trying to increment this number.

sharp seal
#

you can't use a template there

#

put that action into a script and call the script from the button

whole mountain
whole mountain