Detect washing machine running by current value in mA with smoothed out readings

Hello.

I got the following problem.

I got the currently consumed current of my washing machine in mA from KNX. With the “Threshold” integration I am able to set a binary sensor to “on” when a specific current value is exceeded.
The problem is that the value falls below the upper limit during runtime only for short periods of time while the device is still running. This leads to a constantly switching binary sensor which makes no sense.

What is the right way to smooth out these spikes below the upper limit? What is the easiest way to send smoothed out values to the threashold integration? (an average or sth like that)

Perhaps someone has some experience with the Filter - Home Assistant integration and could suggest me some filters that make sense in that case.

Thank you very much.

Denis

Id just try an automation using a numeric state with below: and the for: keyword in the trigger.

1 Like

When you are setting up your automation to check for the running/stopped states make sure you used the “for” time duration. I’m using this same setup and by setting the duration to like 5 minutes I don’t have fals positives. This doesn’t smooth things out from the standpoint of looking at your history however in the case of automation use this works perfect and resolves the issue of false positives when triggering automations.

1 Like

Here is an example of one of my automations that I use for both my washer & dryer complete notifications.

alias: Notification - Washer/Dry Run Complete
description: ''
trigger:
  - platform: state
    entity_id:
      - binary_sensor.washing_machine_running
    from: 'on'
    to: 'off'
    id: washing-machine-finished
    for:
      hours: 0
      minutes: 5
      seconds: 0
  - platform: state
    entity_id:
      - binary_sensor.dryer_running
    from: 'on'
    to: 'off'
    id: dryer-finished
    for:
      hours: 0
      minutes: 10
      seconds: 0
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: washing-machine-finished
          - condition: state
            entity_id: binary_sensor.washing_machine_running
            state: 'off'
        sequence:
          - service: notify.notify
            data:
              data:
                ttl: 0
                priority: high
              message: >-
                The washing machine load has finished, don't forget to put it in
                the dryer!
              title: Appliance Cycle Finished
      - conditions:
          - condition: trigger
            id: dryer-finished
          - condition: state
            entity_id: binary_sensor.dryer_running
            state: 'off'
        sequence:
          - service: notify.notify
            data:
              data:
                ttl: 0
                priority: high
              title: Appliance Cycle Finished
              message: The dryer load has finished!
    default: []
mode: parallel
max: 2

Thank you to both of you. This did work perfectly fine.

Also, you might find this blueprint useful:

I’m leaving it here, just in case.

1 Like