I’m trying to write a SmartApp using a smoke detector device but am having trouble with something very basic that might be an issue with the SmartApp simulator. Here are the steps to reproduce the issue I’m seeing:
- Login to https://graph.api.smartthings.com and create a new SmartApp
- Change the preferences definition to read:
preferences { section("Smoke detector...") { input "smoke1", "capability.smokeDetector", title: "Where?" } }
- Set the location along the right and choose the smoke1 virtual device. Then click Install.
At this point you should receive this error:
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]
According to the documentation (https://graph.api.smartthings.com/ide/doc/capabilities), this capability preference looks correct. I’ve tried the same basic code with other capabilities and it works fine. I also tried this same code with a real device, and it works fine. It seems to be an issue with the virtual device and the simulator.
Am I doing something incorrectly or is this an error with the simulator? I contacted support and they suggested I see if anyone in the community or on the dev team could help with this (they specifically mentioned @Urman as someone who might be able to help). Thanks in advance for any help anyone can provide.