Is it possible to create custom events to establish communication between smartapps ?
Use case: let’s say I create a smartapp to manage groups of events (e.g. motion on any of these sensors) and generate a synthetic event based on any of said device publishing one. Then I would have other smartapps subscrbing to this custom event to take action e.g. one smartapp could switch on lights whilst another one would compute statistics.
I think many people would just do that with a virtual switch. Turn on the virtual switch with the first smartapp and subscribe to that switch coming on in the second Smartapp.
There are probably other ways to do it as well, so hopefully some of the master coders will comment. But the virtual switch method is pretty simple.
Smartapp B contains, but never executes the foobarHandler (no debug message, good subsciption, no errors)
subscribe(location, “shmdelay”, foobarHandler)
Thank you for that suggestion. I was hopeful, but it did not work. I’ll take a look at the WebCore source. The Smartapp(s) I plan to execute are all children of the main app, so I can simply get them all via the parent, then execute the target routine versus using sendLocalEvent. Not nearly as elegent, but it will work.
Edit: Whoops a deeper review of the logs shows the subscribe did work, but I had a spelling error on the value test. Thanks!!!