📳 Appliance Notifications & Actions - Washing Machine - Clothes Dryer - Dish Washer - ETC

@seblor

Here is the code and you will have to edit it to suit your message. You will need to enable a power tracking option. If your not sending a message to a device then you can just use ‘Enable - Update of Start & End Helpers Only’ for your custom end action.

message: >
  {{end_message}}
  {% set kwh = states(end_power_consumption) | float - states(start_power_consumption) | float %}
  {{'\n'}}{{end_message_kwh}} {{kwh | round(2) }} kWh
  {% set cost = (states(end_power_consumption) | float - states(start_power_consumption) | float) * (states(cost_per_kwh) | float) %}
  {{'\n'}}{{end_message_cost}}{{cost | round(2) }}

There is no duration tracking.

Hope this helps.

Blacky :smiley:

Hi. :raising_hand_man:t2:
What am I doing wrong if I have configured End Notify but don’t get a notification? :thinking: Start notifications work as expected.

Regards

@viruz

Firstly welcome to the community :wave:

Have you enabled the end notify options?

If so are your end setting correct and the automation is completing?

If so could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.

Blacky :smiley:

Hi @Blacky and thank you for your quick reply. :slightly_smiling_face:
Yes, End Notify is enabled. This is how it looks like:

Here’s my YAML:

alias: Waschmaschine
description: ""
use_blueprint:
  path: Blackshome/appliance-notifications.yaml
  input:
    power_sensor: sensor.waschmaschine_power
    include_start_notify: enable_start_notify_options
    start_notify_device:
      - 6152c3d6a15cd34151a87fd05c860dd2
      - c151d1afef6e8ecd0181ba0f30c1fcba
    include_end_notify: enable_end_notify_options
    end_notify_device:
      - 6152c3d6a15cd34151a87fd05c860dd2
      - c151d1afef6e8ecd0181ba0f30c1fcba
    start_title: Waschmaschine
    end_appliance_power: 1
    start_message: Waschmaschine läuft
    end_message_title: Waschmaschine
    end_message: Waschmaschine fertig
    include_power_tracking: disable_power_tracking
    end_time_delay: 1

I hope this helps for debugging. :smiley:

Thanks in advance.

@viruz

All looks good. I know I have to tap on the start notification to clear it in HA so I will get the end notification.

Also check your traces to make sure the automation completed. The orange line should go all the way to the bottom as shown below.

Blacky :smiley:

FAQ - How To Add A Notification To The UI

  1. First we need to select ‘+ Add Action’ in the custom actions. You can use start or end but the end will be the only one that you can also include your power tracking options.

  2. We then start to type “per” and you will see the ‘Notification: Send a persistent notification’. Select it.

  3. You will then see your title and your message. If you don’t want any power tracking options then just enter in your title and message. If you would like power tracking options then go to step 4.

  4. To use the power tracking options you must enable one of the options. Any enable option will work.

    You must also enter the inputs with red box around them.

    • Power Tracking - Power Sensor
    • Power Tracking - Cost per kWh
    • Power Tracking - Start Number Helper
    • Power Tracking - End Number Helper

  5. Click the 3 dots and select edit in YAML.

  6. You will now see a text input area.

  7. Enter in the code that best suites your needs by copying and pasting it in replacing the code in the text area.

    You will see in the code

    • Enter in your title here
    • Enter in your end message here
    • Consumption
    • Approx Cost $

    Edit the wording to your liking. Select and copy 1 of the 3 code examples provide below.

Code for consumption in kWh only below.

service: notify.persistent_notification
data:
  title: Enter in your title here
  message: >
    Enter in your end message here
    {% set kwh = states(end_power_consumption) | float - states(start_power_consumption) | float %}
    {{'\n'}}Consumption {{kwh | round(2) }} kWh

Code for cost only below.

service: notify.persistent_notification
data:
  title: Enter in your title here
  message: >
    Enter in your end message here
    {% set cost = (states(end_power_consumption) | float - states(start_power_consumption) | float) * (states(cost_per_kwh) | float) %}
    {{'\n'}}Approx Cost ${{cost | round(2) }}

Code for consumption in kWh and cost below.

service: notify.persistent_notification
data:
  title: Enter in your title here
  message: >
    Enter in your end message here
    {% set kwh = states(end_power_consumption) | float - states(start_power_consumption) | float %}
    {{'\n'}}Consumption {{kwh | round(2) }} kWh
    {% set cost = (states(end_power_consumption) | float - states(start_power_consumption) | float) * (states(cost_per_kwh) | float) %}
    {{'\n'}}Approx Cost ${{cost | round(2) }}
  1. The code will look like this the first time you paste it in. If you go back into it, HA will condense it and that is okay.

  2. Once you happy click save, your notification will now show up in the Home Assistant User Interface (UI) as shown below.

    8

EXTRA CODE

If you would like to use the inputs used in the automation for your title, message, Message Power Consumption & Message Cost then please see below.

service: notify.persistent_notification
data:
  title: "{{end_message_title}}"
  message: >
    {{end_message}}
    {% set kwh = states(end_power_consumption) | float - states(start_power_consumption) | float %}
    {{'\n'}}{{end_message_kwh}} {{kwh | round(2) }} kWh
    {% set cost = (states(end_power_consumption) | float - states(start_power_consumption) | float) * (states(cost_per_kwh) | float) %}
    {{'\n'}}{{end_message_cost}}{{cost | round(2) }}

Enjoy

Blacky :smiley:

Back to FAQ: Click Here

1 Like

@YogiBearXL

I have added a step by step guide to add your UI notification. See above.

Blacky :smiley:

@Blacky the orange line does not go to the end. :frowning:

That is stopping and waiting for your ‘End - Appliance Power Setpoint’ to go below 1 watt for 1 min. Check your power sensor and adjust.

Q: How do I set up the automation?

A: Please Click Here to see and example of this.

Blacky :smiley:

Below 1 W should be okay I think. :slightly_smiling_face:

Then it should work. Maybe try it again, you can’t modify the automation once it starts you have to let it run.

Let us know how you go.

Blacky :smiley:

The washing machine has already run twice today and it hasn’t worked. I don’t think it will work the third time. But I’ll see and come back here. :smiley:

I just used your exact code YAML (copy / paste) and ran a test replacing power sensor and to my device and it worked perfectly.

Blacky :smiley:

1 Like

Yeah, it worked now. :smiley:
Don’t know what the problem was but I’m happy now. Thank you @Blacky. :smiley:

@viruz

Nice one :partying_face: :+1: thanks for letting us know.

Enjoy

Blacky :smiley:

1 Like

Thanks a lot! Will try this when back home.
Could you pls. put the “duration tracking” on the backlog?
Btw. when is the start Power Helper filled? right after the value goes over the threshold or only if over threshold and start delay?

i took would love to see a “duration tracking” in this template.
This way we can monitor the time it took our appliance for 1 cycle. :slight_smile:

@seblor

After the ‘Start - Power Time Delay’.

Blacky :smiley:

@seblor @Chris987

Is this just to know how long a washing machine runs for or is it for a more critical device that changes all the time and is critical to know this?

You can also create two date and or time helpers, one for the start and one for the end. Then you would use the start and end actions to get the duration. If you are unsure how to do this just let us know.

Blacky :smiley:

yeah for me its to monitor how long the dryer runs every cycle. I’ve got a somewhat quirky dryer :grinning: