[RELEASE] Zooz Power Switch / Zooz Smart Plug

I wrote a SmartApp called Simple Event Logger and use it to log those active/inactive events. It’s posted on the forum…

I found that it didn’t always report 0 immediately when it turned off so I used 25.

The one my sump pump is connected to has 1.1 firmware on it…

All the handlers I write support all firmware versions so there’s never a reason to stay on an old version.

The only exception to that is when the changes affect the capabilities, like adding lux reporting to the Zooz Outdoor Motion Sensor, but for that device I created a new “VER 2.0” topic and handlerr so that both versions are still available on the forum.

Hi @krlaframboise is Acceleration Sensor or Actuator for active/ inactive ?
also, I noticed in the keypad to enter the number the dot looks like a -

Acceleration has the active/inactive events. Actuator is a generic capability that indicates that the device has commands that can be executed.

I think ST implemented number fields so that if you enter “.” as the first character it changes it to “-” so try putting a zero in front of it. If that doesn’t work try entering 2 “.” to see if it changes it to “-” the 1st time and then back to “.” the 2nd time.

@krlaframboise todo 25 do i need 25 or 25.0

It should just be 25, but if it automatically adds the .0 after you save it won’t hurt anything.

My response is based on the assumption that you’re using my Simple Event Logger SmartApp to log these events in Google Sheets.

You could create a pivot table that has the logged data on one sheet and the filtered data for each on separate sheets, but pivot tables can be really slow if you have a lot of data in the sheet. I usually try to avoid messing around with pivot tables in the active workbook (sheet file) because I’ve seen the logging process get messed up, but it’s rare and usually only happens if you have a lot of data in the sheet so it might be fine.

The easiest solution is to install an instance of the SmartApp for each switch which will allow you to log each device’s events in a different workbook.

Any additional questions about this should be posted to the SImple Event Logger topic.

If you’re using that other logging SmartApp then a pivot table might work fine, but you should post the question on that topic.

I am trying to use WebCore to turn off a Zooz Zen 15 Ver 2.0 smart plug (using version 2.2 of krlaframboise device handler) if my shallow well pump stays running for more than an hour to prevent the pump from burning up. I could not find an app that will look for power exceeded for a period of time before turning off the plug (Smart Lighting will just turn off the plug after a period of time being on and does not take into account if there is load on the plug or not) so I decided to take the plunge and give WebCore a try.

I am new to WebCore but found a piston that was close enough to what I needed and got it set up. The code works perfect when testing using a Fan and a simple Neo Zwave switch using just the built in SmartThings Power Metering Switch Device Handler.

The problem I am having is the code just loops with the Zooz Zen15 which I need to use to handle the higher power requirements of the shallow well pump. The code runs fine and will alert if the switch is turned on, will alert if the switch is turned off and will alert if the switch “stay greater” than X power for X minutes however with the Zooz device the code just loops at notifying and never makes it to the turn off part of the code. Looking at the trace in WebCore the stay greater part of the code will turn green as it should when the power exceeds the value for the defined time but then after a few seconds go back to red causing the loop. I have tweaked every reporting interval in the device handler for the Zooz device and even tried using just the power metering device handler with the Zooz plug with the same results.

Any suggestions would be greatly appreciated because I am really stumped and would be very bummed if my well pump ran all night and got fried because I can’t figure this out.

Attached is a picture of my piston. I have all the times turned down to seconds just for testing.

EDIT: Didn’t realize you also wanted to turn the device off, my apologies.

Did you Disable On/Off Control in the DTH’s preferences by chance? What does Live logging show for that device when trying to turn off?

I did not disable the On/Off Control in the DTH (that is probably the only item I did not change). I was assuming that option should not be changed.

Below are screen shots of all the settings I have in place. I am guessing for some reason the Zooz plug or the device handler reports a power value of 0 at some point which causes webcore to think the power is not “staying greater than” the defined threshold for the defined time and that is why I can see the if statement turn green which generates the first SMS notification and then I see the if statement turns red and then goes back to green which then loops right back to the first SMS notification.

Just as a reminder with a simple Zwave plug the code works perfect so that is why I know I am just missing something with the Zooz plug.

Ok, I thought I’d ask just in case. Tagging @krlaframboise on this one.

Which SMS message does it keep sending?

It loops after sending “Well Pump has Been on for an Hour” with the Zooz switch. So I get the “Well Pump has Been on for an Hour” over and over. I did watch the live logging of the Zooz switch and it is reporting the power correctly so my theory of a bad power report is not correct.

I suspect the power repeatedly being reported above 10 watts during that 2 minute grace period is causing the problem and I added that active/inactive feature for a similar use case.

If you change your piston to “acceleration stays active for 20 seconds” and set the “Report Inactive when power…” to 10 then that will most likely solve your problem.

Having the device send 4+ reports every 5 seconds is completely flooding your mesh so I’m surprised you’re not having global performance/reliability issues.

For all your metering devices you should disable the reports that you’re not doing anything with and make the others only report as often as you need them to.

Energy is cumulative so I can’t think of any use cases that would require it to be reported every 5 seconds.

Thank you for the help. I changed the settings in the device handler all back to default values in order to reduce the reporting. I changed the piston to use “Acceleration” instead of “switch is on” and I increased the time required to shut off the plug to get closer to the actual hour I plan on setting it to once it is working. I also set up your simple event logger app to a Google sheet (which works great btw).

I am now stuck with setting the “Report Inactive when power…” . I searched all over the forums for how to set up Report Inactive in WebCore and just could not find anything. I am also not sure what triggers an acceleration is active or inactive. Sorry if that is a dumb question but this is my first piston so I am still learning. If you had an example both the “acceleration stays active” and “report inactive when power” that would be very helpful.

I attached the current state of the piston. With these changes the only notifications I get is if I turn the plug on or off manually. So the condition of power stays greater than 10W for 10 minutes and acceleration stays active for 10 minutes must never register as true. My guess is that it is because I am not using the acceleration correctly and I can’t figure out the report inactive part.

The acceleration stays active line looks fine…

You need to set the “inactive below” setting in the handler to 10 and then delete the “stays greater than 10W” line from your piston.

Just closing the loop here. Using acceleration instead of power in the Piston and then setting the inactive below in the device handler is working well. I have to admit I don’t really understand why using power stays active did not work in the first place but I am happy to have a solution and happy to find your simple event logger app.

Thank you for the help!

1 Like

Hi, I recently got two ZEN15s and just updated the DTH to the latest version today. Now that a firmware tile has been added, I noticed that one of my devices has firmware 1.04 and the other 1.4. I also noticed in the DTH code:

private isFirmwareVersion2() {
    return safeToDec(device.currentValue("firmwareVersion")) >= 1.3
}

This means one of my devices has the new “FIRMWARE 2.0” features (e.g. disabling manual control) and the other does not. However, the official Zooz ZEN15 changelog shows 1.04 as the latest firmware version, with version 1.03 adding the “options to disable manual control and on/off commands from the hub”. So… I’m confused. Do firmware versions 1.3 and 1.4 actually exist, or are they actually 1.03 and 1.04 with some typo having occurred behind the scenes?

That’s my fault…

The device reports it as 1.3 and my older handlers didn’t add a leading zero, but some of the changes I made in the last update were copied from a newer handler which changed that.

Changing that line of code to 1.03 will solve your problem and I’ll post a new version later tonight with that change.

If you drag down on the device details screen it should force the refresh method to execute and change the device showing 1.4 to 1.04.

1 Like

Got it, thanks! I’m in no hurry so I’ll just wait for the update.

Edit: Send you a PR: https://github.com/krlaframboise/SmartThings/pull/51

The other device is stubbornly showing 1.4 instead of 1.04 even after several refresh attempts. Curiously, the first half of the “Raw Description” in the IDE is

zw:Ls type:1001 mfr:027A prod:0101 model:000D ver:0.00 zwv:0.00 lib:00

whereas the one showing 1.04 has

zw:Ls type:1001 mfr:027A prod:0101 model:000D ver:1.04 zwv:4.38 lib:03

Does this indicate some kind of pairing/communication issue with the former? The networkSecurityLevel for both is ZWAVE_S0_LEGACY.

I don’t accept PRs, but I just posted a new version that fixes the version number and it also requests a version report when refreshed.

If you drag down on the device details screen it should quickly show a refresh symbol when it executes the refresh command which will cause the firmware tile to update within 10 seconds.

1 Like