Zooz Zen15 Laundry Alerts

Hi All, I’m on SmartThings & I have a Zooz ZEN15 that reads the power usage and I want to use it for laundry alerts. With a laundry cycle the power draw goes up and down during a wash. I know I can do this in webcore but since Groovy is going away i’m looking for alternatives. I’m thinking the automation should be…

If zen15 power rises above 60w
and power stays less than 5w for less then 3 minutes
then
turn on virtual switch (which will send an alert in Alexa that laundry is done) then turn off virtual switch

Any help would be appreciated

Hi @Robert_Bourne, see the rule example below that I update the laundry status in a TEXT variable laundryStatus based on the device’s power value, and send a HTTP request to Alexa via Voice Monkey to announce the laundry completion without the need or another virtual switch.

In the first IF condition, I used context.event.type context variable to determine if the event is a device event or a variable event, and used context.event.value in the 2nd IF condition at left to grab the triggering event’s value (the power measurement device in this case) and update the variable laundryStatus variable accordingly.

Please note that the Variable feature requires the Premium subscription, but you can of course use a Simulated Device in SmartThings, and check the device’s power attribute value in the IF conditions instead, but the variable approach will be slightly faster.

@Justin_Newbury put together a quick howto video for using Voice Monkey directly in SharpTools for Alexa announcement if you are interested, and again, you still have the option to turn the Virtual Switch on and off for the announcement as you mentioned.

Thanks for your thorough explanation @James. I must admit that I don’t understand some of it. I’m on the free plan so i’ll look into the simulated device option

It’s basically two rules in one.

  1. React to the power level of the device changing and set a variable accordingly
  2. React to the variable staying in ‘Low Power Cycle’ for three minutes (eg. device power is less than 3 for 3 minutes) and announce a message

Triggers and Event Type Condition

In the Triggers, we’re basically saying that the rule will be triggered anytime the plug power changes (above 0) -or- if our variable is a certain value for 3 minutes.

The key part here is that the first IF Condition in the Flow checks what type of event we are receiving.

This takes advantage of something called Context Variables which provide more information about the event that triggered the rule

Based on the Triggers section, we know that we have two types of events that can trigger the rule:

  • device
  • variable

So the IF condition is basically saying that if it’s triggered by a device (eg. the power changing), then take the THEN side of the flow… otherwise we know it must be the variable (which was set to low for 3 minutes) so we take the ELSE flow.

Note that if you use a virtual device to track the running state (instead of a variable), you would need to use a different context variable since the type of both triggers would be device. For example, you could use $context.event.deviceName to differentiate between the events.

So from there onward, the left side of the IF Condition is basically a rule around the device changes (first trigger)… and the right side is a rule related to the variable staying low for 3 minutes (second trigger).

Then Side of Main IF Condition (Device Changes)

On the left side, we’re again using context variables to get details about the event that triggered the rule… but this time instead of checking the type, we’re checking the value which triggered the rule.

So if the power (via the $context.event.value) is greater than 60, then we set a $laundryStatus variable to ‘Running’ so we can track the state.

Otherwise if the power is not greater than 60 (eg. the Else branch within this section), then we add one more check to see if the value is less than 3. If it’s less than three, then we set the $laundryStatus value to ‘Low Power Cycle’.

If you recall, the second trigger for this rule is the $laundryStatus variable staying ‘Low Power Cycle’ for three minutes and that will take us into the ELSE condition of the main flow (next section).

Else Side of Main IF Condition (Variable Stays)

The last part of this is the Else side of the main if condition which checks which type of event we’ve received. If you recall from further above, we know that if the type is not device, then it must be the variable since those are the only two types of triggers we have in this rule.

And since the IF condition already applies a set of conditions (eg. the $laundryStatus variable has stayed the value ‘Low Power Cycle’ for three minutes, we know that our condition for sending the notification / announcement is already met.

So the Then side of the main condition is basically just resetting our $laundryStatus variable to Stopped (in case we use it on our dashboard or somewhere else), then proceeds to trigger an announcement on an Echo Device using Voice Monkey.

James linked to a nice video by Justin from SimplySmart explaining how the last action is working, but Voice Monkey is basically a service that can play announcements on an Echo Device. So this step uses the HTTP Action to trigger a Voice Monkey Announcement.

image

1 Like