How to set thermostat temperature in automation?

Can someone tell me how to set the temperature of a thermostat in an automation? The script below generates the error shown.

I’m actually looking for a simple thermostat scheduler which would allow me to set the temperature at certain times of the day.

-Thanks

When I run this I get the error:
image

alias: Set Thermostat to 72°F at 7 AM
trigger:
  - platform: time
    at: "08:30:00"
action:
  - service: climate.set_temperature
    target:
      entity_id: climate.thermostat_downstairs
    data:
      temperature: 70
mode: single

Try

triggers:
  - trigger: time
    at: "08:30:00"

Here is your automation using updated syntax.

alias: Set Thermostat to 72°F at 7 AM
triggers:
  - trigger: time
    at: "08:30:00"
conditions: []
actions:
  - action: climate.set_temperature
    target:
      entity_id: climate.thermostat_downstairs
    data:
      temperature: 70
mode: single
  • trigger, condition and action are changed to their plural form.
  • platform is now trigger.
  • service is now action.
1 Like

Great point! You can still use:

  action: call-service
  service: climate.set_temperature
  target:
    entity_id: climate.living_room
  data:
    temperature: 70

but the need is pretty limited or not needed at this point!

Thank you!

I copied and pasted your YAML into an automation and changed the time to 10:15 AM and temperature to 70. The automation was triggered, but when I checked my thermostat card the temperature did not change to 70.

What does the debug trace show?

If all the steps of the automation were successful, what does the the History and Logbook for the thermostat show? Did something else change the value?

The trace looked normal (shown below) and I found no errors in the log. Also, these devices are pulled into HA by the Hubitat Integration. So I disabled the downstairs thermostat and also the thermostat controller in Hubitat, but the temperature still did not change when I ran the automation.

You mentioned logbook for the thermostat. Is there a log specifically for devices?

-Thanks

Confirm that the climate.set_temperature action does in fact work for climate.living_room.

  • Go to Developer Tools → Actions
  • Select the Set Target Temperature action
  • Select your living room climate entity
  • Enable the Target Temperature field and enter the desired temperature value
  • Click Perform Action

If the thermostat’s target temperature changes then it means the action is able to successfully communicate with your thermostat device.

If it doesn’t change then it implies there’s a problem communicating with the device.

NOTE

I suggest using Developer Tools → States to inspect the climate entity’s values.

I followed your instructions and when I clicked “Perform action” it changed to a green button with a checkmark. But no temperature change.

I suspect this may have to do with the fact that ALL of the devices I currently have in HA are brought in via the Hubitat Integration.

I just completed porting my last automation from Hubitat to HA, and now I’m ready to connect the ZWA-2 controller and begin unpairing devices from Hubitat and pair them with HA. Wish me luck!

And thank you for the Developer tools lesson.

1 Like

Your screen shot looks like mine. I have auto switching thermostat between heating and cooling.

Here is my action:

      - action: climate.set_temperature
        target:
          entity_id: climate.z_wave_plus_thermostat
        data:
          target_temp_high: "{{ states.input_number.thermostat_day_cool.state | int() }}"
          target_temp_low: "{{ states.input_number.thermostat_day_heat.state | int() }}"

I am using helpers for the setting. But, should help you.

ETA:
Here are my helpers on a dashboard so the wife can make changes. It describes what my automations do with them.

Any progress to report?

Oh, I just saw this response! Yes, after porting all of the devices in Hubiat to HA using the Hubitat integration, I replicated all of the automations. And now I am almost complete porting the devices thenselves (About 30). I saved the most difficult for last - My thermostats and Aqara T1 valve controller along with 13 Zooz water sensors. After that I’ll be 100% Home Assistant!

The automation and device porting process has been frustrating at times, but I’m really enjoying learning HA. It is much more capable than Hubitat.

FYI I wound up with a ZWA-2 and ZBT-1 and both are functioning flawlessly.

-Thanks

Does the automation designed to set the thermostat to 72 degrees at 7:00 AM work now?