Automation? Input number? Help :)

Hello, I need to build such a diagram.
I have a certain sensor, let’s assume the sensor has a value of 20.
I would like an action to take place after exceeding 20.1, e.g. a siren. When the sensor returns to 20, the siren stops.
Only that the sensor value is variable, e.g. next time I would like to turn on the siren with a starting value of 25 and an increase of 0.3.
How to do it the fastest and most conveniently?

  1. Use an input_number helper to hold the trigger value

  2. Two triggers, one for above the input_number value, one for below it.

  3. Action option 1 (trigger 1):

  • sound siren
  1. Action option 2 (trigger 2):
  • stop siren
  • increment input_number

Can you help me write .yaml?

If you’re new to yaml, write it in the UI first. It’s a good way to learn - you can look at the yaml afterwards

- id: '1713991116749'
  alias: 'Test '
  description: ''
  - platform: numeric_state
    - sensor.vindriktning_particulate_matter_2_5_m_concentration
    above: input_number.test
    below: input_number.test
  condition: []
  action: []
  mode: single

And i dont know what next…

Don’t use above and below. Create two separate triggers, one for above, one for below.

Next step is to give each trigger an ID. Click on the “three dots” next to each one, then on “Edit ID”. You can call them anything you like.

Then in the action part of the automation select “Choose” and you can define an action for each one of your triggers.

1 Like

But not working :clap:

1 Like