šŸ”Œ Detect and monitor the state of an appliance based on its power consumption - V2.1.1 - Updated!

Well, maybe! I think I canā€™t help with that though. Iā€™m using a different smart socket (I was just mentioning it here in V3.0.0-Dev).

Well, Iā€™m using Grafana with InfluxDB. You know, Iā€™m a data person and the sole idea of losing it scares me :sweat_smile:

1 Like

OK, since you like data :slight_smile: ā€¦ Hereā€™s some data on the end of the last cycle. I increased the power monitoring precision to include a decimal point, so it no longer rounds to the nearest Watt.

(1) End of the cycle, per dishwasher
(2) 0.9W as measured by power monitoring
(3) 0.8W as measured by power monitoring
(4) 0.7W as measured by power monitoring

I will have to try to replicate this across multiple runs, but seems like I may be able to use ā€œbelow 0.8Wā€ as my completion condition. I will test it and report back.

Good news, @leofabri. The logic I mentioned above is working for my dishwasher. Itā€™s consistently above 0.8W when working, and below 0.8W when idle :slight_smile:

3 for 3 so far on accurate starts and stops:

@Sygnus83 - maybe this will also work for your unit?

1 Like

Great! Thereā€™s not much room for error there, but if itā€™s consistent, itā€™s perfect.
Itā€™s nice to hear that Iā€™ll have one less problem to deal with! Hahaha

1 Like

No, its Amica .

Im using blitzwolf bw-shp15 and dont know how can i " increased the power monitoring precision to include a decimal point,"

Are these easy enough to flash over to ESPHome?

Would be nice to be able to set ā€˜quiet hoursā€™ for the TTS output. Accidentally had speakers on way too loud and was rudely awakened by screaming voice staring that the dishwasher was done. :scream: :joy:

1 Like

very helpful!
and I discovered that I could enter fractions of Volts into the config - an eyeopener.

Many thanks to @leofabri for this great component :pray:

1 Like

Hi @leofabri ā€¦ Iā€™m using this with my washing machine, and because the blueprint/automation indicated not to use TTS/notifications with it, I had created a separate automation that I thought would trigger on laundry completion, to let me know I needed to flip the clothes to the dryer. Iā€™ve run the laundry twice since adding your blueprint, and this automation has not fired once. Did I miss something here?

alias: Washing Machine Notifications
description: ""
trigger:
  - platform: state
    entity_id:
      - input_select.washing_machine_state_machine
    to: job_completed
    for:
      hours: 0
      minutes: 0
      seconds: 30
condition: []
action:
  - device_id: xxxxxx
    domain: mobile_app
    type: notify
    title: Alert!
    message: The washing machine is finished.  Time to flip clothes to the dryer.
  - service: script.turn_on
    target:
      entity_id: script.google_home_resume
    data:
      variables:
        action:
          - service: tts.cloud_say
            data:
              entity_id: media_player.speakers
              message: >-
                The washing machine is finished.  Time to flip clothes to the
                dryer.
              cache: true
mode: single

Love this blueprint! I would like to request a small change if possible. Currently it requires a switch that can be turned on/off, but living in the US and having a 240v dryer, i have not been able to find any plugs that work for that setup. Instead i use a current meter to tell if the dryer is working. I have gotten around the requirement by choosing a power switch that always remains on, but it would be nice to be able to potentially ignore the on/off requirement?

Actually, it should be easier than that. Instead of making a separate automation, you could use one of the custom actions to call a script.

In that case, it would look something like this:

# This is your script
alias: Washing Machine Notifications
sequence:
  - device_id: xxxxxx
    domain: mobile_app
    type: notify
    title: Alert!
    message: The washing machine is finished.  Time to flip clothes to the dryer.
  - service: script.turn_on
    target:
      entity_id: script.google_home_resume
    data:
      variables:
        action:
          - service: tts.cloud_say
            data:
              entity_id: media_player.speakers
              message: >-
                The washing machine is finished.  Time to flip clothes to the
                dryer.
              cache: true
mode: single
icon: mdi:washing-machine

Then in your main automation, you just have to call the script in the according section ā€œWhen a job cycle is finishedā€:

# This goes into your configured automation
     actions_job_cycle_ends:
       - service: script.washing_machine_notifications
         data: {}

Why services

Calling an external script unbundles the main automation from the services it calls. This way, even if your actions take a long time to execute, they should work just fine. Once a script is called, the main automation ā€œdoesnā€™t careā€ about how long it takes to complete. To my understanding, services work like independent asynchronous blocks (this is why we have multiple modes of execution - Scripts - Home Assistant).
The behavior would instead be different if you placed time-consuming login in the actions section. In that case, the automation would synchronously try to execute everything in that block of Actions, and thatā€™s not granted to happen since ASM is stateless and is free to stop/reboot whenever necessary.

Your solution likely doesnā€™t work because you have to indicate the state you are coming from:. In the near future, Iā€™d likely make some sort of sub-blueprint that is tested and simplifies that kind of implementation.

Please let me know if this solved your problem :wink:

Yes! I was thinking about this the other day. The automaton still works if you fake the switch by replacing it with a helper, but Iā€™d like to have the option to disable that requirement.
Itā€™ll ship in the next version, but these days have been crazy and development is taking longer than I expected :disappointed_relieved:

1 Like

Iā€™ve put it in place. My next wash day is Saturday, so Iā€™ll circle back with you at that point to let you know how it went!

Thank you for your help!

thanks for the awesome blueprint!

If I could have one wish, is that this blueprint will include also ā€œDelayed Job Started durationā€ so that a job would be counted as started if the power consumption is over over a threshold for a set period of time, that would allow me to prevent false positive in my washing machine cycle, see my power consumption:

As you can see, it can get high for a very short period of time.

Thanks again :pray:

1 Like

@nitaybz This is already in V3 (here) and itā€™s working. However, V3 is still under development because thereā€™s more that needs to be added.

If you really want to try V3 before itā€™s released, you can:

  1. Copy the content of hassio_appliance-status-monitor/appliance-status-monitor.yaml at release/v3.0.0-dev Ā· leofabri/hassio_appliance-status-monitor Ā· GitHub, and paste/replace the original appliance-status-monitor.yaml on your Home Assistant.

  2. Follow the new documentation here

Notes:

  • You should reboot your Home Assistant after updating the blueprint and after the new helpers have been added.
  • Please note that you canā€™t simply import V3 of the blueprint because itā€™s not been released yet.
  • Some documentation may still be missing.

Good news and bad news, @leofabri.

The good news is that itā€™s triggering the script to alert my phone and announce over the speakers when the wash is finished.

The bad news is, itā€™s prematurely assuming the wash is done (sometimes several times a minute) and thus spamming me with those messages.

Thatā€™s from last weeks laundry (though Iā€™m not sure why itā€™s not showing longer, I think my laundry goes longer than that).

Hereā€™s todayā€™s (edited to update it with completion):

The announcements are less frequent now (thankfully) but in the firstā€¦10 minutes or so? ā€¦ of the wash, they were like a steady stream of them.

Any ideas? Should I be adjusting the numbers?

@chicknlil25 Nice to hear that your initial problem was solved.

It looks like you need to fine-tune your automation. The procedure can differ a lot from appliance to appliance, and most of the time this step is not even necessary (this is why Iā€™m still trying to document this process and make it easier).

It looks like your appliance intermittently uses less power than the finishing power threshold causing the behavior you described.
You should use the ā€œDelayed Job Completion durationā€ (delayed_job_completion_duration) option. I would set it to 10 seconds and see if the problem is solved.

Iā€™m suggesting 10 seconds because it looks like that, on average, your ā€œjob_completedā€ periods (the ones in light blue) last for approximately 6 seconds. Please be mindful that mine itā€™s just an estimate! I had to count the pixels of your graphs for that :sweat_smile:
Feel free to change this value to something different if you want to, but read the warning, and consider that a smaller value is better.

Gotcha! Iā€™ve made the adjustment, but itā€™ll be another week before I can provide feedback. :slight_smile:

Thanks for your time and patience!

1 Like

Haha, no worries. Can I incorporate those graphs into the documentation?