Numeric automation doesn't start

Hi,
I am pretty new to home assistant and could not find a solution to the following:
I have a solar system on my roof and I want to activate a ventilation device in the basement when there is excess electricity generated.

I have created an automation in Home Assistant with the following configuration:


alias: Baulüfter test an
description: ""
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.import_power
    above: 100
condition: []
action:
  - service: switch.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: switch.tasmota
mode: single

The automation is not triggering when the sensor value exceeds 100. I have checked the configuration (with AI :slight_smile: ), but the automation still does not work. If I trigger the smart plug using a time schedule, then the automation works. Any suggestions or insights on why the automation is not triggering would be appreciated. Thank you!

Best regards
Daniel

It will only trigger when it crosses over 100 and then will not trigger again until it falls bellow and the increases to above 100. You need to use the power as a condition and have a different trigger.

I think I made a mistake in setting up the automation. Thank you for your tip. In my case, the sensor was already above 100, so no trigger was activated. My goal is for the smart socket to turn on and stay on when the sensor is above the value of 100, and turn off again when the sensor is below 100.

I’m just not sure what event I could define as a trigger. Do I even need a trigger? Actually, the socket should always be on when the sensor is above 100 and always off when the sensor is below 100.

Appreciate your help. Best regards, Daniel

Use a Template Switch:

Or as an automation:

trigger:
  - platform: state 
    entity_id: sensor.import_power
action:
  - service: switch.turn_{{ 'on' if trigger.to_state.state|float > 100 else 'off' }}
    entity_id: switch.tasmota

That assumes your switch doesn’t mind being repeatedly told to turn on when it already is on.