Hey there!
I sometimes offer friends to fetch things from our house. When I’m abroad, I give them access to my HA installation which allows to open the garage door (implemented using a Shelly Pro 2 PM) or unlock and unlatch the front door (implemented using a Nuki Smart Lock Pro 4.0). Both are directly connected to HA via MQTT.
So i give them the https address of my HA installation along with username and password and they can open the garage door or front door as they like.
What I want to make sure now is that they only can open the garage door or front door when they are physically at our house. So my idea is to give them the key for our guest WiFi and ask them to connect to the guest WiFi before accessing HA.
So I hoped for a variable containing the client’s IP address so that I could implement a condition in jinja2 that makes the lock elements only show up when that condition is true (=IP address of client matches the guest WiFi IP address range).
Does anybody have an idea on how to achieve this?
What I don’t want to do:
- Limit access to HA only to the guest WiFi. That would mean that I could not access HA from abroad.
- Ask my friends to install the HA app and create a tracker for each friend
- Use any HTML features to get the location from the browser. Location feature could be disabled in the browser, so this would not work in any case.
My goal is to get the IP address of the client. Does anybody have an idea how to achieve this?
Many thanks!
svenfried