I am writing a snippet of code to run an exhaust fan when it’s cooler outside and above a certain temp inside. I want this to only run in selected modes. I understand that I just need to add a mode() statement to do this.
With the code in my preferences section: section ("Active modes") { mode(title: "Set for specific mode(s)") }
I get the thrown error
grails.validation.ValidationException: Validation Error(s) occurred during save():
Field error in object ‘physicalgraph.app.InstalledSmartAppData’ on field ‘name’: rejected value ; codes [physicalgraph.app.InstalledSmartAppData.name.blank.error.physicalgraph.app.InstalledSmartAppData.name,physicalgraph.app.InstalledSmartAppData.name.blank.error.name,physicalgraph.app.InstalledSmartAppData.name.blank.error.java.lang.String,physicalgraph.app.InstalledSmartAppData.name.blank.error,installedSmartAppData.name.blank.error.physicalgraph.app.InstalledSmartAppData.name,installedSmartAppData.name.blank.error.name,installedSmartAppData.name.blank.error.java.lang.String,installedSmartAppData.name.blank.error,physicalgraph.app.InstalledSmartAppData.name.blank.physicalgraph.app.InstalledSmartAppData.name,physicalgraph.app.InstalledSmartAppData.name.blank.name,physicalgraph.app.InstalledSmartAppData.name.blank.java.lang.String,physicalgraph.app.InstalledSmartAppData.name.blank,installedSmartAppData.name.blank.physicalgraph.app.InstalledSmartAppData.name,installedSmartAppData.name.blank.name,installedSmartAppData.name.blank.java.lang.String,installedSmartAppData.name.blank,blank.physicalgraph.app.InstalledSmartAppData.name,blank.name,blank.java.lang.String,blank]; arguments [name,class physicalgraph.app.InstalledSmartAppData]; default message [{0} cannot be blank]
when I attempt to initialize the code in the simulator.
Is this just a problem in the simulator? Will it work fine in the smartapp anyway? Did I miss something in the docs for this?
If someone could point me at a prior topic or answer it for me that would be very helpful. I couldn’t find it using a search of the forum.
I would do it with real world, except that I develop during slow times at work and don’t want to annoy the wife. I also use a compile/test/patch/compile… method of getting code out. It’s sloppy for development, but ends up teaching me better. (I have worked with Groovy for about 3 hours total and have a difficult time finding the API reference I need when I need it.)
I found the thermostat issue reading the “Whole House Fan” code. It uses thermostat for determining if it should run. I was trying to use mode to do the same thing. I have a thermostat now so it doesn’t much matter.
The point of my post was more in learning how to code the mode. Yes, I can just take the code and modify it, I was trying to learn.
So back to the original question: [quote=“Ac7ss, post:1, topic:55248”]
Is this just a problem in the simulator? Will it work fine in the smartapp anyway? Did I miss something in the docs for this?
[/quote]
Is this happening whn you are trying to save or when you are trying to use the simulator? Like I said in my post the simulator sucks, but reading the message it seems to be the type when you save.