10-28-2021, 09:07 PM
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:
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?
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}
Anyone have any advice on how to most efficiently pull these values out?
-Mike G