Contact sensor dishwasher

I installed on dishwasher knob contact sensor. When dishwasher is off contact sensor is closed. If you turn knob on and turn on dishwasher on any program contact sensor will became open. I have finger bot connected to dishwasher that can remotely press button to run dishwasher.
I would like to make simple automation to start dishwasher if dishwasher is turned on / contact is open /.
What i will like to do is this. If someone turn on dishwasher before 10 pm and dishwasher didn’t start washing turn it on at 10 pm. But don’t repeat this action if for ie. 20 hours dishwasher wasnt turn off.
I have smart plug connected to dishwasher but it doesnt read any current when dishwasher is turned on.
This is simple automation I made in UI

alias: Dishwasher
description: Start washing after 10 pm
  - type: opened
    platform: device
    device_id: 161c7b7763041481eabdb3d244c7bd87
    entity_id: binary_sensor.dishwasher_contact
    domain: binary_sensor
      hours: 0
      minutes: 0
      seconds: 0
  - condition: time
    after: "22:10:00"
  - service: switch.turn_on
    data: {}
      entity_id: switch.zc_adp_finger_robot_v2_1_2_switch
mode: single```
1 Like