They’re just like automations without trigger or condition blocks. Basically just the action section (though it is called “sequence”) that you can run manually.
Even the syntax for automation actions is called “script syntax”:
I got the example script to run and send the message however my sequence to change my value doesn’t seem to do anything. I ran it use the developer->services.
This is in my log:
Referenced entities sensor.ground_temp are missing or not currently available
not sure why it says missing as I can read its value?
message_temperature:
sequence:
# This is Home Assistant Script Syntax
- service: notify.notify
data:
message: "Current temperature is {{ states('sensor.ground_temp') }}"
adjust_temp_up:
sequence:
- service: climate.set_temperature
target:
entity_id: sensor.ground_temp
data:
temperature: '{{ states("sensor.ground_temp") |float + 1 }}'
You are trying to call a climate service on a sensor instead of a climate entity… based on your original post, the target of the service should be climate.thermostat.
A climate entity is for controlling a heating/cooling device. It’s designed for setting the target temperature. That’s why there are service calls available for a climate entity (to set mode/temperature/etc).
In contrast, a sensor entity is for reporting a value, typically some property of a device. There are no service calls for sensor entities and you can’t use a climate entity’s service calls for a sensor entity (like what you had originally attempted to do).
Your latest attempt is more correct. You’re setting the climate entity’s target temperature to the sensor entity’s value.
Be advised that when you use the float filter, you should provide it with a default value. If you don’t, and the sensor’s value is ever non-numeric (like unavailable), the float filter will fail (thereby causing your script to fail with an error message). For example, if you want a default of 70 then specify it like this: