Rules: "if %ssid% = my_ssid" doesn't works ?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
djelau
Normal user
Posts: 45
Joined: 08 Nov 2019, 15:33
Location: France

Rules: "if %ssid% = my_ssid" doesn't works ?

#1 Post by djelau » 09 Oct 2023, 07:36

Hello,

I try to check on which wifi SSID I'm connected but it seems that rule doesn't work. Any idea to check that?

Code: Select all

on WiFi#Connected do
if %ssid% = my_ssid
 GPIO,1,0
endif
endon
djelau

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Rules: "if %ssid% = my_ssid" doesn't works ?

#2 Post by Ath » 09 Oct 2023, 08:57

Rules don't yet support string comparisons, unfortunately, but you could do something like this:

Code: Select all

on WiFi#Connected do
  ASyncEvent,WiFi#%ssid%
endon
on WiFi#my_ssid do
 GPIO,1,0 // On
endon
on WiFi#other_ssid do
 GPIO,1,1 // Off?
endon
on WiFi#Disconnected do
  GPIO,1,1 // Off?
endon
/Ton (PayPal.me)

djelau
Normal user
Posts: 45
Joined: 08 Nov 2019, 15:33
Location: France

Re: Rules: "if %ssid% = my_ssid" doesn't works ?

#3 Post by djelau » 09 Oct 2023, 09:11

Thanks Ath, I think it will answer to my request. I will try this solution asap

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 46 guests