Numeric state trigger

why does this not trigger?

image

alias: Pool pumpe Besked ved overforbrug kwh
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.forbrug_idag
    above: '0.1'
    below: '0.6'
condition: []
action:
  - service: notify.mobile_app_rhmobil
    data:
      message: Pool pumpe bruger for meget strøm
  - service: notify.gmail
    data:
      message: Pool pumpe bruger for meget strøm
mode: restart

For this automation to work the sensor value need to go from a value below 0.1 to above it or go from above 0.6 and below, so it needs to cross the values gives.

So it could be that this sensor value stays inbetween 0.1 and 0.6 from day to day for your case as it is a sensor for the daily power consumption for your pool pump. Is this a sensor you have made yourself? If so you should perhaps make an automation that zeros it out at midnight.

thanks - it goes to zero every night
image

so i hope this will work tomorrow - when it goes for 0 to 0.5 ,this will trigger?

image

You needn’t wait until tomorrow, under developer tools/states you can manually set a value out of the triggering range.

Set 1 for example and click set state. After that, set a value whithin the triggering range and it should work.

The actual value of the sensor will automatically revert to the readings as soon as the sensor updates.

If you want it to trigger anyways despite not surpassing those thresholds, this would do it.

alias: Pool pumpe Besked ved overforbrug kwh
description: ''
trigger:
  - platform: state
    entity_id: sensor.forbrug_idag
condition:
  - condition: template
    value_template: "{{ 0.1 <= states('sensor.forbrug_idag')|float <= 0.6}}"
 ...

DOH! :- ) you’re so right … it worked… thanks for your time and help!

1 Like