Sonoff pow - count how many coffee

Good day

Got a sonoff pow on a power strip here. to which my coffee machine and dishwasher are connected.

How can I count how many times the dishwasher has been used or how many cups of coffee I have made?

thanks in advance :sunglasses:

Got it partly done,
the device has to warm up (for which it also reaches the threshold, and therefore counts) How can I build in a delay of 30 seconds

So:
sensor.sonoff trigger (when it consumes 1500 watts) delay 30 seconds. and that it will count.

  - platform: history_stats
    name: coffee_counter
    entity_id: binary_sensor.coffee_treshold
    state: "on"
    type: count
    end: "{{ now() }}"
    duration:
      days: 9999
  - platform: template
    sensors:
      coffee_treshold:
        friendly_name: "Coffee"
        value_template: '{{ states("sensor.sonoff_10001c0252_power") | float > 1200 }}'