Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save mdehaas/30eb316ce724bc5f3be4c0b20f2c512e to your computer and use it in GitHub Desktop.

Select an option

Save mdehaas/30eb316ce724bc5f3be4c0b20f2c512e to your computer and use it in GitHub Desktop.

Revisions

  1. mdehaas revised this gist Mar 18, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion applicance-started-andor-stopped.yaml
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    blueprint:
    name: Appliance has started and/or finished
    name: Appliance has started and/or finished (2022.1.7)
    description: Do something when an appliance (like a washing machine or dishwasher) is started or has finished as detected by a power sensor based in the Watts consumed.
    domain: automation
    input:
  2. mdehaas revised this gist Jan 24, 2022. 1 changed file with 9 additions and 8 deletions.
    17 changes: 9 additions & 8 deletions applicance-started-andor-stopped.yaml
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    blueprint:
    name: Appliance has started and/or finished
    description: Do something when an appliance (like a washing machine or dishwasher)
    has finished as detected by a power sensor.
    description: Do something when an appliance (like a washing machine or dishwasher) is started or has finished as detected by a power sensor based in the Watts consumed.
    domain: automation
    input:
    power_sensor:
    @@ -13,11 +12,11 @@ blueprint:
    starting_threshold:
    name: Starting power threshold
    description: Power threshold above which we assume the appliance has started.
    default: 5
    default: 100
    selector:
    number:
    min: 1.0
    max: 100.0
    max: 250.0
    unit_of_measurement: W
    mode: slider
    step: 1.0
    @@ -57,13 +56,15 @@ blueprint:
    mode: slider
    step: 0.25
    started_actions:
    name: Started Actions
    description: General Actions (e.g. pushing a notification, TTS announcement, ...)
    name: Started actions
    description: Automation actions to execute when the appliance has started.
    default: {}
    selector:
    action: {}
    finished_actions:
    name: Finished Actions
    description: General Actions (e.g. pushing a notification, TTS announcement, ...)
    name: Finished actions
    description: Automation actions to execute when the appliance has finished.
    default: {}
    selector:
    action: {}
    source_url: "https://gist.github.com/mdehaas/30eb316ce724bc5f3be4c0b20f2c512e"
  3. mdehaas renamed this gist Jan 23, 2022. 1 changed file with 14 additions and 7 deletions.
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    blueprint:
    name: Appliance has finished
    name: Appliance has started and/or finished
    description: Do something when an appliance (like a washing machine or dishwasher)
    has finished as detected by a power sensor.
    domain: automation
    input:
    power_sensor:
    name: Power Sensor
    description: 'Power sensor entity (e.g. from a smart plug device).'
    description: Power sensor entity (e.g. from a smart plug device).
    selector:
    entity:
    domain: sensor
    @@ -56,12 +56,17 @@ blueprint:
    unit_of_measurement: min
    mode: slider
    step: 0.25
    actions:
    name: Actions
    description: Actions (e.g. pushing a notification, TTS announcement, ...)
    started_actions:
    name: Started Actions
    description: General Actions (e.g. pushing a notification, TTS announcement, ...)
    selector:
    action: {}
    source_url: https://gist.github.com/sbyx/6d8344d3575c9865657ac51915684696
    finished_actions:
    name: Finished Actions
    description: General Actions (e.g. pushing a notification, TTS announcement, ...)
    selector:
    action: {}
    source_url: "https://gist.github.com/mdehaas/30eb316ce724bc5f3be4c0b20f2c512e"
    trigger:
    - platform: numeric_state
    entity_id: !input 'power_sensor'
    @@ -70,13 +75,15 @@ trigger:
    above: !input 'starting_threshold'
    condition: []
    action:
    - choose: []
    default: !input 'started_actions'
    - wait_for_trigger:
    - platform: numeric_state
    entity_id: !input 'power_sensor'
    below: !input 'finishing_threshold'
    for:
    minutes: !input 'finishing_hysteresis'
    - choose: []
    default: !input 'actions'
    default: !input 'finished_actions'
    mode: single
    max_exceeded: silent
  4. @sbyx sbyx revised this gist Dec 30, 2020. 1 changed file with 2 additions and 2 deletions.
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ blueprint:
    default: 5
    selector:
    number:
    min: 1.0
    min: 0.25
    max: 60.0
    unit_of_measurement: min
    mode: slider
    @@ -51,7 +51,7 @@ blueprint:
    default: 5
    selector:
    number:
    min: 1.0
    min: 0.25
    max: 60.0
    unit_of_measurement: min
    mode: slider
  5. @sbyx sbyx revised this gist Dec 30, 2020. 1 changed file with 2 additions and 2 deletions.
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@ blueprint:
    max: 60.0
    unit_of_measurement: min
    mode: slider
    step: 1.0
    step: 0.25
    finishing_threshold:
    name: Finishing power threshold
    description: Power threshold below which we assume the appliance has finished.
    @@ -55,7 +55,7 @@ blueprint:
    max: 60.0
    unit_of_measurement: min
    mode: slider
    step: 1.0
    step: 0.25
    actions:
    name: Actions
    description: Actions (e.g. pushing a notification, TTS announcement, ...)
  6. @sbyx sbyx revised this gist Dec 27, 2020. 1 changed file with 41 additions and 31 deletions.
    Original file line number Diff line number Diff line change
    @@ -1,72 +1,82 @@
    blueprint:
    name: Appliance has finished
    description: Do something when an appliance (like a washing machine or dishwasher) has finished as detected by a power sensor.
    description: Do something when an appliance (like a washing machine or dishwasher)
    has finished as detected by a power sensor.
    domain: automation
    input:
    power_sensor:
    name: Power Sensor
    description: "Power sensor entity (e.g. from a smart plug). Needs to have device_class: power"
    description: 'Power sensor entity (e.g. from a smart plug device).'
    selector:
    entity:
    domain: sensor
    device_class: power
    starting_threshold:
    name: Starting power threshold
    description: "Power threshold above which we assume the appliance has started."
    description: Power threshold above which we assume the appliance has started.
    default: 5
    selector:
    number:
    min: 1
    max: 100
    min: 1.0
    max: 100.0
    unit_of_measurement: W
    mode: slider
    step: 1.0
    starting_hysteresis:
    name: Starting hysteresis
    description: "Time duration the power measurement has to stay above the starting power threshold."
    description: Time duration the power measurement has to stay above the starting
    power threshold.
    default: 5
    selector:
    number:
    min: 1
    max: 60
    min: 1.0
    max: 60.0
    unit_of_measurement: min
    mode: slider
    step: 1.0
    finishing_threshold:
    name: Finishing power threshold
    description: "Power threshold below which we assume the appliance has finished."
    description: Power threshold below which we assume the appliance has finished.
    default: 5
    selector:
    number:
    min: 1
    max: 100
    min: 1.0
    max: 100.0
    unit_of_measurement: W
    mode: slider
    step: 1.0
    finishing_hysteresis:
    name: Finishing hysteresis
    description: "Time duration the power measurement has to stay below the finishing power threshold."
    description: Time duration the power measurement has to stay below the finishing
    power threshold.
    default: 5
    selector:
    number:
    min: 1
    max: 60
    min: 1.0
    max: 60.0
    unit_of_measurement: min
    mode: slider
    step: 1.0
    actions:
    name: Actions
    description: Actions (e.g. pushing a notification, TTS announcement, ...)
    selector:
    action:

    action: {}
    source_url: https://gist.github.com/sbyx/6d8344d3575c9865657ac51915684696
    trigger:
    - platform: numeric_state
    entity_id: !input power_sensor
    for:
    minutes: !input starting_hysteresis
    above: !input starting_threshold
    - platform: numeric_state
    entity_id: !input 'power_sensor'
    for:
    minutes: !input 'starting_hysteresis'
    above: !input 'starting_threshold'
    condition: []
    action:
    - wait_for_trigger:
    - platform: numeric_state
    entity_id: !input power_sensor
    below: !input finishing_threshold
    for:
    minutes: !input finishing_hysteresis
    - choose: []
    default: !input actions
    - wait_for_trigger:
    - platform: numeric_state
    entity_id: !input 'power_sensor'
    below: !input 'finishing_threshold'
    for:
    minutes: !input 'finishing_hysteresis'
    - choose: []
    default: !input 'actions'
    mode: single
    max_exceeded: silent
    max_exceeded: silent
  7. @sbyx sbyx revised this gist Dec 15, 2020. 1 changed file with 8 additions and 4 deletions.
    Original file line number Diff line number Diff line change
    @@ -12,31 +12,35 @@ blueprint:
    device_class: power
    starting_threshold:
    name: Starting power threshold
    description: "Power threshold above which we assume the appliance has started. (suggestion: 5)"
    description: "Power threshold above which we assume the appliance has started."
    default: 5
    selector:
    number:
    min: 1
    max: 100
    unit_of_measurement: W
    starting_hysteresis:
    name: Starting hysteresis
    description: "Time duration the power measurement has to stay above the starting power threshold. (suggestion: 5)"
    description: "Time duration the power measurement has to stay above the starting power threshold."
    default: 5
    selector:
    number:
    min: 1
    max: 60
    unit_of_measurement: min
    finishing_threshold:
    name: Finishing power threshold
    description: "Power threshold below which we assume the appliance has finished. (suggestion: 5)"
    description: "Power threshold below which we assume the appliance has finished."
    default: 5
    selector:
    number:
    min: 1
    max: 100
    unit_of_measurement: W
    finishing_hysteresis:
    name: Finishing hysteresis
    description: "Time duration the power measurement has to stay below the finishing power threshold. (suggestion: 5)"
    description: "Time duration the power measurement has to stay below the finishing power threshold."
    default: 5
    selector:
    number:
    min: 1
  8. @sbyx sbyx created this gist Dec 15, 2020.
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,68 @@
    blueprint:
    name: Appliance has finished
    description: Do something when an appliance (like a washing machine or dishwasher) has finished as detected by a power sensor.
    domain: automation
    input:
    power_sensor:
    name: Power Sensor
    description: "Power sensor entity (e.g. from a smart plug). Needs to have device_class: power"
    selector:
    entity:
    domain: sensor
    device_class: power
    starting_threshold:
    name: Starting power threshold
    description: "Power threshold above which we assume the appliance has started. (suggestion: 5)"
    selector:
    number:
    min: 1
    max: 100
    unit_of_measurement: W
    starting_hysteresis:
    name: Starting hysteresis
    description: "Time duration the power measurement has to stay above the starting power threshold. (suggestion: 5)"
    selector:
    number:
    min: 1
    max: 60
    unit_of_measurement: min
    finishing_threshold:
    name: Finishing power threshold
    description: "Power threshold below which we assume the appliance has finished. (suggestion: 5)"
    selector:
    number:
    min: 1
    max: 100
    unit_of_measurement: W
    finishing_hysteresis:
    name: Finishing hysteresis
    description: "Time duration the power measurement has to stay below the finishing power threshold. (suggestion: 5)"
    selector:
    number:
    min: 1
    max: 60
    unit_of_measurement: min
    actions:
    name: Actions
    description: Actions (e.g. pushing a notification, TTS announcement, ...)
    selector:
    action:

    trigger:
    - platform: numeric_state
    entity_id: !input power_sensor
    for:
    minutes: !input starting_hysteresis
    above: !input starting_threshold
    condition: []
    action:
    - wait_for_trigger:
    - platform: numeric_state
    entity_id: !input power_sensor
    below: !input finishing_threshold
    for:
    minutes: !input finishing_hysteresis
    - choose: []
    default: !input actions
    mode: single
    max_exceeded: silent