Need PLTS/PLEG help for Wifi connections/disconnects...

My solution for an Occupancy sensor is based on mobile phone Wifi connecting to our home network.

I’m still trying to figure out how I’d do this and what is best to use… PLEG or PLTS?

SCENARIO…

Device or Variable - tracks ‘state’ a mobile phone’s Wifi (connected/not)

Ping Sensor to detect mobile phone’s IP on Wifi network is used

  • not 100% reliable because phone will disconnect/reconnect so logic is needed to work around this

Need definable wait time (in seconds) before a ‘state’ change occurs

  • e.g. if the phone connects/disconnects, wait 30 seconds before changing the ‘state’ of that phone.

You guys have ideas on the most efficient way to do this? … please be specific with code, I’m still learning PLEG and I’ve never used PLTS.

thx!

I have a ping sensor to detect the cell phone, I have a count of three because sometimes the ping does not work, and checks every two minutes. In pleg, I have the condition of the phone going out after the ping sensor is off for more than three minutes. This helps, but I still get false positives. Maybe we get some more ideas.

Hi Aaron!

So long as you are happy that the condition might take anywhere from 15 seconds to 1 minute and 15 seconds to trigger then “Home and (Home; NOW > 00:00:15)” will work.

I have something similar set-up but use PLTS as I wanted better than 1 minute resolution. A few people get stuck with the NOW statement.

This post from RTS sums things up well:

http://forum.micasaverde.com/index.php/topic,12759.msg137212.html#msg137212

[quote=“timmyg, post:3, topic:177887”]Hi Aaron!

So long as you are happy that the condition might take anywhere from 15 seconds to 1 minute and 15 seconds to trigger then “Home and (Home; NOW > 00:00:15)” will work.

I have something similar set-up but use PLTS as I wanted better than 1 minute resolution. A few people get stuck with the NOW statement.

This post from RTS sums things up well:

http://forum.micasaverde.com/index.php/topic,12759.msg137212.html#msg137212[/quote]

I definitely want it ‘tighter’ than 1 minute… I actually want to play with timings of 10,15,20,30 seconds.

How do you have your PLTS setup? (I’ve never used PLTS)

thx for the help!

I’m still trying to figure out how I’d do this and what is best to use… PLEG or PLTS?

SCENARIO…

Device or Variable - tracks ‘state’ a mobile phone’s Wifi (connected/not)

Ping Sensor to detect mobile phone’s IP on Wifi network is used

  • not 100% reliable because phone will disconnect/reconnect so logic is needed to work around this

Need definable wait time (in seconds) before a ‘state’ change occurs

  • e.g. if the phone connects/disconnects, wait 30 seconds before changing the ‘state’ of that phone.

You guys have ideas on the most efficient way to do this? … please be specific with code, I’m still learning PLEG and I’ve never used PLTS.

thx!

Not sure if this’ll help, but I approached this idea from a different direction. I’ve got an Android phone and was already using Tasker.

I run AutHomationHD to communicate with Vera. AutHomationHD integrates with Tasker.

When I arrive home (as detected via Tasker by “Wifi near SSID”), I set a virtual switch to track that I’m home.

I have an exit event that turns off the virtual switch.

Vera typically knows I’m home as I pull into the driveway.

I was using, for non-Vera related things, ‘Near Wifi’ in the past with mixed results… I have set it back up and will now use that and Ping Sensor.

Here’s my initial thoughts…

Tasker ‘Near Wifi’ triggers AutHomation to turn Virtual Switch On or Off (later I will use a Variable Container when Authomation supports it via Tasker)
Ping Sensor will set a value in a Variable Container

So, here’s the logic

AWAY TRUE = Virtual Switch AND Value
HOME TRUE = Virtual Switch OR Value

This way, if I’m immediately outside, but out of reach to connect Wifi, I’m still “home” but when far enough away both vSwitch & Value to be set to Away… thus, enabling my Alarm System.

Hi Aaron,

Sorry have not been back in touch, have been busier than a one armed man paddling a canoe :slight_smile:

Tasker is an awesome app - i thought i would post relating to the questions you asked in post 1.

Give PLTS a try, it will give you the tight control you require. Each PLTS can handle two timed scenarios with an easy config.

It is very similar to Pleg in terms of set-up. Define your triggers, schedules etc. In the conditions tab you use the same logic types as you would in PLEG.

Trigger is related to the time set in Interval, and Trigger 2 is related to the time set in Interval 2.

Attached is the status report for my simple sprinkler controller (note PLTS version 5.1)

Triggers are set true via my watering schedule OR is if the sprinklers are started by something else. Actions are set via the actions tab same as PLEG, in my case they turn on the sprinkler relays.
If Trigger is true my PLTS will time down from 240 seconds and turn off Hanging Pots
If Trigger 2 is true my PLTS will time down from 600 seconds and turn off Front Yard
When the PLTS has timed down it will set both sprinkler relays to off
If I turn off the relays by other means the PLTS will reset - see the logic associated with OFF.

For your setup you could have:

Interval =20
Interval 2 =

Reset state = off

Switch Mode = Delayed Toggle With Explicit Reset

Input:
ping_tripped
ping_not_tripped
bypassed

Conditions:
Arm NOT bypassed
Bypass bypassed
Trigger ping1_tripped
reset ping1_not_tripped

Actions:
On = virtual switch on
Off = virtual switch off

The timer will start counting down from 20 seconds when the trigger = ping1_tripped goes true, if Reset = ping1_not_tripped goes true the timer is reset (this would be when your phone is dropping in out of WIFI area). If ping1_tripped stays tripped for 20 seconds then virtual switch will be turned on. Once your phone is out of the WIFI area ping1_not_tripped will reset your timer and set the virtual switch to off. You could change this so that something else resets the virtual switch and timer if it suits.

Hope this helps!
Tim

Tim,
thanks for explaining it to me, including the use case I’m looking at. Makes sense now. I’ll be looking at doing this if my current setup does not work as I’d like.

A few days ago, I started using Tasker (Android app) to detect ‘Near Wifi’ and ‘Location’. Tasker sends Vera a status change using AuthomationHD’s Tasker integration. This in conjunction with the Ping Sensor app in Vera hopefully will provide reliability with a smaller time delay that waiting 10-20 seconds using PLTS. But, we’ll see if it works as planned :slight_smile: – I need more testing to make sure it is reliable.

thx!

Cool hope it works! Tasked is an awesome app. Another good one is Automagic, not as mature as Tasked yet. It uses flow diagrams to setup triggers, conditions and actions so nice and user friendly!

Tim

Sent from my GT-I9100 using Tapatalk