As I wasn’t happy with the device trackers for nmap and bluetooth I now implemented something on my own with Tasker on my phone. I call a script from Tasker that sets a binary input when coming home and leaving (using Cell Near and Wifi Near). Seams to already work better as everything I tested before. My only problem now is: how can I show this input in the top row where the circles with the devices where before?
I give you the short tl;dr; version as I am still testing it. looks good though…
In HA
Create input_binary for all Android/Tasker Phones you want to track
(Optional) Create a group of them, let’s say “Inmates”
Create a script to switch these binary inputs from over the net (HA exposes the script by default over REST-API)
In Tasker
Create on one phone a Tasker Profile “At Home”
4 a) You are free to add tracking here as you wish. I did “Cell near + Wifi Near” as this should be easy on the battery as the docs state
4 b) For Cell Near be sure to Scan Cells also when calling somebody! And check “magnifying glass” for recent Cells you missed
As Entry-Task call your script with HTTP Post Action for Input A, State “home”
As Exit-Task call your script with HTTP Post Action for Input A, State “away”
Copy all this to the other Android devices and change the Input to B
Repeat 7) for all other devices
Hope this is ok as explanation. Else I am willing to do a post in the “My Projects” thread once I know for sure it is working for 99.9%
Those items in the ‘top row’ are sensors. So, all you need to do is link your device to a sensor. Your best option is a sensor template. Something like this:
that would create a template sensor that shows on/off in the top row.
This next example, I look at the state of a odd device that outputs 22 as an open door and 23 as a closed door. I don’t like seeing a sensor that has either 22/23, i want it to show Open/Closed. This is how I created this template sensor, which would go directly under my_top_row_sensor_1:
entry_door_hindge: # GARAGE ENTRY DOOR SENSOR #
value_template: >
{% if is_state('sensor.garage_door_access_control', '23') %}
closed
{% elif is_state('sensor.garage_door_access_control', '22') %}
open
{% else %}
closed
{% endif %}
so, you need to figure out where you are getting your away/home info from, then create a template sensor from that information.
Could you please post an example of one of your scripts? I have not worked with scripts but this seems like a very power part of HA that I need to learn.
Btw, the biggest problem atm is that the state may “bounce” as you walk away from home or come home.
So for example when leaving I get out and loose “wifi near” in the stairway, which switches to “away” but when I turn around the house I get “wifi near” again, through the windows I guess, and switch to “home”. Until I am far away when it switches to “away” for real.
I can live with that atm as I am only swirtching stuff on/off. but your milleage may vary.