Yes I missed it
Seems to be perfect then, everything is covered!
Yes I missed it
Seems to be perfect then, everything is covered!
As an aside, how did you get the colour in your code snippet? (Should I know this??)
That’s just the way it comes out. I format code snippets using the “three back-ticks” before and after technique, and normally I don’t use a format descriptor (like python, etc.)
```
xxx
```
I don’t know if this is useful. I’m only posting this for your information if it is, but I got an error today (no apparent consequences for me but it might be something you want to know about)…
2019-01-19 11:23:05 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/device_tracker/composite.py", line 269, in _update_info
attrs = {ATTR_TIME_ZONE: tzname or STATE_UNKNOWN}
NameError: name 'STATE_UNKNOWN' is not defined
Thanks. Should be fixed now in b3.
Opinions requested:
I’m looking for feedback on a side effect of the new feature I’m adding that determines time zone from the GPS coordinates and enables reporting time in that time zone. The issue is the size of additional Python packages required to make these determinations. Since I’m adding these features to my Life360 custom platform as well, it has the same issue. Please see this corresponding post for details. If you have any feedback, please comment in that topic so the conversation can be in one place. Thanks!
Released 1.7.0
Add time_as
option to control time zone in which time attributes are displayed, and possibly add new time_zone
attribute with the name of the time zone in which the device is located.
BREAKING CHANGE from earlier beta releases: time_as
option replaces times_as_local
& times_as
. Choices for time_as
are now: utc
, local
, device_or_utc
and device_or_local
.
See full documentation for details.
Hi,
Under 86.x it seems that the binary_sensor and a router sensor is no longer properly factored in. I often have it being the correct enter/exit sensor but it seems the composite sensor hangs onto the IOS app location even if it’s slow to update.
So what was working really nicely seems to have deteriorated slightly.
Any ideas why?
I can’t imagine how the composite tracker’s behavior could have changed due to an update in HA. By design, when a GPS tracker has been seen, all router and binary_sensor entities will no longer change the composite entity from home. To put that another way, once a GPS based tracker has been seen (no matter how long ago), only the home/on states of router trackers and binary_sensors will be used. That hasn’t changed.
And there was quite a bit of discussion around this behavior. But, it was mostly centered around router trackers. Maybe it does make sense for a binary_sensor’s off state to change the composite entity’s state. Unfortunately, I’m not sure what to change it to, especially if the composite already has GPS coordinates. It’s easy to use the home zone’s coordinates when a router changes to home, or a binary_sensor changes to on, but what do you do when a binary_sensor changes to off? Do you just change the state to not_home and throw away the GPS data? This might require a bit more thought.
Anyway, I’m still on 0.84.6, so I suppose it is possible some change in 0.85.x or 0.86.x has had an effect, but my guess is the change you’re seeing is more related to the binary_sensor and/or router tracker.
If you can provide more details of what’s happening with the “input” devices and exactly how the composite is responding, and how you think it should, that would be helpful. Otherwise, not sure what to tell you.
I’m digging but it appears to be related to the iOS app now ignoring iBeacon exits.
I suspect that because the iOS tracker is not properly updating on home zone exit it’s a ripple effect and not the fault of the composite tracker.
So this means my HomeKit enter/exits are more critical as they become the next most foolproof leaving the home zone indicator.
If you want to let the binary_sensor’s ‘off’ state change the composite to not_home, then you can try changing this code (at line 213):
if not self._use_non_gps_data(state):
return
to:
if (source_type != SOURCE_TYPE_BINARY_SENSOR and
not self._use_non_gps_data(state)):
return
I haven’t tested this, but in theory it should work. If you do try it, let me know how it goes and if it helps.
Hi, I am having trouble to get the tracker working. I am using NMAP and Life360 trackers combined but as soon as my iphone goes to sleep it disconnects from wifi and composite tracker goes to ‘not_home’ mode. Am I missing anything or this is the default behavior? Here is my device tracker looks like.
- platform: nmap_tracker
hosts:
- 192.168.10.111 #iphone7
interval_seconds: 60
- platform: life360
username: !username
password: !password
prefix: life360
show_as_state: driving, moving, places
driving_speed: 18
max_gps_accuracy: 200
time_as: device_or_local
max_update_wait:
minutes: 45
- platform: composite
name: my_composite
entity_id:
- device_tracker.life360_user1
- device_tracker.iphone7_nmap
time_as: local
And following logbook entries include nmap, composite tracker and automations.
Logbook Showing entries for
January 27, 2019
9:40 PM
Notify Person State has been triggered
9:40 PM
User1 Status changed to Just Left
9:40 PM
user1 home turned off
9:40 PM
Mark person as just left has been triggered
9:40 PM
User1 Away has been triggered
9:40 PM
user1 composite is away
9:40 PM
USER1 NMAP is away
Thanks
If the entity_id device_tracker.life360_user1 isn’t correct (misspelled, whatever), or if it has not been seen since HA restarted, then when device_tracker.iphone7_nmap changes to not_home, so will the composite tracker. It would be helpful to know the history of device_tracker.life360_user1, device_tracker.iphone7_nmap and device_tracker.my_composite. E.g.:
grep 'new_state=<state device_tracker\.[^>]*' home-assistant.log -o
There will be sensitive data (such as GPS coordinates), so you probably won’t want to share all of it, at least not here. If you’re not sure how to interpret it, feel free to send it to me via private message.
I think you are right about it. I was playing around with few automations and between HA restarts, it may have lost its life360 status. Which might have caused false positive on composite tracker. I will keep an eye on logbook for few more days and monitor the behavior. Thanks for an awesome component. I was really tired of owntracks delayed/missed reporting and trying to find an alternative. Hopefully search is over!
hi, im using this composite tracker to combine 3 device trackers, 2 gps based and 1 is network based.
is it possible to add picture to this composite tracker if i want to use it as a main device tracker same like we get for default device tracker and display in badge?
There is a new feature released in 0.88:
I haven’t looked at the details, and I’m still on 0.84.6, so I can’t really try it. But I’m interested in hearing if people think this new component would take the place of my custom component.
I just saw this. I’ve been using your custom component and it works very well. I will test this out to see how it works.
I’ve only recently started using your component. Works well for my needs.
This new Person platform seems to be almost the same thing, but with a few extra built in features for HA to use. Guess it will work with the new Areas platform from the last release.
At first glance, it doesn’t show GPS accuracy, battery level, the list of devices, or source type. Everything else is there.
As has been discussed, starting with HA 0.86, the folder layout in custom_components has changed. I’ve recently updated the installation instructions. custom_components.json (which is used by Custom Updater) has also been updated to be compatible with the new layout.
Then just follow the recently updated installation instructions
Then you need to manually move/rename the file. The following Linux commands (or similar) should make the necessary changes:
# From config folder
cd custom_components
sudo -u homeassistant mkdir composite
sudo -u homeassistant mv device_tracker/composite.py composite/device_tracker.py
Then you’ll need to update the following line in your configuration for custom_updater. Change:
component_urls:
- https://raw.githubusercontent.com/pnbruckner/homeassistant-config/master/custom_components.json
to:
component_urls:
- https://raw.githubusercontent.com/pnbruckner/homeassistant-config/master/custom_components_old.json
Once you update to HA 0.86 or later you should change it back.
Then you should be good to go. Just use the Custom Updater to install and/or update.
Note: You may need to clean up the old files after you install/update, if you care.