Blueprint: template trigger problem

Dear friends, I’ve spend a couple of days trying to create a blueprint from a (complex) automation.
Unfortunately, I didn’t get the created blueprint triggered by a template trigger (working well within “normal” automation).

Question in short version:
How to transform the template-trigger into blueprint version:

trigger:
   - platform: template 
     value_template: "{{ states('sensor.room_t') |float > state_attr('climate.room_thermostat',
'temperature') |float }}"

sensor.room_t and climate.room_thermostat to be replaced.

Additionally I have troubles with condition comparing the name of entitiy:

- condition: template
  value_template: '{{ trigger.from_state.entity_id  == "sensor.room_t"}}'

What I’ve tried:

variables:
    climate_target: !input climate_target
    t_current_target: !input t_current_target
trigger:
  - platform: template
    value_template: "{{ states[t_current_target].state | float  > state_attr(climate_target, 'temperature') |float}}"

The trigger above doesn’t trigger at all (but working correctly i.e. in variable section)

I guess, the main problem is wrong syntax in template-trigger (I’ve tried different possibilities).
Somehow, the variables defined above are empty / null in trigger section.

Maybe you have a hint for me, what I’m doing wrong.

Thank you :slight_smile:

No suggestions? If the problem isn’t clear, I can describe more.

I have a work around for the problem, since I can define an additonal binary_sensor and use it as input for trigger, avoiding the template-trigger, but it isn’t the solution of the problem

binary_sensor:
  - platform: template
    sensors:
        room_above_goal_t:
            friendly_name: "Room: T > T_goal"
            value_template: >-
          {{ states('sensor.room_t') | float > state_attr('climate.room_thermostat', 'temperature') |float }}

and trigger at room_above_goal_t OFF -> ON.

No requirement of the additional sensor is the main reason for such a complex trigger and condition sections, anyway, I would like to get it running in blueprint.

Do you have an example for blueprint in mind, using template-trigger ?

You can’t use variables in template triggers, there’s a feature request somewhere for this.

Thank you for your reply.
I’ve implemented blueprint with two additional sensors as described above (seems to work) and will wait till we got the feature.

Vote here: