I want to fire the event from the SmartApp with custom data to keep track of the action / workflow that caused this event. I tried using sendEvent after reading the docs:
http://docs.smartthings.com/en/latest/ref-docs/smartapp-ref.html#sendevent
Signature:
void sendEvent(Map properties)
void sendEvent(Device device, Map properties)
but its not working for me.
Here’s what I am doing: (I have two Cree bulbs)
def evtProp = [name: “switch”, value: “on”, data:[“CustomEventId”: “12345”], descriptionText: “turned on!”]
switches.each {
sendEvent(it, evtProp)
}
the following error occurs:
[error]: groovy.lang.MissingMethodException: No signature of method: script14636722357482134563699.isChildMessage() is applicable for argument types: (java.util.LinkedHashMap) values: [[name:switch, value:on, data:[CustomEventId:12345], …]]
Possible solutions: isChildMessage(java.lang.String)
if I try,
switches.each {
it.sendEvent(evtProp)
}
it gives the error
[error] java.lang.IllegalArgumentException: Command ‘sendEvent’ is not supported by device of type ‘Cree Bulb’. Supported commands: [on, off, poll, configure, setLevel, refresh]
and when I try:
switches.each {
evtProp[“Device”] = it
sendEvent(evtProp)
}
the code executes without giving any error but nothing happens.
So what am I missing here ?