mappings { path("/power") { action: [ GET: "checkPower" ] } } def checkPower() { return [power: power.currentContact == "closed" ? "ok" : "not ok"] }