Proximityfunction

I now use the function in app to determine if cellphone is home or away. It seems to take some extra battery.
How about the option of wifi-Detection?
If status of connection to wifi changes it check if the wifi connected is ssid you put in. Then if it is, setting the state to choosen state. i.e “work”, “home” etc.
Same way, if status changes and now hasn’t got connection to wifi, setting other state.
When waiting for change in wifi-state, the cellphone has minimal batteryconsumption.
Cheers.

You mean the companion app should expose what wifi you are connected to?
It already does.

Not sure I understand what this request is about

Ok. How? If I set up an area at local store, and want my wife phone to say when she is there, this isn’t with wifi. This function uses location.
What I mean is that if the cellphone is connected to a specific wifi, say that the store has free wifi that the phone connects to, saved wifi, then it reports that she is in the store, but not with “location” as this takes more battery.
Did I explain it better? (English is not my native language.)
Cheers, (and Thank you for answering me.)

Yes. Do you have the Home Assistant app installed?
Do you have remote access to your Home Assistant?

When both of the answers is yes then it’s easy.

1 Like

I don’t think this will have an appreciable effect on the issue with battery usage, but here is a snippet of an automation I use for a device that doesn’t have cellular service…
This combines the use of a custom device_tracker, defined zones, and the device_tracker.see service

alias: Presence - Tablet SSID (location)
description: >-
  Sets location status of device_tracker.djft8_ssid based on the name of the
  network the tablet is connected to.
trigger:
  - platform: state
    entity_id: sensor.djft8_wifi_connection
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: sensor.djft8_wifi_connection
            state: saranam
        sequence:
          - service: device_tracker.see
            data:
              host_name: FTablet SSID
              location_name: 'Saranam'
              dev_id: djft8_ssid
      - conditions:
          - condition: state
            entity_id: sensor.djft8_wifi_connection
            state: HOME-JK
        sequence:
          - service: device_tracker.see
            data:
              dev_id: djft8_ssid
              host_name: FTablet SSID
              location_name: home

That state variable in each condition is the SSID that the companion app reports, and the location_name in the service call is the name of the zone you have defined in Home Assistant.

There are more compact ways to accomplish the same thing using templating and variable, but I never got around to doing that with this automation.

1 Like