Simulator issue with smoke detector

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:

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.

1 Like

can you post the full code?

Sure but all I did was create a basic SmartApp with the default code and change the preferences definition. As a reminder, this works fine if I select a real physical smoke detector but not if I select a virtual one.

definition(
    name: "Test 2",
    namespace: "",
    author: "Jeremy Dreese",
    description: "Test 2",
    category: "",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
    iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png")


preferences {
	section("Smoke detector...") {
		input "smoke1", "capability.smokeDetector", title: "Where?"
	}
}

def installed() {
	log.debug "Installed with settings: ${settings}"

	initialize()
}

def updated() {
	log.debug "Updated with settings: ${settings}"

	unsubscribe()
	initialize()
}

def initialize() {
	// TODO: subscribe to attributes, devices, locations, etc.
}

// TODO: implement event handlers

whaaaaaaa…

@bflorian the simulator does not work with virtual smoke detectors. The app installs just fine with a real smoke detector.

Thanks for confirming this issue.

So couple years have passed and still seeing issues with the simulator and smoke detectors and batteries.
any plans to work on that?