themlruts Posted January 23, 2017 Posted January 23, 2017 You are substituting "phone" & "phone2" with the IP address of your phones right? What you show is just protecting your phone's IP address?That is correct. The phone IP would go there.
sdynak Posted January 23, 2017 Posted January 23, 2017 Maybe slightly off topic but I would like to try to separate this out to a vehicle and not a phone if it is possible with one that does not have any built in bluetooth or technology. Anyone think of a way to do it? Not against adding something to the vehicle to make it happen if it is reasonable. Thinking to have the garage door open for the wife but not when we are together in a a vehicle that does not get garaged. Cheers,Stan
jratliff Posted January 23, 2017 Posted January 23, 2017 I mounted a Pi Zero in my car with a Bluetooth low energy module that scans every 10 seconds for the BT mac address of your choice. I haven't finished deciding how I want to trigger the garage. The easiest idea I'm going with for the moment is when the Pi in the car detects a BT device in the garage (arriving home) it turns on a relay connected to an insteon mini remote button. The scene for that button will trigger a program in ISY checking if the garage is closed and if so trigger the garage to open. Here's the site that got me started: http://www.makeuseof.com/tag/auto-locking-office-door-smartphone-proximity-sensor/ This is a new setup so I'm still experimenting. I'd like to get an iot 3g dongle so the pi in the car can always communicate both ways and then just call the ISY program directly over the Internet. Sent from my SM-N930V using Tapatalk
KeviNH Posted January 23, 2017 Posted January 23, 2017 I am new to bash. Can anyone tell me why my else statement wont work? Its not even getting to it. The exit of arp-scan is 1 not found and 0 found. I am confused. You can use the "-x" option (e.g. "bash -x scriptname" or at "set -x" near the top of the script) to run the script with tracing so it shows you execution progress as it runs, this will often show where things are going off the rails.
jtara92101 Posted January 23, 2017 Posted January 23, 2017 (edited) Maybe slightly off topic but I would like to try to separate this out to a vehicle and not a phone if it is possible with one that does not have any built in bluetooth or technology. Put an iBeacon in the car? Ideally, wired-in in some manner so that it transmits when parked, and not when driving. (No good reason, except it seems silly to drive around bleeping "i'm here" to the world. But then again, that goes when at work, the mall parking lot, etc. etc. etc.) Or some kind of long-range RFID tag? Random web page I found: http://www.phaseivengr.com/wireless-technologies/wireless-technologies-overview/about-wireless-rfid-sensors/about-ultra-long-range-uhf-rfid-sensors/ Apparently "ultra long range" is 20+ feet, is that good enough? Been a LONG time since I've messed with this stuff. We used "long range" passive RFID when I worked at the (now closed) San Onofre Nuclear Generating Station. "long range" back then meaning a couple of feet, so that workers could just walk through a portal without having to scan a card, use a fob, etc. (FWIW was not for access control but as one aspect of exposure monitoring - they still had to show a bade to a guard!) I think there were portals in various places within the Red Zone to monitor when workers entered/left certain areas so that their time in the area could be tracked. Edited January 23, 2017 by jtara92101
KeviNH Posted January 23, 2017 Posted January 23, 2017 If your car has a USB port designed to work with Apple music players, maybe just get a cheap used iPod touch and leave the wifi turned on?
sdynak Posted January 23, 2017 Posted January 23, 2017 Thanks for the thoughts.. Yeah.. it is a 2005 Honda Civic.. only technology it has is a 3.5mm input jack .. She loves this car and has no interest in replacing it LOL. Some good thoughts.. The iPod is a possibility. Would be good to have something that doesn't need to be powered on & off manually. I'll look into some of the other suggestions.. Really appreciate the suggestions. You guys really rock.. Nothing you can't do here. I bet if we wanted to launch a rocket in our backyard the folks here could put it together .. Best,Stan
jtara92101 Posted January 23, 2017 Posted January 23, 2017 (edited) An iPhone 4S (as well as certain iPad/iPad Mini models and iPod Touch 5G or later) or later can be used as an iBeacon. Really only meant as a convenience for developer testing. https://blog.passkit.com/configure-iphone-ibeacon-transmitter/ There are a few App Store apps available to do this, as well as sample code if you want to build yourself. Here's one. I haven't vetted it. https://itunes.apple.com/us/app/locate-beacon/id738709014?mt=8 https://itunes.apple.com/us/app/ezbeacon/id842580782?mt=8 Edited January 23, 2017 by jtara92101
sdynak Posted January 23, 2017 Posted January 23, 2017 An iPhone 4S or later can be used as an iBeacon. Really only meant as a convenience for developer testing. https://blog.passkit.com/configure-iphone-ibeacon-transmitter/ Hmm.. Interesting.. This made me also think another iphone with mobilinc on it could serve as what I'm looking to do simply.. Just leave that device in the car.. Does it need cellular service to utilize geofence?
sdynak Posted January 24, 2017 Posted January 24, 2017 Well thinking about an extra iphone even if the cellular service is not needed to support geofence itself relying on wifi I think would be limited in distance to trigger the variable state in time to be pulling in while the door was opening. Thinking
themlruts Posted January 24, 2017 Posted January 24, 2017 You can use the "-x" option (e.g. "bash -x scriptname" or at "set -x" near the top of the script) to run the script with tracing so it shows you execution progress as it runs, this will often show where things are going off the rails. Kev Thanks I am idiot. It was taking the exit of echo i had right before the if. Mike
themlruts Posted January 24, 2017 Posted January 24, 2017 No my only problem is how to keep my wife's iphone connected to wifi when it sleeps. Anyone come across this? I wish I could send a wake packet.
themlruts Posted January 24, 2017 Posted January 24, 2017 I just ran a test. I put her phone to sleep. Waited for the wifi to disconnect. I sent a push notification and it wakes it and connects to wifi.
jtara92101 Posted January 24, 2017 Posted January 24, 2017 Well thinking about an extra iphone even if the cellular service is not needed to support geofence itself relying on wifi I think would be limited in distance to trigger the variable state in time to be pulling in while the door was opening. Thinking If you are opening a door, I'd think you have the OPPOSITE problem. You WANT a limited distance. I'd think you wouldn't want to open the garage door while blocks away. Does your garage door take an extraordinary amount of time to open?
sdynak Posted January 24, 2017 Posted January 24, 2017 (edited) If you are opening a door, I'd think you have the OPPOSITE problem. You WANT a limited distance. I'd think you wouldn't want to open the garage door while blocks away. Does your garage door take an extraordinary amount of time to open? Yeah.. not blocks for sure but maybe when starting to come down the road so it is opening or almost open when she approaches it. If it isn't she is the type that would get frustrated and just do it with the remote so anything else would really not work for her and I'd be chasing my tail to make it work.. .. This is why I want it to trigger for that car only as she is really the only one that uses it and it sits in the garage otherwise. Even if it were blocks away I know that car is coming home and going in the garage at any moment Edited January 24, 2017 by sdynak
KeviNH Posted January 24, 2017 Posted January 24, 2017 Yeah.. not blocks for sure but maybe when starting to come down the road so it is opening or almost open when she approaches it. If it isn't she is the type that would get frustrated and just do it with the remote so anything else would really not work for her and I'd be chasing my tail to make it work.. .. This is why I want it to trigger for that car only as she is really the only one that uses it and it sits in the garage otherwise. Even if it were blocks away I know that car is coming home and going in the garage at any moment Perhaps look at the problem from the other direction? A beacon or other mechanism detects if her car is already in/near the garage. Geofence application on her phone (e.g. IFTTT) triggers an event when she enters the immediate area. So if her phone enters the area, and her car isn't already in the garage, then open the garage door.
sdynak Posted January 24, 2017 Posted January 24, 2017 Perhaps look at the problem from the other direction? A beacon or other mechanism detects if her car is already in/near the garage. Geofence application on her phone (e.g. IFTTT) triggers an event when she enters the immediate area. So if her phone enters the area, and her car isn't already in the garage, then open the garage door. Very interesting thought.. now to think what that device could be.. quite a few options on how to do this.. simple is always better. Almost thinking of some kind of magnetic or IR sensor. Cheers, Stan
KeviNH Posted January 24, 2017 Posted January 24, 2017 Very interesting thought.. now to think what that device could be.. quite a few options on how to do this.. simple is always better. Almost thinking of some kind of magnetic or IR sensor. Cheers, Stan I was thinking of doing the "hang a tennis ball from a string" parking aid, but using a triggerlinc.
sdynak Posted January 24, 2017 Posted January 24, 2017 I was thinking of doing the "hang a tennis ball from a string" parking aid, but using a triggerlinc. That is pure genius!! I'm ordering one now.. This solves the whole parking spot dilemma also.. there is a fridge right in front of her car and she always pulls up too close.. Thank you all for all your suggestions.. will keep you posted how this works out Cheers, Stan
jtara92101 Posted January 24, 2017 Posted January 24, 2017 (edited) That is pure genius!! I'm ordering one now.. This solves the whole parking spot dilemma also.. there is a fridge right in front of her car and she always pulls up too close.. So, install a microswitch behind the fridge. When the fridge tips back, it will close the switch, sending a signal that she has parked! OK, seriously - gated parking garages in condos, commercial buildings, etc. usually/always (code, safety, stuff like that...) have a coil of wire buried in the concrete that will detect a car passing over it, and open the door to allow a vehicle to exit. (In my building, we keep a weight plate near each door to place over the coil for the garbage ma.... er, waste removal technician, for moves, etc.) Maybe you don't want to hack away at your concrete. But I'd imagine you can do something with a coil under some sort of mat, etc. In lieu of a commercial system, there is this: http://hackaday.com/2014/04/04/building-an-inductive-loop-vehicle-detector/ Note the above (in comments sections) also discusses surplus detectors that can be picked up very cheaply. It won't solve the refrigerator problem, but at least it will provide a reliable presence detection. Actually, maybe it could solve the refrigerator problem. Would need two inductive loops. Would need some experimentation with placement of the forward loop, and might be difficult to make it work reliability with multiple vehicles. (Different sized hunks of metal over the loop...) You could flash a light, sound a buzzer, etc. just like in the automatic car wash. Another approach - there are loads of non-contact gadgets available that will solve the refrigerator problem - high-tech (or low-tech) alternatives to the tennis ball on the string. Just find one that has a relay output. On the other-other hand, I don't know that it's a good idea to ENCOURAGE pulling up all the way until the alarm sounds. Unless you have the OPPOSITE problem (door closing on trunk.) So perhaps best to separate the concerns of presence and position. For a complete solution, you could use 3 sensors, of whatever type (inductive, optical, whatever). Edited January 24, 2017 by jtara92101
sdynak Posted January 24, 2017 Posted January 24, 2017 So, install a microswitch behind the fridge. When the fridge tips back, it will close the switch, sending a signal that she has parked! OK, seriously - gated parking garages in condos, commercial buildings, etc. usually/always (code, safety, stuff like that...) have a coil of wire buried in the concrete that will detect a car passing over it, and open the door to allow a vehicle to exit. (In my building, we keep a weight plate near each door to place over the coil for the garbage ma.... er, waste removal technician, for moves, etc.) Maybe you don't want to hack away at your concrete. But I'd imagine you can do something with a coil under some sort of mat, etc. In lieu of a commercial system, there is this: http://hackaday.com/2014/04/04/building-an-inductive-loop-vehicle-detector/ It won't solve the refrigerator problem, but at least it will provide a reliable presence detection. LOL... this is great.. I may have more success with the fridge switch than the triggerlinc.. shame if it is my floor was just redone after raising the home from Sandy but you bring up another good option of a device such as a pressure mat or like the loop.. You guys really rock.. So when do we start building rockets?
sdynak Posted January 24, 2017 Posted January 24, 2017 (edited) So, install a microswitch behind the fridge. When the fridge tips back, it will close the switch, sending a signal that she has parked! OK, seriously - gated parking garages in condos, commercial buildings, etc. usually/always (code, safety, stuff like that...) have a coil of wire buried in the concrete that will detect a car passing over it, and open the door to allow a vehicle to exit. (In my building, we keep a weight plate near each door to place over the coil for the garbage ma.... er, waste removal technician, for moves, etc.) Maybe you don't want to hack away at your concrete. But I'd imagine you can do something with a coil under some sort of mat, etc. In lieu of a commercial system, there is this: http://hackaday.com/2014/04/04/building-an-inductive-loop-vehicle-detector/ Note the above (in comments sections) also discusses surplus detectors that can be picked up very cheaply. It won't solve the refrigerator problem, but at least it will provide a reliable presence detection. Actually, maybe it could solve the refrigerator problem. Would need two inductive loops. Would need some experimentation with placement of the forward loop, and might be difficult to make it work reliability with multiple vehicles. (Different sized hunks of metal over the loop...) You could flash a light, sound a buzzer, etc. just like in the automatic car wash. Another approach - there are loads of non-contact gadgets available that will solve the refrigerator problem - high-tech (or low-tech) alternatives to the tennis ball on the string. Just find one that has a relay output. On the other-other hand, I don't know that it's a good idea to ENCOURAGE pulling up all the way until the alarm sounds. Unless you have the OPPOSITE problem (door closing on trunk.) So perhaps best to separate the concerns of presence and position. For a complete solution, you could use 3 sensors, of whatever type (inductive, optical, whatever). You Sir have a great sense of humor and a problem solver.. Awesome Mix .. Do we dare getting into the challenges of grabbing a beer out of the fridge when the car is too close? Edited January 24, 2017 by sdynak
sdynak Posted February 1, 2017 Posted February 1, 2017 Ok.. so between craziness at work and my first attempt at using string for this failed I got back into it with a new design that I feel will be reliable for the triggerlinc but I ran into a program snafu I think.. So with the program set like this every time the garage door closes it comes right back up as the geofence is not reset yet and the program runs I assume with the garage door status change.. Maybe I can eliminate the garage door status but thinking there may be another way to do it? If I eliminate the garage door status then it would close if it were open so don't really want that to happen. Any thoughts? I'll share the physical prototype setup as soon as I get this working properly. Program reads: if the geofence is within range and the car is not in the garage and the garage door is closed then open it.. Garage Door Auto Karyn - [iD 0036][Parent 0001][Not Enabled] If $Karyns_iPhone_New Geofence is 1 And ( Status 'Car In Garage Karyn-Opened' is Off And Status 'Garage Door Status' is On ) Then Set 'Garage Door Opener' On Else - No Actions - (To add one, press 'Action') Thanks,Stan
KeviNH Posted February 1, 2017 Posted February 1, 2017 (edited) So with the program set like this every time the garage door closes it comes right back up as the geofence is not reset yet and the program runs I assume with the garage door status change.. Maybe I can eliminate the garage door status but thinking there may be another way to do it? If I eliminate the garage door status then it would close if it were open so don't really want that to happen. Any thoughts? Program reads: if the geofence is within range and the car is not in the garage and the garage door is closed then open it.. You can do this with a separate program. I moved "Open Starboard Garage Door" into a program of it's own, which opens the door, updates a variable, writes a log, etc. This program gets called from anything that wants to open the door. Then I made a program to track if the garage door opening program ran recently: Starboard Garage Door was opened within 15m - [ID 00E2][Parent 00E1] If From Last Run Time for 'Open Starboard Garage Door' To Last Run Time 'Open Starboard Garage Door' + 15 minutes (same day) Then Wait 15 minutes and 1 second Else - No Actions - (To add one, press 'Action') Now you can add an additional condition to any program which wants to open the garage door, like this: And Program 'Starboard Garage Door was opened within 15m' is False The condition is False if that garage door was not opened in the last 15 minutes. Edited February 1, 2017 by KeviNH
sdynak Posted February 1, 2017 Posted February 1, 2017 Thanks Kevin.. I started to also write another program that changed a new geofence variable once the triggerlinc goes off.. I decided to make a geofence variable just for the garage door as I use the 1st one for the door lock so don't want that to conflict and not work. Between this and your suggestions I'm confident we can get this working .. I like the way yours is written better.. had to jump on a late night conference call for work so will test things out shortly and report back. Much appreciated Cheers,Stan Garage Car Var Change Copy - [iD 0038][Parent 0001] If Status 'Car In Garage Karyn-Opened' is Off Then $Karyns_iPhone_Garage Auto Door = 1 Else - No Actions - (To add one, press 'Action')
Recommended Posts