Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating "Safe Space" #12

Open
coogle opened this issue Mar 7, 2023 · 7 comments
Open

Updating "Safe Space" #12

coogle opened this issue Mar 7, 2023 · 7 comments

Comments

@coogle
Copy link

coogle commented Mar 7, 2023

Any chance you'll figure out how to update the "Safe Place" and perhaps provide a service to a Home Assistant instance?

Use case: We travel a lot with our dog, and would like to update the address of our WiFi hotspot to match reality.

@RobertD502
Copy link
Contributor

Just to add some insight here: It would require a decent amount of work for the end user to utilize this feature if it was implemented.

When creating a new place the following request body is sent:

{
    "place": {
        "address": "address, city zip code",
        "latitude": latitude of the above address,
        "longitude": longitude of the above address,
        "name": "Name you are giving the place",
        "outline": [
            {
                "latitude": latitude of perimeter point 1,
                "longitude": longitude of perimeter point 1
            },
            {
                "latitude": latitude of perimeter point 2,
                "longitude": longitude of perimeter point 2
            },
            {
                "latitude": latitude of perimeter point 3,
                "longitude": longitude of perimeter point 3
            },
            {
                "latitude": latitude of perimeter point 4,
                "longitude": longitude of perimeter point 4
            }
        ],
        "shape": "polygon"
    }
}

Having to determine the lat and long of the address as well as the lat and long of the desired perimeter markers would take far longer than firing up the Whistle app and adding the place through it.

@coogle
Copy link
Author

coogle commented Mar 29, 2023

I don't think that's necessarily true. In my case I just want a square "safe space" that is centered on a given Lat and Long value, which could easily be calculated by adding/subtracting from the lat/long center to create a 4-cornered polygon. I agree this would be complicated if you intended on creating complex shapes.

@RobertD502
Copy link
Contributor

Wouldn't calculating it yourself take longer than using the app for this feature?

@RobertD502
Copy link
Contributor

Out of curiosity - If your dog is outside of a "Safe Place", but next to your hotspot, does the whistle device continue to use WiFi to connect to your hotspot or it immediately switches to a cellular connection?

@coogle
Copy link
Author

coogle commented Mar 29, 2023

So this is being used as part of Home Assistant in my RV -- my Home Assistant's aware of my RV's current GPS location, and I'd like to be able to seamlessly keep my Whistle's GPS safe box inline with those coordinates as I move from site to site. Yes, I could do this manually every time -- but I won't. It'd be nice to just create a little HA script that calculates the bounding box and updates Whistle to reflect the new safe area.

The way I have it set up now, which works okay is to have a single safe defined with the Wifi for that safe area as my RV's WiFi. This at least works to notify me if the pooch was to stray far enough that it could no longer connect to my WiFi in the RV (in which case, I get a "Warning Hercules is 1,883 miles away from home!" notification. But as far as Whistle is concerned when the Whistle is connected to the WiFi it thinks it is somewhere in Michigan defined by that site box.... while in reality I'm in Cali at the moment.

(I have a Pepwave WiFi 24/7 running in the RV, so not a hotspot)

@RobertD502
Copy link
Contributor

RobertD502 commented Mar 30, 2023

Got it. To clarify, when you and your dog are away from a defined safe place (with the whistle device still connected to your WiFi), the whistle app pushes a notification once the tracker loses connection to the WiFi network - meaning the whistle device continues to utilize wifi instead of cellular when outside of a safe place?

I ask because you could potentially utilize zones defined in Home Assistant instead of the whistle app to handle your notifications / not rely on the whistle app notifications. I added the option to utilize Home Assistant zones instead of predefined Whistle safe places in my integration a while back.

Edit: Just did a quick check on the Whistle app and defining the WiFi network wouldn't be possible through a service call in Home Assistant. To add a WiFi network to a safe place, the whistle app initiates a bluetooth connection to the device in order to send over SSID and credential details.

@coogle
Copy link
Author

coogle commented Mar 30, 2023

Got it. To clarify, when you and your dog are away from a defined safe place (with the whistle device still connected to your WiFi), the whistle app pushes a notification once the tracker loses connection to the WiFi network - meaning the whistle device continues to utilize wifi instead of cellular when outside of a safe place?

Correct.

I ask because you could potentially utilize zones defined in Home Assistant instead of the whistle app to handle your notifications / not rely on the whistle app notifications. I added the option to utilize Home Assistant zones instead of predefined Whistle safe places in my integration a while back.

That's a thought I didn't considered, which would be to basically cut out Whistle's functionality all together and replace it with custom HA zones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants