Zooz Power Strip (ZEN20) - keeps Forgetting preferences, no power reporting

So, Changed the paramater, and nothing happened.
Just switched some plugs around; moved phone to 2 and TV to 5, and now TV reporting correctly.

Would be nice to be able to control the USB plugs as well!

If it works like the ZEN25 you cannot control the USB ports, the on/off state is reported by the device, On = something is drawing power and Off = No draw. The intention was if you are charging a device you would know when its full because it would stop drawing power.

This is from ZEN20 manual:

On/off (charging/charged) reports from USB ports to the hub (no ZWave control) - turn off the charging device for best results

2 Likes

I have been on vacation, getting home tonight. Will try to check this out on my power strip sometime this weekend.

2 Likes

I got the new driver installed and the Power strip is now reporting Energy and Power for the entire device. Which is the main function I wanted. Energy was the main thing but I also wanted to see the power draw as well.

I had 7 child devices with the old driver and the new driver created 7 more. The old child devices show energy and power and other attributes but they don't appear to be updating. The new child devices do not show anything other than a switch capability of on and off.

I don't use energy or power from the child devices but it would be nice to see them.

Any info you need? I am going to now update my rules to use the new child devices. From some manual testing they seem to be working.

Not sure how that is possible I have the line which would create the child devices commented out for testing so it doesnt make a big mess on people. I just checked and this is the only place in the code calling that function.

What are the DNI(s) of the Old vs New child devices?
Are you sure you used the right driver?
What firmware of ZEN20 do you have (should be in the data section at bottom of parent device).

This is working for myself (on ZEN25) and @cuirbear

Also, FYI, I can add a function to clean up any abandoned/unused child devices to clean up the mess.

Here is the info and you can see all the child devices. Also the firmware is listed.
The ones with a device description are the old ones. I have updated the name of the channel 2 new child. This is in my shop and I have a camera in the office and I can see the light coming on and off when I switch the Channel 2 outlet.

The old child devices have a DNI of 13-CH(n) n being the outlet number. The two UBS are 13-USB(n) n being the USB port 1 or 2

The new child devices are 967-(n) n being the outlet number. The USBs are 6 and 7

Here is the header info from the driver I manually installed.. I got it from the link a few Reponses up.

/*

Changelog:

[0.0.4] - 2023-10-11 (@jtp10181)

  • Initial Release based on v1.2.1 of my Zooz Plugs driver
  • Copyright 2022-2023 Jeff Page
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

*/

Everything looks right, but that code to add the child devices is commented out and I think it has been for every version I posted here. Also, my most current code should have detected and used the existing child devices (except not the USB ports yet) with the CH# DNIs, thats what I have been working on.

Did you uncomment the addChild line in the code by chance?

Also, I would not switch all your rules over to the new child devices just yet, you may want to just switch back to whatever other driver you were using for now. I would like to get all the new duplicated childs removed for you and have it work correctly as intended.

I did not edit code, see below. I only switched one at this point I will wait for another release before I change anything.

:person_shrugging:
There is no way possible it created child devices with that commented out. It’s the only call to that addChild function and that’s the only function that has code to create child devices.

It also detected and used the existing child devices for myself and the other tester.

So doesn’t make any sense and it’s nothing I can fix, the current code already has the fixes.

Next I just need to make it handle the USB ports properly.

I think I know what happened. I had switched drivers a a couple times recently and I think the new child devices got created then. I must just not have noticed. I was trying different drivers to try and get a power and energy reading on the main device. Wasn't really paying attention to child devices then.

I went back and looked and noticed the new child devices had a remove button the old did not. So apparently they were the devices actually tied to the driver. I switched the driver back to the one I was using originally and removed all the new child devices.

I then set it back to your updated driver and the new child devices did not come back. Also the current child devices seem to be updating power, The energy readings don't seem right but until it sits for a bit and runs, I won't be sure.

I think I am good now though.

1 Like

The energy is just passed on from what the device reports, I am not doing any calculations. So it should be correct.

I have 4 devices plugged into the power strip, a small PC, access point/router, a CPE device and a small LED light. Only two of those devices are drawing any power at the moment. The router is a constant 8 Watts and the CPE a constant 2. Only the CPE device shows energy usage and it is the same as the overall energy usage, the rest are all at 0. The energy duration is the same on all.

Also I have one pending change showing that won't go away. Any idea what would be causing that? When I first installed the driver and updated some parameters it had like 20 pending changes. After a configure it removed them one by one until it got to one and it won't get rid of that one.

Please turn on debug logging and then just save preferences. The logs will show me what setting it getting hung up on. You have an older firmware than @cuirbear so I may need to make an adjustment.

Also be sure to double check all your settings. I decided to do the reporting settings in minutes vs seconds so it possibly took your old settings and multiplied them by 60. Maybe I need to just do drop-down menus on those, not sure.

Just turned it on, got some errors right off the bat. About to go to bed so we will see what it has tomorrow.

Those errors are from me using the wrong name for my error logging function, so it got an error trying to log an error. The actual error is just because I did not have code to detect the USB child devices yet.

I updated the code at the gist linked above to fix that mistake and detect the USB child devices. You will need to run configure after updating so it can scan the endpoints/child devices again.

For the pending changes, I am wondering if its having an issue detecting the lifeline association. Run configure with debug logging on, there should be a line or two something about the Lifeline Association. I need to see those lines. Ex: Lifeline Association: [] | MC: [1:0]

This is looking pretty solid now, I think I have the addChild code all sorted out as well (not enabled yet). Will need to test the add child code on my dev hub eventually. I think everything else is working well.

There is a possible issue with the endpoint metering detection, I may need to go to a fixed list for known devices.

Also, the devices do provide voltage and amperage readings for all endpoints but the system component driver does not have those capabilities. I could use a custom driver for the child devices but not sure if anyone cares to get per-endpoint amps at all? Per EP voltage seems pretty useless since it should be the same across all endpoints.

Still only have a energy reading on CH3 the others are all 0. Here is the log from the configure after the driver update. I am getting 2 errors.

Office Power strip: No device for endpoint (7). Press Configure to create child devices.
and
java.lang.NullPointerException: Cannot invoke method getAt() on null object on line 890 (method refresh)

For me amperage on a per child device is not that big a deal for me, I really only care about power for the child devices. Voltage on the overall device is all that really makes sense IMO. Don't really care about individual energy readings either, as long as I can get it on the device as a whole and that is working now. So thank you.

Ok, couple of things going on. The java error I think I have fixed now.
The endpoint 7 not being detected should be fixed.

The settings that is stuck and wont sync up is the current frequency #25, you are trying to set it to 0 (disabled) but the device wont take it. The Zooz docs show it should take a 0 but maybe that was added in the 3.0 version only, I will have to ask Zooz? Try setting it to something else. That setting being stuck was preventing you from running a full re-configure which is what was causing the java exception (but I fixed it anyway).

You may need to do a save preferences to clear the Pending change, and then run a Configure once it says it is synced.

For the power reporting, try manually setting each channel back to enabled as shown here: Zooz Power Strip (ZEN20) - keeps Forgetting preferences, no power reporting - #40 by jtp10181 . You will need to do it for parameters 29-33. I may need to force this in the driver if that is what is causing it.

If its still not reporting power on all the channels run a Refresh with debug logging turned on and post a screenshot so I can see what is coming back from the device. Also a screenshot of the "State Variables" after the configure runs and it is synced up (refresh the page).

The device synced after changing parameter 25. I set it to the default of 60. I never changed it, as far as I know. It took a while to sync. It started with like 25 pending changes. When it got to 3, I thought the hub had went offline. I was just about to try accessing the diagnostic menu when it flashed it was down to 1 pending change and after a minute or so more it said it synced. I saw some out of memory errors in the logs so I rebooted the hub.

Still only reporting energy on CH1, I said CH3 before in the earlier thread, but it is CH1 not CH3.

powerstripinfo6

Looks like when it probed the endpoints to see if they support power metering it only got a response back from CH1 (see the state variable meterEPs). Possibly due to whatever was bogging down the hub. You could try a configure again and see if it picks them all up. The state Variable should list [0,1,2,3,4,5] if it picks them all up correctly.

I may just need to make a preconfigured list of what EPs support metering to make that more reliable on known devices.