I’ve successfully created a Web Service app which basically listen to any REST API coming from my router when a new user connect to my router (DD-WRT). So how it works is when someone connect to my router (through WIFI) , the router will call a REST API to the web service smarthing app and I’ll catch the event there. At this time, I’ve sent a push notificaton inside the smart app and that works fine. I was wondering if I could maybe leverage this to an event and let other app subscribe to this event instead of just sending a push notification. Basically, transforming the web service app to a “soft” device handler with a capability.
This would allow other apps to subscribe to this event and do what ever they want to do with it. For example, I would prefer using the “notify when” smartapp to fire a notification on that new “event” instead of my smart app itself.
The first thing I had in mind is to create an event and fire it off from my smartapp but I don’t believe we can create event from a smartapp, only device handler correct?
The second thing I had in mind was that if only device handler can fire event, I would create a device handler that would be able to create event and will propagate, however, I don’t think the platform support creating virtual device handler and web service. Also it seems that all device handler need to be bind with a real device so don’t think this is good.
Is there any way I could do what I want to do (ie: create an event from a web service and let other app subscribe to it) or this is just not supported… ?
any help will help !