"Field Error" in SmartApp

I’'ve written a custom Device Type (largely just stubbed out right now), and a SmartApp to use it. The device looks OK in the simulator, though it doesn’t do anything yet. But when I try to run the app, I get the enclosed error.

I’ve seen references to this kind of error in a few forum topics, but never with a clear description of exactly what’s failing. I’m just starting out with this stuff, so I’m sure I’m doing something wrong, but the message isn’t exactly descriptive. A complaint about a null Device name sounds like a sane guess, but as far as I can tell, it has a name.

Any ideas?

The error is:
grails.validation.ValidationException: Validation Error(s) occurred during save():

Field error in object ‘physicalgraph.device.Device’ on field ‘name’:
rejected value [null]; codes
[physicalgraph.device.Device.name.nullable.error.physicalgraph.device.Device.name,physicalgraph.device.Device.name.nullable.error.name,physicalgraph.device.Device.name.nullable.error.java.lang.String,physicalgraph.device.Device.name.nullable.error,device.name.nullable.error.physicalgraph.device.Device.name,device.name.nullable.error.name,device.name.nullable.error.java.lang.String,device.name.nullable.error,physicalgraph.device.Device.name.nullable.physicalgraph.device.Device.name,physicalgraph.device.Device.name.nullable.name,physicalgraph.device.Device.name.nullable.java.lang.String,physicalgraph.device.Device.name.nullable,device.name.nullable.physicalgraph.device.Device.name,device.name.nullable.name,device.name.nullable.java.lang.String,device.name.nullable,nullable.physicalgraph.device.Device.name,nullable.name,nullable.java.lang.String,nullable];
arguments [name,class physicalgraph.device.Device]; default message
[{0} cannot be null]

For the edification of anybody else who runs across this same issue, the root cause of my problem was that I specified a nonexistant capability in a preferences/input clause. This apparently corrupted that SmartApp somehow-- from then on, trying to set a Location for the app resulted in an error, even after I removed the offending code.

When I copied the exact same code (with the bad capability removed) to a new app, it worked fine. There just may be a few bugs in the system :slight_smile:

1 Like

I am getting this all over my apps lately. I have traced it down to this line:

		section("Control these bulbs...") {
		input "hues", "capability.colorControl", title: "Which Hue Bulbs?", required:true, multiple:true
	}

It seems as though any app with capability.colorControl is producing this error in the simulator now. I can’t tell if its happening in production yet as well. Please help @ben

I’ve been at this all day on multiple hubs with multiple accounts - it seems like anything with capability.colorControl is throwing this error, at least in the simulator.

As others have noted, if the error to throws once in a SmartApp, I have to wipe the app completely to get it to go away.

1 Like

Maybe its just me… Here is another item that is always kicking out this error. I have to think other people would be running into this as well:

section("Close this door..."){
	input "doors", "capability.doorControl"
}
1 Like

I’m having the same error with hue lights:
input “hueLights”, “capability.colorControl”, multiple: true

This worked for me for over a year, and has been failing for the past week. I’m hoping its just something on SmartThings end…

Thanks!
Josh

Just check the hue bulb code from ST and see what it exposes…

What do you mean Ron?

It seems there is another post about this too…
Anyone have suggestions? I talked to support and they said @April or @matthewnohr might be able to help!

I reproduced this in the IDE when trying to use a virtual device. If I install using a hue bulb it works OK.

I am opening an internal bug report for this.

Thanks for the quick reply! Using the actual hue bulb worked for my temporary needs!

Any updates on this? I’m trying to use a simulated device as well and I get the same error.

I was getting a lot of this last night as well. Not sure if there’s a systemic thing going on

I too am having this issue. I have found that selecting my real-life Linear garage door opener works, while the simulated device fails. This is the only way I’ve been able to get around it.

I was going through the intro to ST programming and ran into this. The virtual device fails while a physical device works.

1 Like

JIm,
It seems this error is so generic that SmarTThings needs to make the display of the error more helpful. I have wasted whole day trying to find the error - looked at the community forum also - but there is no real answer that says why we get this error. Just because someone gets it working by re installing the app is of no help. My suggestion - have someone in SmartThings monitor this and provide suitable reply

A year later and this error still happens with the virtual capability.colorControl devices. But real devices work in the simulator.

I’m getting the same error with capability.battery. Only happens on virtual devices, works fine on real ones.