Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable Action "Find" command or alternate
#1
I am trying to parse through a long string of values to find a certain set of numbers and thought the find command would work well. 

When I got to actually try and use Find I can't locate that command in the GVar/LVar list of commands. It's not there, or I have been staring at my screen so long I just can't see it. (on latest Open Source CQC release)  Is there something I am missing here as to where that command should be or has it been removed for some reason?  Is there any other command that is similar I am just missing?

The values in the variable I have are like this:
Code:
{"json":true,"source":"mqtt","has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"mode":"color","red":255,"green":68,"blue":49,"white":255,"gain":68,"effect":4,"transition":500,"power":30.80,"overpower":false}
I need to pull out the  Red, Green etc. values and store them / manipulate and then put back in and write back to this device I am using via MQTT.  I thought I had this cased by using GetSubStrng, but realized the index is also variable dependant on how big some of the values in the json text are.  i.e. 0 or 255 changes the index by 2.

Anyone have any advice on how to most efficiently pull these values out?
-Mike G
Reply
#2
Small update. I found a way to pull the values out by using the MQTT JSONmap so no longer really need help with parsing the data. Still interested in the status of the find command though.
-Mike G
Reply
#3
That's one that only makes sense to call if you check the status. So it's only available under the If and If/Else buttons.
Dean Roddey
Explorans limites defectum
Reply
#4
Ahh, I see it now. Thanks! Good to know.
-Mike G
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  ExecApp Action Failing Shaky 2 111 11-02-2021, 08:17 PM
Last Post: Shaky
  6.0.0 Interface Viewer - Action Trace Mark Stega 1 406 03-09-2021, 06:39 PM
Last Post: Dean Roddey
  Escaping Character in Action Parameters gReatAutomation 0 450 09-02-2020, 05:51 AM
Last Post: gReatAutomation
  Dynamically Build Call to Variable? gReatAutomation 8 1,696 05-08-2020, 01:22 PM
Last Post: gReatAutomation
  Action wait and exit if variable changes simplextech 8 2,399 02-01-2020, 12:35 PM
Last Post: simplextech
  [FEATURE] Event Run Action simplextech 4 1,976 01-09-2020, 02:04 PM
Last Post: simplextech
  Scheduled Events - Cannot find the specified path gReatAutomation 4 1,253 08-16-2019, 12:21 PM
Last Post: Dean Roddey
  Time formatting RunTime Time Variable? gReatAutomation 5 1,754 08-14-2019, 05:23 AM
Last Post: gReatAutomation
  GVar... Variable GVar... Already Exists gReatAutomation 3 1,167 08-13-2019, 01:15 PM
Last Post: Dean Roddey
  Creating a Variable Double_J 13 4,039 06-22-2019, 03:40 AM
Last Post: gReatAutomation

Forum Jump:


Users browsing this thread: 1 Guest(s)