java.util.ArrayList.entrySet() is applicable for argument types: ()

SPLIT vROM: [DRIVER] Universal Z-Wave Drivers (Switch/Dimmer) - #15


I've loaded it on a two of my Leviton ZW6HD units and have the same error (see below). An odd thing I noticed previously with the universal scanner driver was than most of my dimmers did not come back with parameter descriptions. The very first one I tried did, but the rest did not. Maybe related here (eg parsing), maybe not.

/Woody

[dev:42](http://192.168.50.231/logs#)2024-07-15 07:49:54.176 AM[error](http://192.168.50.231/logs#)groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.entrySet() is applicable for argument types: () values: []
Possible solutions: toSet(), toSet(), intersect(java.lang.Iterable), intersect(java.util.Collection), intersect(java.lang.Iterable), every() on line 279 (method processParamScan)

[dev:42](http://192.168.50.231/logs#)2024-07-15 07:49:29.294 AM[warn](http://192.168.50.231/logs#)Dining Room Lights: Invalid dataValue (parameters): groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object

The current character read is ''' with an int value of 39
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 2
[['num':1, 'format':0, 'size':4, 'defaultVal':2, 'range':0..253, 'title':'', 'description':''], ['num':2, 'format':0, 'size':4, 'defaultVal':2, 'range':0..253, 'title':'', 'description':''], ['num':3, 'format':0, 'size':4, 'defaultVal':10, 'range':1..99, 'title':'', 'description':''], ['num':4, 'format':0, 'size':4, 'defaultVal':99, 'range':10..99, 'title':'', 'description':''], ['num':5, 'format':0, 'size':4, 'defaultVal':0, 'range':0..99, 'title':'', 'description':''], ['num':6, 'format':0, 'size':4, 'defaultVal':3, 'range':0..255, 'title':'', 'description':''], ['num':7, 'format':0, 'size':4, 'defaultVal':255, 'range':0..255, 'title':'', 'description':''], ['num':8, 'format':0, 'size':4, 'defaultVal':1, 'range':0..3, 'title':'', 'description':''], ['num':9, 'format':0, 'size':4, 'defaultVal':0, 'range':0..2, 'title':'', 'description':'']]

I changed the format of the parameters string in this driver (update is coming for the scanner to match). After tossing that error it should then have removed the old "parameters" data from the bottom of the device page. A new scan from this driver should pick everything back up again and store the correct format. Do not switch back to the "scanner" tool or it will wipe it out for the same reason. I should have an update for the scanner tool this week.

Following this you should be able to get the settings back:

Followed directions, I never get to "Scan Complete..." after the error. Once the error pops I am forever stuck on "Syncing Settings from Device...". I have tried refreshing the page and running the query again, still errors and gets stuck. After the page refresh I no longer have any of my parameter boxes. Even Supervised Commands is missing now.

image

What does the data look like at the bottom of the device page in the data section?

The Invalid dataValue (parameters) error should only occur once, and then it would delete the bad parameters data. Unless you go back to the scanner tool and scan from there again (do not do this).

I have not changed the driver since switching from Leviton Z-Wave Plus Dimmer to the Universal Z-Wave Dimmer. I have not touched the Universal Z-Wave Scanner driver since our last exchange several weeks ago.

Looks like it scanned in the parameter data just fine. The original error you posted would have been from the old data (from the scanner tool). If you just refresh the page is there an error being generated every time you refresh? Otherwise I would expect all the settings to show up.

Refreshed the Device page clicked Query Device and got the following two log entries The warn was immediate, the error occurred after all parameters were scanned, moving in Syncing Settings from Device.

dev:422024-07-15 05:19:40.005 PM error groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.entrySet() is applicable for argument types: () values: [] Possible solutions: toSet(), toSet(), intersect(java.lang.Iterable), intersect(java.util.Collection), intersect(java.lang.Iterable), every() on line 279 (method processParamScan)
dev:422024-07-15 05:19:18.729 PM warn No signature of method: java.util.ArrayList.entrySet() is applicable for argument types: () values: [] Possible solutions: toSet(), toSet(), intersect(java.lang.Iterable), intersect(java.util.Collection), intersect(java.lang.Iterable), every()```

Did not ask you to click any buttons, just refresh the page and if the data is still at the bottom then I would expect the settings to be loaded or an error to be thrown.

Also, what hub platform are you on? I could be using features that only work in 2.3.9 without realizing it.

You could also try running "Configure" which will clear out some state variables and such. Really not sure what the problem is especially since the first error does not have any sort of line numbers or hit as to where its happening.

Sorry, I was multi-tasking.

I reloaded the page (now) and it immediate generates a warning, but not an error. No button clicks. The data at the bottom is still as it was in the previous screenshot.

dev:422024-07-15 06:13:42.739 PM warn No signature of method: java.util.ArrayList.entrySet() is applicable for argument types: () values: [] Possible solutions: toSet(), toSet(), intersect(java.lang.Iterable), intersect(java.util.Collection), intersect(java.lang.Iterable), every()

I split this off to a new topic. Seems like something weird is going on with your hub. This error does not make any sense. Can you do a Reboot > Advanced > Rebuild Database?

Also what hub model and platform version are you on?

@gopher.ny any ideas? I am not using entrySet() anywhere in my code so I am not sure what it is talking about. Both errors I think are calling .each on a List which is generated from a get function. I think both of these are being generated by the platform, not sure why one is a warn log, seems odd.

error groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.entrySet() is applicable for argument types: () values: [] Possible solutions: toSet(), toSet(), intersect(java.lang.Iterable), intersect(java.util.Collection), intersect(java.lang.Iterable), every() on line 279 (method processParamScan)
warn No signature of method: java.util.ArrayList.entrySet() is applicable for argument types: () values: [] Possible solutions: toSet(), toSet(), intersect(java.lang.Iterable), intersect(java.util.Collection), intersect(java.lang.Iterable), every()

Line 279:
image

Gets the List from here:

//Gets full list of params
List<Map> getConfigParams() {
	//logDebug "Get Config Params"
	if (!device) return []
	List<Map> paramsMap = []
	String paramsJson = device.getDataValue("parameters")
	if (paramsJson) {
		try {
			paramsMap = (new JsonSlurper().parseText(paramsJson)) as Map
		}
		catch(Exception e) {
			logWarn("Invalid dataValue (parameters): ${e}")
			device.removeDataValue("parameters")
		}
	}
	//logDebug "${paramsMap}"
	return paramsMap
}

@gatewoodgreen You can also try this version, its my work in progress update (pretty much complete). I added a debug log in a spot that might give more info. It just dumps out the extracted settings data right before where I think you are getting the error.

https://gist.githubusercontent.com/jtp10181/244214f8f0468551d332e58b8151b142/raw/universal-zwave-dimmer.groovy

The issue might be this "as Map" which should be "as List" which I have fixed in the test version.

image

1 Like

I forgot to give you this earlier, Platform Version 2.3.9.158

I'm busy with work so I skipped over the DB rebuild straight to the driver code update. The device page immediately loaded as one might expect for the Leviton ZW6HD dimmer. More, a (re)run of Query Device completed as expected.

A quick review of logs shows neither the error nor the warning I was getting earlier.

Both failed dimmers I tested earlier are working.

FYI and separate of the device code error, on one of the two devices after running Query Device and refreshing, on save I got the following error:

image

I did not set that value, that was what was returned by the switch on your scan. I've seen hints of this quirk on some (not all) of my ZW6HD dimmers with your universal scanner driver. The scan pulled 100, but I had to manually adjust to 99 to be able to save.

Fast follow on, I did a driver swap (Leviton Z-Wave Plus Dimmer to Universal Z-Wave Dimmer) on a third and forth ZW6HD dimmer and it worked as expected through the query, refresh and save on #3. #4 scanned 100 on preset level and needed adjusting to 99 on save.

Footnote: if you want anything broke, just hand it to me, I'll break it by just looking at it. It's an innate talent I cannot well explain. Nearly thirty years of software engineering, I well know the adage that when you idiot proof anything, the universe just gives you a bigger idiot. The universe has spoken, I am here. =)

I suspect I may had a different experience than others because I'm the idiot that played with the customization options of the device before I loaded your new universal dimmer driver. Remember I have changed some device settings directly at some of the devices, and have also previously used the Basic Z-Wave Tool and then your Universal Scanner driver.

Glad that fixed it because otherwise I was stumped.

I did post an updated version on that link above just to get rid of the forced debug log for you.

Official 0.4.0 package with the scanner tool will be coming to HPM this week.

That's a firmware issue on the device really, it has a factory default set outside of the range it is telling me that it allows.

Awesome!

I figured that would be the case.

====

What are the chances for a "Universal Z-Wave Fan Control" driver that manages the Leviton ZW4SF and is Google Home compatible? The built-in Leviton Fan Controller doesn't get the speeds right and the best home-grown driver won't load/work in Goolge Home.

If you dont mind doing possibly a bunch of testing I can make an attempt at the Fan Controller.

Someone else did say they were able to scan for the settings on a ZW4SF, they tried just to see if it would work. I have a virtual Fan Controller driver I have messed with so I have an idea of what capabilities are needed.

1 Like

Here is a scan of the ZW4SF

I uses the ZW6HD carriage but only 4 of the 7 side LEDs as a "4 speed" controller.

Manual here: https://hubconnecteddecorasmart.leviton.com/hc/en-us/article_attachments/4407525900443

Options and classes, pages 16-18

configVals: [3:0, 4:99, 5:0, 6:3, 7:255]
deviceId: 2
deviceType: 56
firmwareVersion: 1.08
hardwareVersion: 1
inClusters: 0x5E,0x55,0x98,0x9F,0x6C
manufacturer: 29
parameters: [['num':3, 'format':1, 'size':1, 'defaultVal':0, 'range':0..99, 'title':'Min Level', 'description':'Minimum Fan Speed level allowed'], ['num':4, 'format':1, 'size':1, 'defaultVal':99, 'range':0..99, 'title':'Max Level', 'description':'Maximum Fan Speed level allowed'], ['num':5, 'format':1, 'size':1, 'defaultVal':0, 'range':0..99, 'title':'Preset Level', 'description':'Preset Level for On'], ['num':6, 'format':1, 'size':1, 'defaultVal':3, 'range':0..255, 'title':'Ind Timeout', 'description':'LED Dim Level Indicator Timeout'], ['num':7, 'format':1, 'size':1, 'defaultVal':255, 'range':0..255, 'title':'Locator Status', 'description':'Locator LED Status']]
protocolVersion: 7.12
S2: 131
secureInClusters: 0x85,0x8E,0x59,0x86,0x72,0x5A,0x87,0x73,0x7A,0x26,0x2B,0x2C,0x70
serialNumber: 4C5BB3FFFEAB9863
zwaveSecurePairingComplete: true
zwNodeInfo: D3 9C 83 04 11 00 5E 55 98 9F 6C 68 23 F1 00 85 5C 8E 59 86 72 5A 87 73 7A 26 2B 2C 70

Working on this now. I think it can use nearly all the same code as the dimmer, I just need to adjust the capabilities and a few functions so it presents as a fan.

2 Likes

Curious can you set this thing to ANY level, like it is totally variable speed, or does it lock into a set 3-5 speed levels? I cannot find any info about that in the manual.

The built-in Leviton Fan Controller driver only supports three discrete speeds (low, medium, and high) which map to the lowest three of the 4 speeds the physical control offers. It does not expose any indication of level as a percentage no offer a command to set level as a number.

Technically it should offer low, medium, medium high, and high.

So I took a chance and swapped in your Universal Z-Wave Dimmer driver and used the Set Level command. The devices current level reports under "Current State" with your UZD driver. The ZW4SF supports four discrete levels as a percentage:

  • 25
  • 50
  • 75
  • 100 (yes 100)

If you send any number 1-24, it goes to 25. If you set any number 26-49 you get 50, and so forth. If you send "0" it turns the device off but leaves the reported level at the last 25/50/75/100 state.