I am trying to pass a temperature value from a template (basically deduct one degree from the current set temperature). However, HA will only accept a numeric value in “temperature” and not my template value
alias: Make Upstairs Cooler
sequence:
- wait_template: >-
{% set upstairs_target_temp = state_attr('climate.upstairs_temperature',
temperature' ) - 1 %}
continue_on_timeout: true
- service: climate.set_temperature
target:
entity_id: climate.upstairs_temperature
data:
temperature: {{ set upstairs_target_temp }}
mode: single
I am trying to get a new set value to set and update my thermostat. If I put it in Developer Tools it does display the value was dropped by 1 which is what I want to set as the new value.
Can you show me how to achieve this? My first real attempt at templating.
The script I posted above, based on your original post, will change the set point of the thermostat to 1 degree less than the current room temperature… can you describe more broadly what you are trying to do and why you would use this approach?
Ultimately, if I wake up in the middle of the night because I over heated, I would like to be able to drop the temperature at night in bed using Alexa without having to open my phone and navigate to ecobee to see the set temperature in order to drop it by one degree. And since I am half-asleep I can’t remember what the current multi-stage cooliing setting is.
Both versions of the template work in D’ tools but when the script I get the error msg. I assume it must be formatting but I can’t find it. However, if I delete the comma between the two temperatures the error goes away.
With your last tweak I was able to finally figure out that it had to be the indentations.
Once I playted around with it I finally got it to work.
I learned a lot and hopefully will be able to pay it forward.
I also changed “>” to “>-”
hope you can help me with a similar issue, PLEASE, I have a temp / humidity sensor loggin into a google sheet, but if it goes offline, ha keeps posting the last value. so I am trying to set the value to temp -40 before reading the state. that way the value will be 31deg - 40 = -9 deg if the sensor is offline but because i read the sensor value after this if the sensor is online it will report the real value.
I am using this
variables: {{ state_attr('sensor.sonoff_1001dbe456_temperature, ‘temperature’ ) | float (0) -40 }}
Please follow the Community Guidelines by posting the full configuration in question, formatted correctly so we don’t have to base answer on conjecture.
Based on the small piece you posted, there are at least 3 errors that need to be addressed: