Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need Help With User Action Events
#1
I am trying to create a trigger based on the press of a Lutron HomeWorks keypad button. The HomeWorks driver doc states:

"This driver will send User Action events for each press/release of any buttons you configure. This allows you to have CQC react to button press/release events from the Lutron system. As with all User Action events, it will be identified by the driver moniker, and a type/data values. The types will be ButtonPress and ButtonRelease and the data value will be the configured name of the button. This allows you to selectively react to specific buttons and press/release events."
".
I have a keypad button defined in the driver as "BonusRoomKP

The keypad buttons are not driver fields so I don't know how to sense a User Action for this. I also looked at the Action Guide doc, but I still couldn't figure it out.
Reply
#2
They are used to fire triggered events, and are sent automatically. You don't have to configure the driver to send them. On the event server side, one of the filter types in a triggered event is to look for a user action from a specific driver, or from a specific driver with a specific type. You can then use runtime values inside the triggered event to look at the value sent, to see which particular button was pressed.
Dean Roddey
Explorans limites defectum
Reply
#3
I'm almost there...I have the triggered event defined correctly, I think, but I can't get the action to work right. I have the following in my event filter:

"Is User Action From"
Field: HomeWorks
Comp Value: ButtonPress

For the Action I don't know which RTV to use. I tried all the ones I think are related to the trigger, but I can't get the action in the IF statement to execute.

If System::Equals(%(TEvRTV:NewFldVal)
Devices::FieldWrite(WebDT_IV.Action, Unblank, True)
End


If I remove the "IF" statement then it works so something must be wrong with my compare.
Reply
#4
It's not a field value in this case, so that won't work. Actually, what might be better for your purposes is to to use the event target, there should be command target that represents the vent you received. And it should have something like a GetUserActVals() or something like that, to get those two values when the received event is a user action. You provide it two target variables to fill in, and it fills them with the type and value.
Dean Roddey
Explorans limites defectum
Reply
#5
Dean Roddey Wrote:It's not a field value in this case, so that won't work. Actually, what might be better for your purposes is to to use the event target, there should be command target that represents the vent you received. And it should have something like a GetUserActVals() or something like that, to get those two values when the received event is a user action. You provide it two target variables to fill in, and it fills them with the type and value.

I hate to keep asking you to walk me through this, but I'm not sure I completely understand how to implement your suggestion. Can you expand on it a little more? Is GetUserActVals() an existing routine or do I need to write it?
Reply
#6
One of the command targets (like System, LocalVars, etc...) in the action should be the event target. This provides you access to the incoming event trigger information. And one of the commands is to get the user action values. So it's just a command within your event handler action in the template. Or it should be. I guess it's always possible that when I added support for event triggers in the templates that I failed to make the event target available. I'll look and see.
Dean Roddey
Explorans limites defectum
Reply
#7
I haven't had a chance to try this yet, but I was editing the action for this event under the "Administer the server event server" section of the CQC Admin Interface. I was NOT doing this in the template's "Events" tab. Since the unblank action is performed on a driver I didn't do it from the template.
Reply
#8
It should be the same either way. In any action that's handling an event trigger, you should see a target for the event trigger itself which gives you access to the trigger info.
Dean Roddey
Explorans limites defectum
Reply
#9
So if I create an event trigger with the filter:

Is User Action From
Field: HomeWorks
Comp Value: ButtonPress

I then see a command target for "TrigEvent". Under this command target I selected the GetUserActionVals() routine. I created a GVar for the GetUserActionVal 'Type' argument and for the 'Value' argument I think I want to use the RTV which contains the name of the HomeWorks button that was pressed. In this case the name of the keypad button pressed is "BonusRoomAllOn". The RTVs which appear to be related to the triggered event are:

New Field Value
Event Source
Source Field
Source Moniker

I assume 'Source Moniker' will be set to "HomeWorks", but I don't know which RTV to use which will contain "BonusRoomAllOn".
Reply
#10
You wouldn't make them GVars, make the LVars since you only need them for the length of the action you are creating. Only use globals for stuff that you need to stay around between actions.

So you would do something like:

Code:
TrigEvent:GetUserActionVals(LVar:Type, LVar:Value)
If System::Equals(%(LVar:Value), "BonusRoomAllOn")
   do something...
EndIf;

So you don't need the runtime values at all here. You are getting the values of the incoming trigger directly through this call, putting them into local variables that you can look at. The type isn't really needed since presumably you used the filter to only get this action run for a button press type trigger from the Lutron driver.

If you want to verify it's only getting invoked when you want, mark it ot be logged when run and bring up the log monitor and watch to see that it only runs when you think it should.
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  6.0.0 Interface Viewer - Action Trace Mark Stega 1 149 03-09-2021, 06:39 PM
Last Post: Dean Roddey
  Error trying to edit scheduled events George M 15 1,230 09-27-2020, 09:27 AM
Last Post: George M
  Escaping Character in Action Parameters gReatAutomation 0 287 09-02-2020, 05:51 AM
Last Post: gReatAutomation
  Action wait and exit if variable changes simplextech 8 1,822 02-01-2020, 12:35 PM
Last Post: simplextech
  CQC HTTP Events? bjkiller 26 6,475 01-11-2020, 07:27 AM
Last Post: simplextech
  [FEATURE] Event Run Action simplextech 4 1,526 01-09-2020, 02:04 PM
Last Post: simplextech
  Scheduled Events Caseta tom 18 4,277 12-22-2019, 07:06 AM
Last Post: Dean Roddey
  Editing Triggered Events Possibly Causing Kernel Panic/Crash gReatAutomation 6 1,891 11-08-2019, 01:10 PM
Last Post: Dean Roddey
  Display of an Extended Wait for User Image kblagron 4 1,317 09-20-2019, 02:21 PM
Last Post: kblagron
  Possible Bug with Triggered Events gReatAutomation 3 1,085 09-19-2019, 02:41 PM
Last Post: gReatAutomation

Forum Jump:


Users browsing this thread: 1 Guest(s)