The android app and the ability to coordinate having multiple phones outside the fence to activate a change, for example, to an “away” schedule is a great feature. Thing is though that the geofence implementation in the android app has proven to be less than prompt or reliable.
I switched to using EgiGeoZone and http messages and that works great (for one phone). My entry/exit happens in precisely the same place on the road leaving or returning to my house every day. Not sure what they do differently, but that app really has nailed the geofence triggering. I have so far though found no way to coordinate multiple phones using EgiGeoZone with BlueIris.
I have an idea of one way and perhaps this might hopefully trigger a discussion on other ways as well.
What if I used the DIO states as a sort of flags and assign a different DIO to each phone. When exiting the geofence, EgiGeoZone could send an http message to set the DIO and similarly when returning, clear the DIO. Now the question becomes “Can I switch to my ‘away’ schedule based on an AND condition of two (or more) DIO states being true. And similarly switch back to my ‘at-home' schedule when the AND condition is not true?
Thanks in advance for advice and a look so alternative ideas.
Towards a better multi-phone geofence
Re: Towards a better multi-phone geofence
I don't use it, as I have Geofencing working from Homeseer with HSBuddy. Home automation with geofencing has many more possibilities, including Alexa saying "Tim is nearly home", and the ability to add multiple locations. Multiple users are a piece of cake
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
Problem ? Ask and we will try to assist, but please check the Help file.
Re: Towards a better multi-phone geofence
@TimG
Does that address the multi-phone objective I am trying to achieve?
Does that address the multi-phone objective I am trying to achieve?
Re: Towards a better multi-phone geofence
It means you can do anything you like with as many users and phones as you like. Homeseer is however quite expensive. I haven't looked into doing the same with Home Assistant, but I can be sure they have a solution too. Do you have a spare Raspberry Pi (And a lot of time !) ?
I use MQTT for comms between BI5 and HS4, and it does things like allowing CPAI confirmed "Person" Alert turns drive lights ON, but passing cars don't. The combination of BI5 and home automation will literally open doors for you
I use MQTT for comms between BI5 and HS4, and it does things like allowing CPAI confirmed "Person" Alert turns drive lights ON, but passing cars don't. The combination of BI5 and home automation will literally open doors for you
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
Problem ? Ask and we will try to assist, but please check the Help file.
Re: Towards a better multi-phone geofence
@TimG
I could probably cobble something up with Node Red to accept inputs from EfiGeoZone but was really hoping to keep it more self-contained within BlueIris. Re doing it in BI, once I figure out how to get DIO states to trigger schedule changes, it would be relatively trivial.
I could probably cobble something up with Node Red to accept inputs from EfiGeoZone but was really hoping to keep it more self-contained within BlueIris. Re doing it in BI, once I figure out how to get DIO states to trigger schedule changes, it would be relatively trivial.
Re: Towards a better multi-phone geofence
Here is how I did it with Node Red (which I already had running on a Raspberry Pi server)
Here's the http in: Method: GET URL: /geofence
Here's Process Geofence:
http response is just Status Code: 200
CheckHomeStatus and PrepareURL function is:
and finally, the http request... Method: GET and ***LEAVE THE URL BLANK*** (that last part may not be obvious) Payload: ignore.
Then the messages that EgiGeoFence sends would look like these, for example:
This solution could easily be expanded for as many phones as needed.
And it works a zillion times better than the geofencing in the BI Android app
Code: Select all
http in -> Process Geofence Function -> http response
|
|->CheckHomeStatus and PrepareURL function -> http request -> debug (optional)
Here's the http in: Method: GET URL: /geofence
Here's Process Geofence:
Code: Select all
const phone = msg.req.query.phone;
const fence = msg.req.query.fence;
if (phone && fence) {
const isEntering = fence.toLowerCase() === 'entering';
const isExiting = fence.toLowerCase() === 'exiting';
if (isEntering || isExiting) {
const atHome = isEntering;
flow.set(phone, atHome);
msg.payload = {
status: 'success',
message: `${phone} is ${fence} the geofence`,
value: atHome
};
} else {
msg.payload = {
status: 'error',
message: 'Invalid fence value. Must be "entering" or "exiting".'
};
}
} else {
msg.payload = {
status: 'error',
message: 'Missing phone or fence parameter'
};
}
return msg;
CheckHomeStatus and PrepareURL function is:
Code: Select all
function checkHomeStatusAndPrepareURL() {
const jillAtHome = flow.get('Jill') || false;
const peteAtHome = flow.get('Pete') || false;
let schedule;
if (!jillAtHome && !peteAtHome) {
schedule = 'Away';
} else {
schedule = 'Day_Night';
}
const baseUrl = 'http://10.123.123.123:81/admin';
const params = `schedule=${encodeURIComponent(schedule)}&lock=2&user=USERNAME&pw=PASSWORD3`;
msg.url = `${baseUrl}?${params}`;
return msg;
}
return checkHomeStatusAndPrepareURL();
Then the messages that EgiGeoFence sends would look like these, for example:
Code: Select all
http://10.222.222.222:1880/geofence?phone=Pete&fence=entering
http://10.222.222.222:1880/geofence?phone=Pete&fence=exiting
http://10.222.222.222:1880/geofence?phone=Jill&fence=entering
http://10.222.222.222:1880/geofence?phone=Jill&fence=exiting
And it works a zillion times better than the geofencing in the BI Android app
Re: Towards a better multi-phone geofence
Well done. I must admit I found Node Red to be a step too far for my old brain
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
Problem ? Ask and we will try to assist, but please check the Help file.
Re: Towards a better multi-phone geofence
@TimG
Node Red does take some getting used to and it seems like I start anew each time I do something with it. But... I have Cursor for software development and chatGPT-4.0 seems to be pretty good and writing Node Red functions. So...I had "help".
Node Red does take some getting used to and it seems like I start anew each time I do something with it. But... I have Cursor for software development and chatGPT-4.0 seems to be pretty good and writing Node Red functions. So...I had "help".