Simulator issue with smoke detector

(Jeremy Dreese) #1

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 [,,,,,,,,,,,,,,,,,,,nullable]; arguments [name,class physicalgraph.device.Device]; default message [{0} cannot be null]

According to the documentation (, 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.

(Andrew Urman) #2

can you post the full code?

(Jeremy Dreese) #3

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.

    name: "Test 2",
    namespace: "",
    author: "Jeremy Dreese",
    description: "Test 2",
    category: "",
    iconUrl: "",
    iconX2Url: "",
    iconX3Url: "")

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

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


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


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

// TODO: implement event handlers

(Andrew Urman) #4


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

(Jeremy Dreese) #5

Thanks for confirming this issue.

(greg) #6

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