@denver wrote:
Im trying to create a button to increase the temperature by 0.5 deg on each press.
This is the code so far:
- type: "custom:button-card" tap_action: action: call-service service: climate.set_temperature service_data: entity_id: climate.home temperature: > {{ (state_attr('climate.home', 'temperature') +0.5) | float }} icon: "mdi:plus" show_name: false
Its displaying the message in the UI:
Failed to call service climate/set_temperature. expected float for dictionary value @ data['temperature']
If I replace the
{{ (state_attr('climate.home', 'temperature') +0.5) | float }}
with say 21, the button works changing the temperature to 21. Which makes me think the problem is within the {{ }} line. I recently added the
'| float'
but it still didn’t resolve the issue.Ive tested the {{ }} line in dev-tools > template and all works.
Posts: 4
Participants: 4