Been wracking my head for the last little while on this one: " expected float for dictionary value @ data['value'] "

I’ve tried this code a few different ways but always end up back with the error
Failed to call input_number/set_value. expected float for dictionary value @ data['value']

The Lovelace card that triggers it without the intended function of changing the value:

type: 'custom:button-card'
icon: 'mdi:home'
tap_action:
  action: call-service
  service: input_number.set_value
  service_data:
    entity_id: input_number.mainroom_brightness
    value: '{{ states.input_number.apartment_brightness.state | float }}'

Any thoughts on what I must be missing would be appreciated. I’ve already tried using value: "{{ states('input_number.apartment_brightness') | float }}" instead to no avail. Also tried to pre-convert the state of the input_number to float in a template sensor. Really not sure what else to do and this particular error doesn’t have too much come up when you Google it.

Any help would be appreciated!

1 Like

You can’t use templates in Lovelace cards without one of the custom template cards.

2 Likes

You can’t template lovelace fields.

1 Like

You can but you need this:

1 Like

Aah, thank you both. I knew it had to be something simple like that that I was missing.