#not_from trigger for numeric_state

1 messages · Page 1 of 1 (latest)

distant sierra
#

I'm monitoring my washing machine cycle and can successfully get "cycle completed" when power is below 5W for 2 minutes. But when the monitoring device (ESPHome based wall switch) updates and powers-up, my trigger for numeric_state < 5W fires.

I am aware of "entity" trigger with "not_from".

Can we use "not_from" functionality with numeric state change, too?

triggers:
  - entity_id:
      - sensor.athom_smart_plug_v2_u10_d747e1_washing_machine_power
    for:
      hours: 0
      minutes: 2
      seconds: 0
    below: 5
    trigger: numeric_state
#

Alternative option that I see is to start the automation when power goes above 5W and then do the "wait for trigger" when it goes back down to sub 5W for 2min.

Doesn't seem so elegant solution, is it?

deft basalt
#

you can use a condition to filter out that kind of "false" trigger

condition: template
value_template: "{{ not (trigger.from_state.state in ['unknown', 'unavailable'] }}"
distant sierra
#

yep, this worked! thanks.

oak spoke
#

i am extremely new to HA ... how do i implement this "template" condition? ive never done that

#

alias: Basement_Energy_washing_machine
description: ""
triggers:

  • type: power
    device_id: 9e11b7ada91f54faf612e32da1bdc32b
    entity_id: 02b4b6532fcf15c992577042a1cd18f2
    domain: sensor
    trigger: device
    below: 10
    for:
    hours: 0
    minutes: 2
    seconds: 0
    conditions: []
    actions:
  • action: notify.mobile_app_flip5
    data:
    message: the washing is done!
    mode: single
#

(sry for the shit formatting)

#

this is the automation that currently is working. can i just add what you posted in the "conditions" part?