Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Action command help
#1
I am starting a new thread, to not clutter the driver development thread for Radio RA2, and the issue is likely my limitation in understanding the commands, syntax.
So there is a field change trigger based on which I am trying to make a timed field write.

The trigger looks like this in the CQCEventDump

Code:
EvID=6CC52076908B619E-7D91F0B687574131
cqsl.header
{
v=1
sysid=328B4CCB3BF736BE-0D2CD018B3D4CA91
class=cqsl.fldchange
source=cqsl.field:RadioRA2.LGHT#Dim_FBFan
}
cqsl.fldval
{
val=25
}

My action script looks like this:
Code:
TrigEvent::GetEvField(%(TEvRTV:NewFldVal), LVar:DimLevel)
// getting the dimmer level from RTV

If System::Equals(LVar:DimLevel, 25, Case)
    Devices::TimedFldChange(RadioRA2.LGHT#Sw_FBFan, True, False, 1)
End
This is not working, in the log I am getting
"The path '25' is not well formed."
"Scheduled/Triggered Event 'name' failed"
Reply
#2
You don't need to call GetEvField. That is allowing you to access arbitrary info within the event. The %(TEvRTV:NewFldVal) token already contains the actual field value that was sent (25 in this case.) So that's why it's complaining about the path 25, because it expects a path like /cqsl.fldval/val which refers to a particular value in the event info. But you already have that info so you can just use it directly. You don't even need to put into a local var or anything, just use it as is.

So:

If System::Equals(%(TEvRTV:NewFldVal), 25, Case)
Dean Roddey
Explorans limites defectum
Reply
#3
Thanks Dean, it was that simple, and it works!

So is what is the best way to do a case logic structure and the action editor.
If need to evaluate the NewFldVal against several different cases?
Just have the required number of If...Then clauses?
Reply
#4
Yeh, there's no real equivalent to a switch or case type construct. Where possible, arrange it so you don't have to, as in my previous update of your original scenario. If you are trying to convert the incoming level to an on time, try to do it by math instead, for instance.

But, short of that, you have to just try each value.
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to copy/paste command button on template Deane Johnson 1 842 04-17-2020, 02:18 PM
Last Post: Dean Roddey
  Where's the Action Editor? Deane Johnson 4 1,839 07-30-2019, 02:50 PM
Last Post: Dean Roddey
  User Action on ZWave Keypad jkmonroe 18 8,342 04-04-2015, 05:46 AM
Last Post: jkmonroe
  How to put a pause in an Action list? Deane Johnson 10 5,006 11-30-2014, 11:22 AM
Last Post: Dean Roddey
  If ... Else to create toggle command? finish.06 3 2,372 06-12-2014, 07:13 AM
Last Post: Dean Roddey
  VRCOP User Action Configuration potts.mike 30 10,461 05-11-2014, 09:06 PM
Last Post: potts.mike
  Interface Reload Command DaveB 1 1,824 02-17-2013, 12:30 PM
Last Post: Dean Roddey
  HAI driver: RawCmd command ControlFreak 0 1,643 01-19-2012, 01:06 PM
Last Post: ControlFreak
  Best way to implement a timed action/macro brathnach 3 2,332 04-11-2011, 07:20 PM
Last Post: Dean Roddey
  Syntax for variable action khill 8 3,713 03-23-2011, 08:26 PM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 1 Guest(s)