#Custom Value in Automation

1 messages · Page 1 of 1 (latest)

pseudo kestrel
#

Hi all, I'm new to HA and loving it so far.
I've tried my best to look on the documentation and other posts and can't seem to find the exact right answer to my problem.

What I'm trying to do is to create an automation that will turn on a bypass valve based on a considition of T1 being bigger than T2+2.

However I don't know what the correct syntax is to add a value to a value and make that the condition that has to be met. I would like to do this as simply as possible ideally straight on this condition block, rather than having an extra variable or sensor that is alsways sensor T2 + a value.

Thank you for the help

sand iron
#

You can also just use a template trigger - have it evaluate the condition and it will trigger when it goes from false to true

pseudo kestrel
#

If I use the visual editor this is how I've set it up.

I've used the numeric state trigger like you suggested, but I'm not sure what the syntax on the Value Template field has to be.
When I search for value template in the page you linked I find no results

sand iron
#

It's... Literally 2 paragraphs down from that subheading

"More dynamic and complex calculations can be done with value_template. The variable ‘state’ is the state object of the entity specified by entity_id.

The state of the entity can be referenced like this:

automation:
  triggers:
    - trigger: numeric_state
      entity_id: sensor.temperature
      value_template: "{{ state.state | float * 9 / 5 + 32 }}"
      above: 70

"