Using the value of a slider to trigger automation

I have my 3D printer connected to HA, and i made an automation that will send an alert to my phone when the printer reaches a certain layer. To streamline the whole thing, I made a slider helper and I’m trying to get the automation to read the value of that slider so i dont have to go in and change the automation each time i want to use it:

alias: PRINTERALERT
description: ""
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.x1c_00m00a280102462_current_layer
    above: "{{input_number.target_layer}}"
condition:
  - condition: state
    entity_id: input_boolean.turnonprinteralerts
    state: "on"
action:
  - data:
      message: PRINTER IS CLOSE
    action: notify.mobile_app_esteban_iphone_13
mode: single

Please don’t post pictures of code… Community Guideline #11

You don’t use templates in the above value, just use the entity ID of the input number:

above: input_number.target_layer


If you were trying to get the value elsewhere, you would need to use the states() function:

{{ states('input_number.target_layer') }}

1 Like

apologies, i fixed the OP, thanks for the help!!