Suggestions from anyone who has an action with presence det.

Posted on
Fri Dec 21, 2018 2:04 pm
mpovolo offline
Posts: 42
Joined: Dec 19, 2018

Suggestions from anyone who has an action with presence det.

Hi. Was looking for ideas from anyone who does actions based on presence detection. Right now I have an action when the garage Pi detects my car keys driving into the garage it unlocks the door into the house. I did this based on signal strength greater than -75. Problem is depending on where the keys are it continues to do it so I need to attach a different or an additiona check. For example, leaving, I lock my door, get into the car and go figure my door gets unlocked again because I’m still there. Lol. Any ideas?

Thanks

Posted on
Fri Dec 21, 2018 2:22 pm
kw123 offline
User avatar
Posts: 6475
Joined: May 12, 2013
Location: Dallas, TX

Re: Suggestions from anyone who has an action with presence

Check out homeaway plugin

You can add a gate function w it

Ie iBeacon plus door must be open to trigger
Gate can be x sec before and after


Sent from my iPhone using Tapatalk

Posted on
Fri Dec 21, 2018 2:45 pm
kw123 offline
User avatar
Posts: 6475
Joined: May 12, 2013
Location: Dallas, TX

Suggestions from anyone who has an action with presence det.

For these kind of things you need an asymmetrical trigger.
First establish away ( signal off for >x minutes ) Set away true eg in a variable

If away and signal: open door and set away to false

That and more is done in home away plugin.




Sent from my iPhone using Tapatalk

Posted on
Fri Dec 21, 2018 4:05 pm
mpovolo offline
Posts: 42
Joined: Dec 19, 2018

Re: Suggestions from anyone who has an action with presence

Thanks everyone. Great idea.

Posted on
Fri Dec 28, 2018 11:58 am
johnpolasek offline
Posts: 866
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Suggestions from anyone who has an action with presence

A little late, but I have pi's near each of the 3 doors that have Z-wave locks on them and a script which triggers on number of "Family" beacons changing; if Family beacons goes to 0, it locks all the doors and sets a variable to give me a pushover alert on movement or door opening, and clears if family beacon count becomes > 0. I also have a trigger on each valid beacon state becoming "up" which causes the puts the "closestRPI" state into a variable and calls an action script which unlocks the door that that Pi is closest to. It also used to put the closestRPIText states of all the present family beacons into a list and put that into a variable so I knew who was home, but Karl deprecatd that state for some reason and I've been trying to find all the places I used it ever since. Since everybody carries XYs on their keys, we rarely have to unlock anything.

Posted on
Fri Dec 28, 2018 2:42 pm
kw123 offline
User avatar
Posts: 6475
Joined: May 12, 2013
Location: Dallas, TX

Re: Suggestions from anyone who has an action with presence

Oops

Will check.

Karl


Sent from my iPhone using Tapatalk

Posted on
Fri Dec 28, 2018 4:24 pm
kw123 offline
User avatar
Posts: 6475
Joined: May 12, 2013
Location: Dallas, TX

Suggestions from anyone who has an action with presence det.

can't you use state = closestRPI instead of closestRPIText in your variable?

2 vs RPI-2?

I thought the info is equivalent..

Karl

Posted on
Sat Dec 29, 2018 9:01 am
kw123 offline
User avatar
Posts: 6475
Joined: May 12, 2013
Location: Dallas, TX

Re: Suggestions from anyone who has an action with presence

how about we put the the device name there (state name= closestRPIdevName) and not closestRPItext ="RPI-2"
eg state: closestRPIdevName = "front left entry" or "back garage" ...

?

Karl

Posted on
Sat Dec 29, 2018 10:52 am
johnpolasek offline
Posts: 866
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Suggestions from anyone who has an action with presence

kw123 wrote:
can't you use state = closestRPI instead of closestRPIText in your variable?

2 vs RPI-2?

I thought the info is equivalent..

Karl


That's what I have been doing: replacing
Code: Select all
                closestPiText =  MyDevice.states["closestRPIText"]


with
Code: Select all
                closestPiNum =  MyDevice.states["closestRPI"]
                closestPiText = "RPi"+str(closestPiNum)

every time I find another rarely used script that throws the error... The problem was (is) that I used it in bunch of places, and since the log doesn't tell me what trigger/schedule/action has thrown the error, I've got one that I can't find that is hitting once an hour or so (On Average).

Posted on
Sat Dec 29, 2018 11:14 am
kw123 offline
User avatar
Posts: 6475
Joined: May 12, 2013
Location: Dallas, TX

Re: Suggestions from anyone who has an action with presence

I have the new version ready that shows the name of the rpi in closestRPItext
Will publish later today


Sent from my iPhone using Tapatalk

Posted on
Sat Dec 29, 2018 12:35 pm
kw123 offline
User avatar
Posts: 6475
Joined: May 12, 2013
Location: Dallas, TX

Re: Suggestions from anyone who has an action with presence

question:

when an ibeacon goes offline (= goes away) the closest RPI goes to -1 should the costestRPItext go to ""
or should it keep the last RPi dev name, to see eg where the ibeacon exited?

Karl
[edit]
added option to select if clostestRPItext should go blank or should keep the last RPI dev name

doing some more testing, should be ready today

Posted on
Sat Dec 29, 2018 6:10 pm
kw123 offline
User avatar
Posts: 6475
Joined: May 12, 2013
Location: Dallas, TX

Re: Suggestions from anyone who has an action with presence

@johnpolasek , have added back the closestRPItext, but realized it is now text and not Text..

hope that's not a problem.


Karl

Posted on
Sun Dec 30, 2018 8:34 am
johnpolasek offline
Posts: 866
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Suggestions from anyone who has an action with presence

kw123 wrote:
@johnpolasek , have added back the closestRPItext, but realized it is now text and not Text..

hope that's not a problem.


Karl


Unfortunately that is THE problem; I've scrubbed all MY actions and triggers, but I'm still getting
    Dec 30, 2018, 8:17:15 AM
    Error device "Johns XY" state key closestRPIText not defined
    Error device "Johns XY" state key closestRPIText not defined
    Error device "Jeffs Keys2" state key closestRPIText not defined
    Error device "Jeffs Keys2" state key closestRPIText not defined

but now I'm also getting occasional

    SQL Logger Error exception trying to insert row into table variable_history_1858841481 ("iBeacon_With_Status_Change")
    SQL Logger Error ERROR: column "closestrpitext" of relation "device_history_1762882528" does not exist at character 569

    SQL Logger Error INSERT INTO variable_history_1858841481 (value) VALUES (%s);

which means that it's somewhere else... Is it possible that it's in the PostGres SQL table for the the existing beacons? And if it is, will I have to delete them and rebuild all the triggers I have in place?

Posted on
Sun Dec 30, 2018 10:07 am
kw123 offline
User avatar
Posts: 6475
Joined: May 12, 2013
Location: Dallas, TX

Re: Suggestions from anyone who has an action with presence

Ok will change.

The sql error:
Stop sqllogger wait 10 sec and restart



Sent from my iPhone using Tapatalk

Posted on
Sun Dec 30, 2018 10:33 am
kw123 offline
User avatar
Posts: 6475
Joined: May 12, 2013
Location: Dallas, TX

Re: Suggestions from anyone who has an action with presence

posted v .262 has old state name for costestPRPIText

and a side remark .. the new temp sensor max31865 goes from at least -50C ... +200C (tested w cold spray and gas flame)

Karl

Who is online

Users browsing this forum: No registered users and 0 guests