02-07-2009, 09:46 PM
I have a single trigger setup to trigger on a CurItemName change for any of my players. In the actions I'd like to be able to get either the full field name or ideally just the driver name. How can I do this?
Newbie Question: How do I get event data for triggered events?
|
02-07-2009, 09:46 PM
I have a single trigger setup to trigger on a CurItemName change for any of my players. In the actions I'd like to be able to get either the full field name or ideally just the driver name. How can I do this?
02-09-2009, 12:50 PM
Is my questions too basic for anyone to answer?
![]() In addition to this scenario above, I also need to have another one where I trigged on any change for a driver and am then able to figure out which field changed. I don't want to have to create a trigger for each field. I *assume* this is possible.
02-09-2009, 01:08 PM
sorry dude, i just created a different trigger for each field if i needed to know which one changed. maybe dean knows.
------------------------------------
Some of my devices: Sonos, Aeotec zWave, Nest, Rain8Net, Various H/T What's next: CQC-Voice, Brultech GEM My vlogs: https://www.youtube.com/c/IVBsHomeAutomation
02-09-2009, 01:32 PM
When you get a field change event, the source will include the field name. So you can ask for the source value from the event, cut off the common starting part of it, and what's left is the driver.moniker value.
Dean Roddey
Explorans limites defectum
02-09-2009, 07:25 PM
Dean Roddey Wrote:When you get a field change event, the source will include the field name. So you can ask for the source value from the event, cut off the common starting part of it, and what's left is the driver.moniker value. I think I understood what you said, just not sure exactly how to get the Event information. Here is my code that does not work. No value is being assigned to the two LVars since they both stay at the J_Nothing value. Is this due to the driver? The event I'm trying to trap on is a change in the CurItemName on a Squeezebox. Code: //
02-09-2009, 08:16 PM
You don't want those values. Those I think are only for user action events. You want to get the source event source. If you look in the Action Guide technical document, you'll see an example of what a field change event looks like. The source field is in the main event block at the top. It'll have a standard prefix, then if it's a field change event, it'll have the driver and field as part of that source value. You'll have to cut the leading fixed part of the source value off, leaving just the moniker and field.
Dean Roddey
Explorans limites defectum
02-10-2009, 10:04 PM
Let me ask it a dumber way since I can't seem to find any explicit examples or documentation.
Insead of TrigEvent::GetEvField P1=/cqsl.actinfo/evtype P2=LVar:evType What do I need to call toget the action info in to a variable?
02-10-2009, 11:26 PM
Actually, I told you wrong, what you want is in the Event System technical document. If you go to Appendix A, you'll see the format of a field change event. In the first block, there's a Source value, which will be something like:
Code: source=cqsl.field:DevSim.Power So you want to retrieve the event field: /xap-header/Source Then cut the 'cqsl.field:' part off. That'll leave you with the field that changed. So pass that /xap-header/Source to the GetEvField, and it'll put the value of that into the variable you indicate, so something like: Code: TrivEvent::GetEvField(/xap-header/Source, LVar:EvSource) I may have some typos, but basically that. That should leave the field name in the variable.
Dean Roddey
Explorans limites defectum |
« Next Oldest | Next Newest »
|