Notify when brewing done

Hi. I’m new to HA and home automation.
So I bought a Fibaro wall plug that can measure power consumption. Now I want to use that to send me a notification when the brewing process is done.
When I start the brewer (Mocha master) the power consumption goes up to 1772.6w and when the water is gone and just the heater is on it goes down to 73.1w - 62.1w.
So how could I use this to create an automation? Do I need to check for the higher value to net get falsy notifications?

Thanks.

You should be able to do that with some template triggers and conditions. Show us what you’ve got and we can help you debug.

So it seems that I mixed the sensor entity_id up with my fibaro (there is one thats ends with 3_4 and another with 3_8) and now it seems to work :slight_smile:
This is what I ended up with:

- alias: 'Brewing done'
  initial_state: 'off'
  trigger:
    platform: numeric_state
    entity_id: sensor.brewer_power_3_4
    below: '100'
  action:
    - delay: '00:01:00'
    - service: notify.notify
      data:
        message: Brewing done!
    - service: homeassistant.turn_off
      entity_id: automation.brewing_done
- alias: 'Activate brewing done'
  hide_entity: true
  trigger:
    - platform: numeric_state
      entity_id: sensor.brewer_power_3_4
      above: '100'
  action:
    service: homeassistant.turn_on
    entity_id: automation.brewing_done

How about the solution with templates, how would it look like?

That should work. There is only one thing, though…
The way you have it, every time you restart HA, the power will be below 100 and you will be notified, even if the pot was never on. You can remedy that by making the initial state of your ‘Brewing Done’ automation to be off. You can then add another automation routine to enable the ‘Brewing done’ automation when the power goes over 100:

First, just add the initial_state: ‘off’ to the Brewing done automation:

- alias: 'Brewing Done'
  initial_state: 'off'`

Then paste this in so that it activates the Brewing done automation, but only when it is over 100

- alias: Activate the Brewing Done Automation when wattage goes over 100
  trigger:
    - platform: numeric_state
      entity_id: sensor.brewer_power_3_8
      above: '100'
  action:
    service: homeassistant.turn_on
    entity_id: automation.Brewing_Done

There is a way to do this with template triggers and conditions, but I wanted to build onto what you have.

Thanks BendedArrow. Good feedback, I will try it that :slight_smile:
It would be interesting to see the solution (as a newcomer as I am) with templates if you have the time :slight_smile:

Woops I did edit my older post when my intention was to make a reply. However it seems to work :slight_smile: Thanks for the help!

Any ideas how the solution with templates would have look like?

I’ve had errors myself getting numeric_state to be a dependable trigger. What I did in my case was set up a template sensor using the same data, then have my automation trigger from the sensors state change. One extra step, but it’s been dependable.