Is my car home? - Geofence

Posted on
Sat Apr 17, 2021 5:27 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Is my car home? - Geofence

What's the preferred Indigo Geofence solution? I'd like to check to see if my car is not in the garage (and not moving) to lock the doors if they aren't locked. I have lat / long - how do I Indigo Geofence ?

Posted on
Sat Apr 17, 2021 7:53 pm
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: Is my car home? - Geofence

when the car is far enough away ( distance to house > accuracy of car position ) you could do a simple trigger. if it is parked in front of the garage its likely not precise enough.

there you could add a proximity sensor inside the garage looking at the garage door:
if dict > 5 m garage door is open
if dist > 10m car is not in front of garage.

there are several proximity sensor solution you can use that can go to 20+m.
in addition there is a rotating proximity sensor (lidar) that gives you a complete view of any object in 360d. They can go up to 50 meter.
they can give
door is closed
car shaped object is in the garage
car shaped object is outside the garage .. half way in ..
I tried that one with pibeacon and the lidar sensor and that works. Reaction time is < 1 secs and pretty accurate. you actually id the front part of the car.

Karl

Posted on
Sat Apr 17, 2021 7:57 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Is my car home? - Geofence

This won't work in my garage. Kids int he neighborhood play in the garage.

Posted on
Sat Apr 17, 2021 8:30 pm
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: Is my car home? - Geofence

The lidar can distinguish between a person and a car. And if there is movement and how big the object is and direction too: left / right / towards / away

It takes 2-10 snapshots per second and > 400 points( directions ) = resolution is better than 1 degree.


Sent from my iPhone using Tapatalk

Posted on
Sun Apr 18, 2021 2:41 am
Sevilsivle offline
Posts: 122
Joined: Jan 11, 2013

Re: Is my car home? - Geofence


Posted on
Sun Apr 18, 2021 7:59 am
juntta offline
Posts: 143
Joined: Oct 13, 2014
Location: Finland

Re: Is my car home? - Geofence

Does your car have Wi-Fi and do you have UniFi AP’s? Karl UniFi plugin detects BMW wifi easily when car is closeby!

Posted on
Sun Apr 18, 2021 9:32 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Is my car home? - Geofence

I can try that but it won't work when the car isn't on. I found a solution, now trying to figure out how to run Python 3.8 in indigo :)

Posted on
Sun Apr 18, 2021 8:59 pm
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: Is my car home? - Geofence

... and pibeacon has a car device model

It needs
1 beacon in USB port
1 aaa battery powered beacon in car
1 beacon on each key chain( up to 3)

With these beacons it can determine motor on/off: car present/ away and from the time sequence of events:

each car devices has the dev state:
Home motor off
Home motor on
Leaving
Left
Arriving
Home motor on
Home motor off

Karl


Sent from my iPhone using Tapatalk

Posted on
Mon Apr 19, 2021 12:04 am
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Is my car home? - Geofence

Hi (putting this out there for completeness)

Another option is using AI image recognition to change action run.

With BlueIris and Deepstack plugin, this is standard usage.

Admittedly do need Camera covering Garage (I have a couple in mine)

Some trigger eg. Motion triggered -> Deepstack plugin check for Car -> Yes or No -> different action groups run depending on result. Additionally could check for person present

Works really well, also covers any car rather than just one car..,.

Glenn


Sent from my iPad using Tapatalk

Posted on
Mon Apr 19, 2021 7:11 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Is my car home? - Geofence

I wound up using a Python geofence to check if my car is inside the fence. The BMW Connected plug-in return lat long every few minutes.

But, with the AI image recognition, could I tell whether my Alarm is armed (red vs green indicator light) ?


Sent from my iPhone using Tapatalk

Posted on
Mon Apr 19, 2021 3:05 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Is my car home? - Geofence

ryanbuckner wrote:
I wound up using a Python geofence to check if my car is inside the fence. The BMW Connected plug-in return lat long every few minutes.

But, with the AI image recognition, could I tell whether my Alarm is armed (red vs green indicator light) ?
Sent from my iPhone using Tapatalk


Hi,

Something that simple probably doesn’t need AI. Although could train it for anything.

Just a snapshot of current camera image and Color of a certain pixel? Python Pillow image library I’m sure would do this. Issue may be red/green may change position? In which case could probably do a broad box with - is there green within?

Something like
From:
https://stackoverflow.com/questions/110 ... -using-pil
Code: Select all
im = Image.open('image.gif')
rgb_im = im.convert('RGB')
r, g, b = rgb_im.getpixel((1, 1))
print(r, g, b)
(65, 100, 137)


& for rectangle just set up a x and y loop checking every pixel.

Sent from my iPad using Tapatalk

Posted on
Mon Apr 19, 2021 4:08 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Is my car home? - Geofence

I think I could use that.

Posted on
Fri Apr 23, 2021 5:57 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Is my car home? - Geofence

By the way, this was my solution: It takes lat , long as inputs

Code: Select all
#!/usr/bin/python3
from shapely.geometry import Point, Polygon
import sys


def main():
    coords = [
        (39.008234937234256, -77.37684452531161),
        (39.00809324520176, -77.37627518191934),
        (39.00733602026089, -77.37671994280922),
        (39.0076547326009, -77.37724949835487)
    ]
    homeFence = Polygon(coords)

    arglat = float(sys.argv[1])
    arglong = float(sys.argv[2]) 

    bmw = Point(arglat, arglong)

    print("{}".format(bmw.within(homeFence)), file = sys.stdout)


if __name__ == "__main__":
    main()

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests

cron