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

: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.

Just started another configure and it is getting the out of memory errors again for the power strip.

Also it started with 20 something pending changes and is slowly going down. Should it do that every time or only perform updates on parameters that were in fact changed?

I am not sure it is really worth messing with if the energy reading for a child device is only reporting back the total energy reading for the power strip. It's really useless info.

The error I am getting during the configure:
java.lang.OutOfMemoryError: Java heap space on line 1281 (method parse)

This also caused the hub to become very sluggish, had to reboot again.

After the reboot the MeterEPs now shows, [0,null,null,null,4,5]. CH1 is still the only child device reporting power, however.

When you run a configure and settings are already synced up, it will then redo the entire config like a freshly paired device. So its not something you normally do on a regular basis. Also, it should run quick enough that it says says Syncing... for a little bit and then completes. With it pausing that is telling me there is a delay in zwave messages or the hub processing them very slowly.

Sounds like maybe you have something else going on with your hub if memory is getting low so quickly. I do see the memory tanking a little on my hub possibly when I ran the configure. That line 1281 is something that is in all my drivers. Possibly there is something wrong with the current hub firmware using that specific function. I will see if there is another way I can do it.

On my ZEN25 it looks like the energy and power readings are independent for each channel.

I will just do a fixed list for the metering detection which will reduce some of the device commands and ensure the metering is being used on the proper endpoints.

It's my oldest, actually my first hub, down in my shop. It's a C5. My plan was to replace it with a C7 when I got my C8. I found out after purchasing the C8, however, that the C8 does not work well with my old Iris V1 devices. I only have a few in the house but until I replace them I have to keep my C7 here to run those.

All that to say it is an older hub, so maybe that is it.

I added a preconfigured list for the endpoints that have metering, so it will not need to probe for that anymore. I also moved that inspect() call to another place which will only run at the end of a sync instead of every parameter change.

Added some (possibly temporary) code to force the 5 settings I am not showing, to enable the power reporting on all 5 channels in case some other bad driver shut them off.

Same place for the code: GIST LINK REMOVED - Driver added to Github/HPM

1 Like

Installed the new driver. The meterEPs now shows [0,1,2,3,4,5], but still only CH1 is shows a energy reading. Once updated I did a configure and the sync went a bit faster, but still hung up on the last three syncs and took a while but it did sync. Then I got a an error the Zigbee radio was offline, and I had to reboot.

Something is going on with this hub. It seems to have started after installing this driver, but I can't be sure. Could just be a coincidence, also this is the hub in my shop and I have not been keeping an eye on it lately. This driver has had me pay more attention as of late, so it could be I just had not noticed the issue until now. Several times over the last few days I have seen a severe hub load error on it. Goes away after a reboot.

I would do a local backup and then a restore on it which will also do a soft reset. Should be a smooth and simple process to do.
There have been numerous cases with the 2.3.6 firmware with memory issues where this seems to fix it (no idea why).

See if that helps.

Once that is sorted out, I would try the configure one more time with DEBUG on, and check the logs, you should see some confirmation at the very end (top) showing parameters 29 - 33 being set to 1. That will confirm that power reporting is at least enabled for all 5 channels.

Then with Debug still on, try a refresh again. Hopefully more reports will come back for all 5 channels and show in the logs.

Last time you tried the refresh it was not asking for the meters on all the channels due to the probe not working but that should be resolved now. Although they still should be reporting on their own outside of the refresh unless it is disabled with those parameters.

1 Like

Did a restore and I thought maybe it helped. It synced pretty quickly. Didn't show a hub load error. Then I looked at channel 5 and it showed energy so I thought that was it.

Then I got a hub load elevated error and now only CH5 shows energy . none of the others do. Think I will try a soft reset and then restore and see what happens.

@cuirbear @terminal3
I have added this driver to my HPM plugs driver package:

A matchup should link your manually installed driver to my package if you want to.

1 Like