Button press returns error on image card but works fine in Dev Tool

Hi all,
I’ve got a bit of a strange one. I’m working on my next version of the Tesla card and adding in nice winter options (heated seats, climate etc)

My card has a simple format:

                - type: image
                  title: Climate
                  entity: climate.terrance_hvac_climate_system
                  image: >-
                    /local/Tesla/images/buttons/Tesla_Climate_Button_Increase.jpg
                  style:
                    top: 40%
                    left: 80%
                    width: 50px
                    height: 50px
                  tap_action:
                    action: call-service
                    service: climate.set_temperature
                    data: 
                      temperature: "{{ state_attr('climate.terrance_hvac_climate_system', 'temperature') +1 | float}}"
                    target:
                      entity_id: climate.terrance_hvac_climate_system
                  double_tap_action: none
                  hold_action: 
                    action: call-service
                    service: climate.set_temperature
                    data: 
                      temperature: "{{ state_attr('climate.terrance_hvac_climate_system', 'target_temp_high') +1}}"
                    target:
                      entity_id: climate.terrance_hvac_climate_system

This throws an error:

Failed to call service climate.terrance_hvac_climate_system.  Expected float for dictionary value @data[temperature]

But in the dev console:

service: climate.set_temperature
data:
  temperature: "{{ state_attr('climate.terrance_hvac_climate_system', 'temperature') +1 }}"
target:
  entity_id: climate.terrance_hvac_climate_system

This works perfectly. I’ve tried piping to float as well but that makes no difference. Any tips?

Thanks,

I’m not 100% sure about Image cards, but most core cards do not accept templating. You can move your climate action with templated logic to a script then call the script as a service.

The Template editor only “knows” plain text and Jinja templates… it has no concept of YAML or where templates can actually be used.

Thanks, I was wondering if its a yaml limitation. I’ve done a lot with Puppet in the past and you can mess around with things in yaml quite heavily but I guess its how its read later. I’ll make a script file.

I really need to get all this working and make a hacs installer, the instructions are getting a little more gnarly for people.