Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't Find a Couple of Documented Action Commands
#1
I can't find two action commands that are documented in 5.3.2, and just wanted to find out if they are available.

One is Find(), and the other is IsInList().

What I am trying to do is take a String List, and Search for a substring, and if found, provide the Index of it within the String List.  Maybe there is a better way than using these two commands, so if you know of one, that would be great.
Reply
#2
I found them both - didn't think to look in the If/If-Then commands, I was just looking at Commands for my test.

Now off to figure out how to get the info into some variables.
Reply
#3
If a command exists purely to return a status, then it will only be available in the If/If-Then section, because it really is only useful to use in a conditional statement. Some commands are useful in both ways. One that are only useful for conditionals are ones that don't have any effect. I.e. they don't change anything, they just return information about something. So calling them without reacting to their result is sort of meaningless. Some do have some effect, but they also return a value that you can use if you choose to, so they'd show up in the If bits and under the Commands section.
Dean Roddey
Software Geek Extraordinaire
Reply
#4
Okay, I have a string list that looks like this (from the runtimer2 driver):

"09/04  21 (05:23:50)", "09/05  35 (08:50:52)", "09/06  37 (11:38:02)", "09/07  41 (09:10:01)", "09/12  22 (04:53:09) (so far)"

It shows the date, number of runs, and time run.  I want to find the data shown in parentheses for the last 7 days.  I can use an If statement with IsInList() with the dates for the last 7 days, and if true, then I want to know which token number it is.  Is there a command like the GetEnumOrdinal() command for string lists to get the token number?  This string list will grow over time, so I would need to get the token number, then do some string manipulation to pull out the information within parentheses.  

If there is a command for this, I couldn't find it.  I could always count back from the last token, and then check to see if it is in the list, and do it that way, but it would be cleaner if I could get the number from a search of the date value.
Reply
#5
For that kind of stuff, the action system isn't optimal. That's stuff really better done in CML. So basically you need to search that list for the day that represents 7 days ago, then move forward for seven days, grabbing the data? What is that data? Is that hours, minutes and seconds? Are you going to ultimately want to just add those up for a final hours, minutes and seconds?
Dean Roddey
Software Geek Extraordinaire
Reply
#6
(09-13-2018, 09:05 AM)Dean Roddey Wrote: For that kind of stuff, the action system isn't optimal. That's stuff really better done in CML. So basically you need to search that list for the day that represents 7 days ago, then move forward for seven days, grabbing the data?  What is that data? Is that hours, minutes and seconds? Are you going to ultimately want to just add those up for a final hours, minutes and seconds?

Yes just want to add those numbers to show the 7 days and the previous month - probably the run times also, which is the number before the parentheses.  I will make a stab at it with the method I mentioned and see how it works.  I am really not ready to tackle CML after seeing other examples - even though I was a C programmer back in the day, that was 30 years ago, and lets just say - alot of beer destroyed any memory of that.  Big Grin
Reply
#7
Did you ever work this out?
Dean Roddey
Software Geek Extraordinaire
Reply
#8
(09-30-2018, 08:38 AM)Dean Roddey Wrote: Did you ever work this out?

I did, and you were correct, the Action system wasn't great, but since I am running this scheduled trigger one time a day at midnight to collect the percentages and store them in a variables driver, I wasn't as concerned about the size of the action, and I got it to work.

Essentially, using the RunTimer2 for each of the 3 HVAC Units I have, I parse out the runtime data for each of the last 30 days, then convert it to seconds, and then calculate the run times, percentages, and number of runs for the last day, last week, and last month.


Attached Files
.jpg   ACData.jpg (Size: 107.96 KB / Downloads: 4)
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Can't find CQCServer pjgregory 12 1,436 03-25-2018, 10:37 AM
Last Post: Dean Roddey
  Create Global Action from IV? jkmonroe 3 598 12-30-2017, 12:04 PM
Last Post: Dean Roddey
  High Level Triggers and Action rules admin screen kfly 1 713 11-01-2017, 05:21 PM
Last Post: Dean Roddey
  Simple field change trigger action Bugman 15 3,799 10-23-2017, 11:55 AM
Last Post: Dean Roddey
  Additional HTTP REST commands requested greymatter 3 1,339 08-25-2017, 09:17 AM
Last Post: Dean Roddey
  A couple of small improvements pjgregory 1 650 06-29-2017, 08:50 PM
Last Post: Dean Roddey
  Problem with Action Parameters pjgregory 8 2,269 06-29-2017, 03:45 PM
Last Post: Dean Roddey
  Truncation of lines in the Action viewer / editor dlmorgan999 3 1,505 05-09-2017, 04:21 PM
Last Post: Dean Roddey
  Future feature request: The ability to lock an action ghurty 1 1,017 05-04-2017, 07:02 PM
Last Post: Dean Roddey
  Minor issue with named widgets in the action editor dlmorgan999 11 4,113 04-05-2017, 04:50 PM
Last Post: dlmorgan999

Forum Jump:


Users browsing this thread: 1 Guest(s)