There are a number of parts to this. Please keep in mind that I'm a virtual switch fan. I prefer to make several small and simple rules tied together with virtual switches for status changes, rather than large singular rules that tie things together with private boolean and such. That's not to say it cannot be done that way, but I'm not the type to fuss over several rules and a couple of virtual switches to accomplish something.
Aeon HEM v1
I just needed to know when the dishwasher is running. Use whatever power monitoring you want. I like the v1 HEMs because they work and they're inexpensive. I paid on average $53 USD for each of the three I own. With these affordable sensors, I can monitor two different appliances that are on a dedicated circuit without worrying about the amperage or voltage of the appliance. That isn't possible to do with any of the typical power monitoring plugs and not for what boils down to just $26.50 each. I would also say that for a dishwasher, which typically is either hardwired, or has the outlet behind the installed dishwasher, an HEM is ideal. You really don't want to have to uninstall your dishwasher to fix a device that is misbehaving, needs to be excluded and rejoined, or has failed.
Xiaomi Vibration Sensor
You can probably use other sensors, but my Miele dishwasher has very little room for a sensor. This was the only one that I was able to tuck just under the insulation at the bottom of the door. This allows me to easily remove it to change batteries without needing to use any adhesives, and it's completely hidden. Surprisingly, the stainless steel door doesn't interfere with the signal (my hub is very close by). Xiaomi Zigbee environments cannot have bulbs or incompatible devices in them, so all warnings and recommendations for these devices apply. I'm already setup for running Xiaomi devices without interference, so keep that in mind when making the choice of tilt sensor. The tilt angle readings are pretty stable on this device, so I do think it's a good choice regardless of the special considerations around mesh compatibility.
Aeon HEM v1 Appliance Monitoring
This driver was originally written by Mike Maxwell back in his ST days and Dan Ogorchock ported it to HE. It was hacked at by me (I'm not a developer) to allow for two additional buttons so each clamp could also send a button push for the device running state. I have found that button pushes can be a bit problematic for monitoring device state, but you can also use Rule Machine and custom attributes to simply track either the devices on/off state, or the actual current wattage of the device. If you have an Aeon v1 HEM, this is a very versatile driver for appliance monitoring.
Xiaomi Vibration Sensor
This particular driver has the ability to monitor the X,Y & Z tilt angles, so it is ideal for how I need to use this sensor. I'm using an earlier version of this driver, but it works just the same. I've had not drops or other issues with the device. It is on a separate hub from my main, so I don't know if that's part of the success I'm getting, but it's worth mentioning.
The driver needs a slight modification so you will be able to use the current X, Y and Z values in your rule. Look for, and change the following attributes...
attribute "currentX", "DECIMAL"
attribute "currentY", "DECIMAL"
attribute "currentZ", "DECIMAL"
attribute "currentX", "number"
attribute "currentY", "number"
attribute "currentZ", "number"
Virtual motion with Switch
My thanks again go to Dan Ogorchock for this driver. This will create a motion event when a switch is turned on. When an Alexa Routine detects motion as a result of one of these two different special switches being enabled, it can do something. In this case, it speaks one of two custom phrases. These special virtual switches need to be added to the HE Amazon Echo Skill app so they are available to use in Alexa Routines.
Yes, you can probably do most of this without virtual switches. I like to use virtual switches to tie things together. They aren't so slow and multiple rules isn't a major drag on my hub. Connect things how you want, and build rules how you want. These are my hubs and this is how I do it.
Three virtual switches are needed for the rules. One of them turns on when the dishwasher has been running for a period that is longer than a rinse only cycle. Another turns on when the dishwasher door tilt angle is greater than a specified amount for longer than 4 minutes, thus indicating that we are actively unloading the dishwasher, and not just getting something out of the clean dishwasher without unloading it. The third is activated by Alexa routines when you ask for the state (clean or dirty) of the dishwasher. In one of my rules you'll see a fourth virtual switch named "dishwasher last ran". This is for a separate Google Home rule that uses a global variable to record the date and time. I'm no longer using this since the current method is working so well, and so knowing exactly when the dishwasher last ran is not necessary. I will likely remove it from my rule, but if you want to use it, that's up to you. Again, it is not needed, but I'll include that rule used to capture the date and time in a global variable at the end of this post for anyone that wants to use it.
Add this Query Dishwasher State virtual switch to the HE Amazon Echo Skill app so that it is available to use in Alexa Routines.
Rule Machine Rules
These are fairly self-explanatory, but I'll provide a brief description of what each does.
Pretty obvious from that name. What I'm doing with this is establishing when the dishwasher has run, not when it's running. This rule indicates the dishes in the dishwasher are clean by turning on the virtual switch also named dishwasherState
You can leave out the second virtual switch named Dishwasher last ran in this rule unless you want to know the date and time the dishwasher last ran. Again, I'll include the rule that captures the date and time at the end of this as optional. How you use the date and time with a global variable if desired, is entirely up to you. I don't have a rule that uses the virtual switch Dishwasher last ran to show you, but it would be the trigger for such a rule and use the current data saved in the global variable.
Dishwasher unload state
This rule turns on the virtual switch dishwasherUnloaded when the sensor angle (mounted flat against the bottom, on the backside of the dishwasher door) changes to less then, or equal to 40 (specific to my dishwasher and sensor). The value was chosen based on how we sometimes unload, in which case the door isn't necessarily always fully open. Use the value that works for your situation.
You must modify the vibration sensor driver to be able to use the current X, Y and Z values with Rule Machine Custom Attributes. See notes in the driver section above.
When the dishwasher door angle triggers the virtual switch dishwasherUnloaded after a delay, then this rule is triggered. This rule then checks to see if dishwasherState is ON (indicating the dishwasher has run) and turns the switch OFF, indicating the dishes in the dishwasher have been unloaded and any dishes loaded in it are now dirty.
Dishwasher clean or dirty
This rule is used for a two-way interaction between Alexa and the hub. When you ask Alexa for the status via an Alexa routine, the virtual switch Query Dishwasher Status turns ON triggering the rule to turn ON either Alexa dishes clean, or Alexa dishes dirty. It depends on whether the virtual switch dishwasherState is ON or OFF (e.g. The dishes in the dishwasher are clean, or they are dirty).
Six routines by choice. Really only four are needed, but I wanted to allow us to ask Alexa if the dishes in the dishwasher are clean in two of our most common ways. Two of the routines are simply used to give either the response "The dishes are clean" or "The dishes are dirty" based on which of the special Virtual motion with Switch devices are activated by the rule Dishwasher clean or dirty shown above.
User input routines
Alexa feedback routines
Optional Rule Machine rule
This can be used to record the date and time of when the dishwasher last ran in a global variable. The global variable could then be used in a rule that gives a TTS response or sends a notification for when the dishwasher last ran.