Subscribe to custom event


#1

Is there a way to use webcore to subscribe and act on an event that’s not part of the default capability and attribute model of SmartThings? I have a keypad that throws a “codeEntered” event whenever a code is entered, and I’d like to use webcore to track when codes are entered and store values over time.

I don’t see anywhere that I can define that event outside of editing the source code of webcore.


#2

Try an ‘on events’ and see if you can log your event data. If you can log it, you can store it :slight_smile:

on events from
   deviceName's codeEntered
do
  Log info: {Data: [deviceName:codeEntered]}

#3

I am trying to use a custom event for the first time. I am not sure of the syntax or logic. I am trying to use webcore to control the buzzer that is connected to my Konnected home alarm system that is controlled by Smart Home Monitor. I want a buzzer for 30 seconds for entry and exit times. Can you give me some hints as to how to code this using the info here? Thanks.


#4

Will check it out tomorrow and see. I don’t use SHM myself so we’ll see what we come up with.


#5

Ok, what exactly is the event you’re trying to capture or log?


#6

That is what I am not sure about. And I am probably over my head here. The link that I referenced above suggests that I can access the event of an alarm event with Smart Home Monitor. His smartapp is having difficulty activating my buzzer for 30 seconds. So he is suggesting that I can subscribe to the alarm event and use that data to control the buzzer with webcore. I can control the buzzer easily with webcore. I probably can just reference the status change of the Smart Home Monitor and control things that way. But the author of the SHM delay smartapp linked above suggested subscribing to the alarm event. That is new to me so I thought I would ask for clarity/help as I am not familiar with that option.


#7

I’m with @Pantheon…I’d like to accomplish the same thing, but have no idea where to start.