Automation: Multiple conditions including state duration

I can’t get this to fire for the life of me. Any ideas on my syntax?

# Washer Off
- alias: Washer Off
  trigger:                                                                  
    platform: numeric_state
    entity_id: sensor.washer_power
    below: '0.0'
  condition:
    condition: and
    conditions:
      - condition: state                                                        
	    entity_id: input_boolean.washer
        state: 'on'
	  - condition: state
	    entity_id: sensor.washer_power
		to: '0.0'
		for:
		  seconds: 45
  action:
    - service: input_boolean.turn_off
      entity_id: input_boolean.washer

In your trigger you have “below 0.0”, which means it needs to go negative to trigger, which seems physically impossible.
Maybe try making it below 0.1?

Just a quick note: I have a similar automation rule, but I’ve set the threshold below 1w. Even if the dishwasher is done and it has gone dark, it still consumes 0,1 - 0,3w. This might be an error in measurement, but when I raised the threshold from 0 to 1 watt, the automation works perfect!

Technically it could create electricity when the drum is still turning the electro motor would function as a dynamo :slight_smile:

Fixed the indenting (yaml does not like tabs!) and changed to: to state: in your condition:

# Washer Off
- alias: Washer Off
  trigger:
    platform: numeric_state
    entity_id: sensor.washer_power
    below: '0.0'
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: input_boolean.washer
        state: 'on'
      - condition: state
        entity_id: sensor.washer_power
        state: '0.0'
        for:
          seconds: 45
  action:
    - service: input_boolean.turn_off
      entity_id: input_boolean.washer

I didn’t alter your trigger’s below: value but the people above me probably have a point.

0.0 vs. 0.1 did the trick but the logic still did not work for the condition of 45sec. It would never enter the trigger because the condition was never met. I ended up re-writing using the thread below.

Thanks everyone!