Automation with Numeric Condition

Hi everyone

I’m setting up my gardeing watersystem.
As for now I have everything setup beside a condition of the moist.
Since the moist is in % i don’t know how this works with the numbers.

I tried to set it to the normal number like 60 (for 60%) and ofc. 0.6 (what would be 60%). Sadly nothing works and the watercomputer will start all the time nomather how wett my plants are…

Any suggestions?
As an addoing. I have 8 Moist sensors, and i created a Helper with the Median, this entity im using for my automation.

heres what it looks like:

state_class: measurement
unit_of_measurement: %
icon: mdi:calculator
friendly_name: Moist_Median

The number will be from 0 to 100, not 0 to 1. Paste in the YAML for the automation you have tried.

Hi Troon.

Thanks. This one.
If i hit the Start Button to thest the automation. It still should not water it right? Because of the condition? Or could this be a problem, because I start it manually?

alias: Water_Evening
description: ""
  - platform: time
    at: "21:30:00"
  - condition: numeric_state
    entity_id: sensor.moist_median
    above: 1
    below: "60"
  - device_id: 2ad688322897f43dbb960dff32956a40
    domain: number
    entity_id: number.watercomputer_1_valve_state
    type: set_value
    value: 15
  - device_id: 2ad688322897f43dbb960dff32956a40
    domain: number
    entity_id: number.watercomputer_1_valve_state_auto_shutdown
    type: set_value
    value: 15
  - device_id: 2ad688322897f43dbb960dff32956a40
    domain: number
    entity_id: number.watercomputer_1_shutdown_timer
    type: set_value
    value: 60
mode: single

Your automation is going to turn on the water at 21:30 but only if the moisture median is between 1 and 60. If that’s what you want, then it works.

Yes - if you manually trigger the automation then all triggers and conditions (in fact everything other than actions) are ignored.

Thanks for the Awnser. So if my Helper is at 50% it should start the automation, when the condition is between 1 and 60?
No matter if the Helper shows everything in % and in the condition i am not able to use it (percentage).

It will start the automation at 21:30 because that’s what the only trigger is.

If your sensor.moist_median is at 50 at that time, then the condition block will pass and the action will run.

If the sensor is outside the 1–60 range, then the action will not run and nothing will happen until it is triggered at 21:30 on the next day.

There’s no complications with % like there is in Excel, for example. The sensor state is "50" and it has a unit_of_measurement of "%" but that’s just a label — HA does not “understand” percentages.

Many many many thanks :slight_smile: worked

1 Like