Using Variables / Sensor Data in service call automations

Hey guys -

I downloaded the customization for input variables, but I have my formatting incorrect for storing a sensor value within that variable. I could probably steal a yaml example, but for now id like to stick to the GUI until I am more comfortable

What is the correct formatting in this situation? I have tried several

Do you mean you have installed a custom integration? Which one…? There are several related to “variables”, each with it’s own particular configuration specifications.

Which situation?

I guess I forgot to attach the screenshot, sorry. I have updated the original post

The integration I have installed is here.

The attached picture should give you an idea of what I am trying to do.

Use Case:

I have created a virtual thermostat from a basic temp sensor. Between Sunset and Sunrise (sleep time) I want the bedroom virtual thermostat to control the house so that my bedroom stays the temp that I expect.

I plan to do this by setting the living room (main) thermostat to a low temp like 65 and then using the virtual thermostat to toggle the mode on and off as needed. After sunrise, I will return the mode and temp to their previous settings (captured at the beginning of the automation)

The general answer is that you need to use Templating. From the picture you posted, the service call would be:

  - service: input_text.set_value
    target:
      entity_id: input_text.living_room_lasttemp
    data:
      value: "{{ states('sensor.living_room_temperature') }}"

It is still unclear how this relates to custom variable entities…

Is there a reason why you are using an Input Text for numeric values instead of an Input Number?

I made the assumption that I could use text and it would work the same

Is this possible to do in the gui also?

I’ll test when I get home

Bumping this thread because I have a very similar use case. I’m getting my head round YAML but I like to keep automations visible in the GUI unless absolutely unavoidable.

I have an automation called “bathroom boost” which when pressing the button, will crank up the underfloor heating and towel rail temperature and start a timer counting down. There is then another trigger to detect when the timer expires, to turn everything back down again.

BUT rather than just turning off the thermostats completely or setting to some default value, I’d like to return them to their previous value.

So to my mind, that requires setting a ‘helper’ attribute to store the current thermostat temp when invoking the boost, then to set it back to that value when the boost expires.

Is this possible via the front end, by entering a template value instead of an absolute value in centigrade, when calling the set thermostat service?

did you get this working @Wickedy123 ? I have done this with thermostat automations if you still need help