PLEG and GCal3 logic

I’m trying to look at a GCal3 day’s event(s) and set a condition on a partial match e.g. “No School” looking at the GCal3 parameters the only field that has the total days events listed is the “gc_jsonEvents”. The others fields seem to list singular events as they arise through out the day, so I thought that I could use Device Properties with “p_GCalEvents; gc_jsonEvents” which did bring the total day’s events (worked). I then created a test condition ‘p_GCalEvents == “No School”’ at first I thought it worked as it provided a True value but after further testing with a different test condition ‘p_GCalEvents == “Swimming”’ it too provided a True value where there is no “Swimming” value within the “gc_jsonEvents”. What am I doing wrong and is there a better way to accomplish this? Mike

== is a numerical comparison.
You need to use string comparison operators:
eq ne ~=

Richard, Many thanxs for the clarification. I should have known that as I’ve used the same in my weather condition used in another of my PLEGs. Mike

[glow=red,2,300]Second question: [/glow] I’m using the “gc_jsonEvents” variable with the current today’s events;

[ { "eventDescription": "none", "eventParameter": "", "eventName": "NO SCHOOL - SPRING BREAK", "eventEnd": 1492747200, "eventStart": 1492142400 }, { "eventDescription": "none", "eventParameter": "", "eventName": "HOUSEKEEPING - MONICA", "eventEnd": 1492527600, "eventStart": 1492524000 }, { "eventDescription": "none", "eventParameter": "", "eventName": "MOVIE - SMURF VILLAGE", "eventEnd": 1492543800, "eventStart": 1492534800 }, { "eventDescription": "none", "eventParameter": "", "eventName": "MARY WORK", "eventEnd": 1492572600, "eventStart": 1492542000 } ] (as shown in the device properties current value).
Will the following condition statement 'p_GCalEvents eq "NO SCHOOL"' work or am I still missing something? Mike

You want to use =~
Thats a substring match

eq would required a character for character match, and your gc_jsonEvents has a LOT of characters … so it will not match something with a few characters.

Richard, thanxs that worked like champ! ;D

In your previous post you had indicated “eq ne ~=” which I originally did not pickup on, is there any significance/difference using ne eq order? Mike

eq and ne does not matter which string is on the left side and which is on the right.

=~ will give you different results if you flip the arguments.
The left side is the string to search, the right side is the string you are looking for.

Again thanxs for explanation. Mike