How to set target in blueprint for service?

Hello!

I have a blueprint like:

input:
  thermostat:
    name: Thermostat
    description: Thermostat      
    selector:
      target:
        entity:
          domain: climate

variables:
  thermostat: !input thermostat

In the action, I want to set the temperature for this thermostat:

-service: climate.set_temperature
 data:
   temperature: 22
   hvac_mode: heat
   target:
     entity_id: 
       - thermostat.entity_id

But nothing is happening when running an automation created with this blueprint. No error is shown as well. But when using the thermostat directly like this:

target:
  entity_id: 
    - climate.mythermostat

it works.

How do I have to set the target to make it adjustable and match the one from the input?

Added:
I tried various things like:

target: thermostat 

or

target: !input thermostat

which resultet in Message malformed: expected a dictionary for dictionary value @ data[‘action’][0][‘then’][0][‘target’]

To use a variable like the one you created above, it goes within a template like this. You have the names overlapping which doesn’t cause an error, but is confusing. (I usually change the name slightly on a created variable to something like _thermostat.)

"{{ thermostat }}"

However I’m guessing this might work for your actual question:

- service: climate.set_temperature
  data:
    temperature: 22
    hvac_mode: heat
    target:
      entity_id: 
        - !input thermostat
1 Like