Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Buttons to increase and decrease temperature

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>