Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IF statement not working
#1
I have done If System::Equals many times before but I am stumped on why this will not run.

Simply, I have a triggered event off my phone when connected to my network to fire a tasker task via the autoremote function.  

BUT

If System::Equals(NetworkMonitor.EricPhone, True, No Case)

   Do global action stuff for tasker if connected to home network

Else

  Do global action stuff if phone not connected to home network.

End

This does not work...Phone is connected to network and field is True but it skips the If True section and goes to the Else line.  I then added and If False statement to the Else line to see if the False would fire...nope.

Here is the full code:
If 
System::Equals
    P1=NetworkMonitor.EricPhone
    P2=True
    P3=No Case

System:Big GrinoGlobalAct
    P1=/User/Misc/SendARMsgYps
    P2="recloopvar","run"

System::WaitTimer
    P1=0
    P2=5000

System:Big GrinoGlobalAct
    P1=/User/Misc/SendARMsgYps
    P2="recloop","on"

Else

If 
System::Equals
    P1=VarDrvr.Text
    P2=False
    P3=No Case

System:Big GrinoGlobalAct
    P1=/User/Misc/SendARMsgYps
    P2="recloopvar","stop"

Else

End

End




Running version 5.07.  

Thoughts?
System: WHS, UPB, Plex, Elk
Drivers: Autopatch, DataLog DB, DTV IP, GC-100, IRA, Logic Server, Variable Driver, Weather Underground
Reply
#2
It's this:

Code:
If System::Equals(NetworkMonitor.EricPhone, True, No Case)

You are literally comparing the name of the field to True. You need to do this:

Code:
If System::Equals($(NetworkMonitor.EricPhone), True, No Case)

That will resolve to the actual value of the field. Where possible using the action testing dialog, which will show you the actual fleshed out results of the action. You would have seen it comparing "NetworkMonitor.EricPhone" and "True" in that If statement.

Also, use the helper button or the action parameter popup menu to select fields. It will give you the option to insert the name or a reference to the name, which makes it quick and easy to do.
Dean Roddey
Explorans limites defectum
Reply
#3
Dang...that gets me everytime. Thanks. I should have known that.
System: WHS, UPB, Plex, Elk
Drivers: Autopatch, DataLog DB, DTV IP, GC-100, IRA, Logic Server, Variable Driver, Weather Underground
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  MQTT Verify Configuration not working znelbok 4 975 03-17-2022, 01:07 PM
Last Post: Dean Roddey
  Trigger not Working after Move to new Server & V6.0.7 kblagron 4 1,092 03-02-2022, 05:35 AM
Last Post: sic0048
Wink Is there a way to get somfy shades working with cqc? ghurty 2 1,412 07-17-2020, 11:13 AM
Last Post: kfly
  What is a modern multizone audio amplifier working with CQC? ghurty 5 2,048 04-28-2020, 02:22 PM
Last Post: Bugman
  If statement to check field value simplextech 10 4,157 01-27-2020, 01:32 PM
Last Post: Dean Roddey
  E-Mail stopped working ... but then fixed rbroders 0 1,193 10-31-2019, 01:03 PM
Last Post: rbroders
  What products would give the best experience working with CQC? ghurty 11 4,431 01-05-2019, 08:20 PM
Last Post: ghurty
  Android and WebRIVA - working? batwater 9 4,647 09-30-2018, 01:44 PM
Last Post: Dean Roddey
  HTTP Get driver not working znelbok 10 6,011 08-28-2018, 10:10 AM
Last Post: Dean Roddey
  Alexa not working Ron Haley 4 3,110 07-24-2018, 03:47 PM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 1 Guest(s)