Dryer Monitor with Sense Energy Monitor Integration - NO additional hardware

Tags: #<Tag:0x00007f7806279c98>

I’m trying to do a simple automation by using the Sense integration. The dryer is in my basement and impossible to hear when complete. I thought it would be simple.
A snapshot of the logbook dryer entity:
6:21:56 PM

The dryer elements obviously switches on and off during the cycle and Sense detects that. It lasts about a minute or so between the off and on states. I had one load stop at 4:52:36 and another load started again at 5:59:34. So my thought was when the state of the dryer turned from on to off for more than 3 minutes the notification would fire. This does not seem to work.

So in my automation

- id: '1590268768158'
  alias: Notify Dryer is Done
  description: ''
  trigger:
  - entity_id: binary_sensor.dryer
    for: 00:03:00
    from: 'On'
    platform: state
    to: 'Off'
  condition: []
  action:
  - data:
      message: Dryer is Done
    service: notify.greg
  - data:
      message: Dryer is Done

Another option might be to count a minimum number of on-off cycles to determine the dryer is on, then look at the off state for an extended period of time like 3 minutes, then fire the notification and then reset the count to 0 but I don’t know how to do that in an automation.

states are case sensitive. So instead of this:

trigger:
  - entity_id: binary_sensor.dryer
    for: 00:03:00
    from: 'On'
    platform: state
    to: 'Off'

do this:

trigger:
  - entity_id: binary_sensor.dryer
    for: 00:03:00
    from: 'on'
    platform: state
    to: 'off'

and I’ve had some issues with the time setting like that in the past so you might even want to try like this if that doesn’t work:

trigger:
  - entity_id: binary_sensor.dryer
    for: 
      minutes: 3
    from: 'on'
    platform: state
    to: 'off'

And since it’s a binary sensor and the only possible states (aside from unavailable, I guess) are on & off then you really don’t need to the “from: ‘on’” part either. But it doesn’t hurt for it to be there.