sendEvent to device from the SmartApp


The doc said that I could send a event to a device from the SmartApp using:

void sendEvent(Device device, Map properties)

Do you have example? I cannot make it work as expected. (nothing in recent activities in the device recent tab)

( co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2

Yah… That doesn’t work. I’ve had a message open to one of the Engineers for months now… He promised to look into it, but has reneged twice.

I don’t have an exact working example handy, but I might find my notes somewhere…

Basically, you can call the sendEvent property of a device to set its own Attribute, if I recall correctly…


(Moiz Hayder) #3

has this issue been fixed now ?


Interested in a solution too, I’ve never been able tu make this method (sendEvent) work. The best I can do is not to make my smartapp fail, but no events are raised at all.

(Martin Verbeek) #5

Did anybody got this working in the meantime? Would like to use it this way without the need to create a custom command in the device.

( - Make your home your butler!) #6

Nope, still isn’t working as described in the docs, just been 3 years. @Jim should this be removed from the official docs?
If one tries to call sendEvent on a child device from a parent app it calls the parse method :))

(Martin Verbeek) #7

Thanks, made it work using parse, if documented right it can be used as if the event was coming from the device, just need to pass it with createEvent in parse.

(Larry) #8

not sure how you are doinig it but works fine for me… i use my modified smartalarm to send notifications to my alarm status device ie

def reportStatus()
log.debug "in report status"
if (settings.haveNotificationDevice)
log.debug “notification device = $notificationDevice”

log.debug "not null"
def phrase = ""
if (state.alarms.size())
phrase = "Alert: Alarm at ${}!"
log.debug "sending notification alert: = $phrase"
def zones = "Zones: "


metadata {
definition (name: “Smart Alarm Notification Device”, namespace: “lgkapps”, author: “Larry Kahn”) {
capability “Notification”


def deviceNotification(String desc)
log.debug “in device notification"
log.debug “desc = $desc"
def parts = desc.split(”:”)

if (parts.length == 2)

def command = parts[0]
def value = parts[1]
log.debug “command = $command value = $value

switch (command)

(Martin Verbeek) #9

In smartapp I now use standard sendEvent(device, [name: xx, value:yy])

In the device in the standard parse routine, in short

Def parse(message)
evt = createEvent(message)
return evt

I used custom commands before.