I don’t understand how HACS is involved with writing the lovelace entries since the HACS install is for the integration, not the lovelace card? Or does this happen behind the scenes as part of the icloud3 integration through HACS?
Yes. The card resource has to be defined or you get the red box. So the UI looks for the card’s .js file in lovelace_resources.
now that I think about it, i’m super confused since how would it know where to reference the card in .storage/lovelace_resources
since i’m manually copying it after the integration is installed?
The integration, if successful, would have added that pointer for you.
Sorry I’m not following. The js card is in /config/custom_components/icloud3-event-log-card.js
after the integration is first installed, which isn’t where it needs to be, hence why you presumably copied it to /config/www/custom_cards/icloud3-event-log-card.js
.
If the integration set this up when it was first installed, how would it know to point to /config/www/custom_cards/icloud3-event-log-card.js
and not some other directory? (All over this thread is mention of people copying the card file to other folders, e.g. /config/www/
, /config/www/community/lovelace-icloud3
, etc)
And btw, i know the integration is running succesfully, as i added the device tracker config into configuration.yaml
and put my icloud creds. I have 2FA enabled, and when HA starts, I get a 2FA prompt from Apple, so I at least know it’s running and trying to login.
@GaryK Ok, I solved this! I hope this solves it for other people:
After you install the integration, you do need to go to Configuration in Home Assistant, then tap on Lovelace Dashboards, then on the very top, tap on “Integrations”. You then add a new integration with the path of wherever you copied the card:
@gcobb321 I’d suggest updating the docs to include this info.
I did not use HACS to install icloud3. I used the manual method. So, my card is in the custom_cards
directory as indicated in the installation instructions. I added the pointer to the raw configuration editor prior to the creation of the lovelace_resources file. When lovelace_resources
was created in an update sometime ago, the pointer was moved automatically. I don’t know where HACS put it. I assume HACS would have added the appropriate pointer to the lovelace_resources
file when you first installed it. If it didn’t add the pointer, it didn’t install correctly.
What do your icloud3 sensors say? Are they updating?
@GaryK Not sure if you saw my earlier msg, but I solved it: iCloud3 v2.1 Device Tracker-Advanced tracking features, iOS App monitoring
I already have my iphone tracked with the HA app and it’s mapped to device_tracker.me_iphone
. iCloud3 wants to also try to claim this name and create a new entity but it fails.
According to the docs, I thought I could use the IOS App Id Number
param and specify _ic3
to get the entities created with that suffix so they were unique (and I would know immediately that these devices belonged to the icloud3 integration).
In my config, I’m using Family Sharing method, and my config line for my device is as follows:
me_iphone > /local/images/me.png, _ic3
However, this doesn’t work as expected… in my icloud3 logs I see:
Determine IOS App version > 'device_tracker.me_iphone_ic3' not found in Entity Registry IOS App v1 will be used
My understanding is that icloud3 integration will create another device tracker for each device it’s tracking. Am I misunderstanding how the entities are created and how it’s supposed to be used?
@tmchow Actually, when you are tracking with iCloud3, iCloud3 needs to have the devicename without the suffix and the HA integration needs to have the devicename with the suffix. When iCloud3 starts, it reads the entity registry and searches for the device_tracker entity name you have assigned to the iOS App device that starts with the devicename on the track_devices parameter. It then gets the entity id# created for the device by the iOS App and finds the last_trigger entity. The _xx in the track_devices parameter is in case you have more than one iOS App devicename created for the same device because of multiple iOS App installs.
If, for example, your iOS App devicename is gary_iphone and the iCloud3 devicename is gary_iphone_ic3, iCloud3 will never find a device_tracker that starts gary_iphone_ic3 and you will get a no devices to track type of error. If, however, the iOS App is gary_iphone_iosapp and the iCloud3 entity is gary_iphone, it will find the gary_iphone_iosapp device_tracker and monitor that entity for zone enters/exits, state changes, etc.
So you are going to need to put the suffix on the iOS App entity and remove the suffix from the iCloud3 device_tracker entity to make it work. Since you probably have been using the iOS App (without the suffix) in automations and scripts, those same automations and scrips will now use the iCloud3 tracker entity instead. Since iCloud3 responds to state changes by the iOS App and iCloud, they should operate with minimal changes. There are some notes in the docs about using zone sensors for state changes rather than the device_tracker state because of incorrect state changes due to GPS wandering.
Thanks, I think I understand this better.
What I did to try to follow your instructions was to rename the devices in the HA App Integration and changing the names of our 2 iphones to:
me_iphone_iosapp
wife_iphone_iosapp
In the icloud3 config in configuration.yaml
I specified device names of me_iphone
and wife_iphone
which matches me and my wife’s device names in iOS settings (General > About).
When I restarted HA, in the iCloud3 event log card, for my phone I see this:
Tracking Devices > me_iphone(me_iphone_iosapp), wife_iphone(me_iphone_iosapp)
So no errors or warnings were thrown so it leads me to believe this is now setup correctly. But a few questions:
- I would’ve expected it now to have the
_iosapp
suffixes in the log and just sayme_iphone
andwife_iphone
. Why does it try to link/relate to the HA App created device trackers? I’m missing something. - In my entity registry, I see all the sensors related to my
me_iphone_iosapp
(andwife_iphone_iosapp
) like steps, activity, battery etc. Is the icloud3 integration supposed to also create entities like these or not? If so, I don’t see them there so something else must be wrong. If not, what entities are supposed to be created by icloud3? (am I supposed to still rely on those _iosapp entities if i want that type of info like hardware sensors other than location?)
@tmchow Glad the explanation cleared things up.
- The me_iphone and wife_iphone are the devicenames used by iC3 in all log items and what you should use in automations and scripts to track the devices.The me_iphone_iosapp and wife_iphone_iosapp entities are only used by iC3 to detect location triggers and zone triggers generated by the iOS App.
2.iC3 will not create or look at any of those entities. The iOS App will update them by itself. See the Sensors chapter in the iC3 docs here for a list of all the sensors created and updated by iC3.
You said you saw this in the Event Log:
Tracking Devices > me_iphone(me_iphone_iosapp), wife_iphone(me_iphone_iosapp)
Did you make a type on the wife_iphone. I would have thought you would see this:
Tracking Devices > me_iphone(me_iphone_iosapp), wife_iphone(wife_iphone_iosapp)
Yes, you’re right. it’s a mistake. What you said you expected is correct.
One suggestion I have is for you to change the logging to be more clear so it’s less confusing. Perhaps it should say this, at the cost of being more verbose:
Tracking Devices > me_iphone (triggers based on me_iphone_iosapp), wife_iphone (triggers based on wife_iphone_iosapp)
Some other doc suggestions:
- I was completely lost in the docs in discussion about the IOS App v1 vs v2. Suggest making this more clear what this app means.
- Additionally in the logging in the event log card, mentioning stuff like
Determine IOS App version >
device_tracker.me_watchnot found in Entity Registry IOS App v1 will be used.
is a little confusing. I think it’d be better to just state what is going on instead of mentioning “IOS App v1” - Not sure if you saw this, but there’s new instructions for getting the logging card working: iCloud3 v2.1 Device Tracker - iCloud3 v2.2 has been released (10/10/2020) - #390 by tmchow. This took me awhile to get right and the current instructions in the docs are out of date/incorrect.
@tmchow Thanks for the suggestions in the docs.
- v2.2.0, soon to be released and in the development directory, is the last version to support iOS App v1. It’s not been 8 months since v2 was released and I’ll be removing support for it in the next update.
- The purpose of that was to inform the user that some of the devices they were tracking was ios app v1 and others on v2. in case there was a set up error that needed to be fixed.
- I wrote the item you mentioned but haven’t looked at it in a long time. I’ll review it to make sure it is correct and current.
There is a log item in the Verify Devices section (v2.2.0) that says "iOS APP v2 Monitoring > device_tracker.me_iphone_iosapp, sensor.me_iphone_iosapp_last_update_trigger. The ‘me_iphone (me_iphone_iosapp)’ item was meant to be a summary of the device_tracker entities.
Glad you got it working.
I got the 2.2.0rc5 installed and working with 2FA with Family Sharing. Super slick! Thanks @gcobb321 for all your hard work!
Prior to iCloud3, I’ve been using the Person
feature and have a person created for myself and my wife. I added the entity device_tracker.me_iphone
and device_tracker.wife_iphone
to each of our Person configurations which relies on state changes.
However, in reading the iCloud3 documentation, the state change can be incorrect due to GPS drift and the order of HA mobile app updating the state before iCloud3. So the recommendation is to use the .zone
attribute since only iCloud3 updates it so it’ll always be accurate (e.g. device_tracker.me_iphone.zone
).
However, one issue with this is that the “Person” object in HA supports Entities only being tied to it for device tracking state chagnes, not attributes. Meaning I can connect Person.me
with entity device_tracker.me_iphone
but not device_tracker.me_iphone.zone
.
If my understanding is correct, it means that I shouldn’t use the Person.me
at all, and isntead have all my automations look only at device_tracker.me_iphone.zone
. Is this correct? Is there any automation or lovelace card state representation i won’t be able to do with this method? For some reason I recall that presence Lovelace cards rely on state changes, and not attributes but could be wrong.
@tmchow The device tracker state change due to gps wandering is related to the iOS app device tracker state. The iCloud3 state takes this into consideration to filter out incorrect zone changes. iCloud3 discards gps location changes that take the device out of a zone when no Zone Exit trigged was detected. the distance outside of the zone the location is also looked at and, if more than 2 or 2.5 times the zone radius, will not be considerate a gps wander and be accepted as a Zone Exit not detected.
So you should be able to use the device _tracker.me_iphone for what you want to do.
Regarding attributes, iCloud3 creates sensors for all of the device tracker attributes plus some that are not attributes. See the Sensors chapter in the docs. There are also a lot of example Lovelace card, automation and scripts in the docs and in sample files that w were included in the iCloud3 installation in the iCloud3 custom component directory.
I have not worked with the. ‘Person’ feature so I can not provide any help there.
Just to confirm my understanding:
You are saying that device_tracker.me_iphone
state is accurate because it’s managed exclusively by iCloud3, but device_tracker.me_iphone_iosapp
state is managed only by the HA iOS app (through the mobile app integration) and less accurate because of the issues you pointed out with HA iOS app detection.
@tmchow Yes. The iosapp drifts based on the iphone gps location. When it drifts out of the zone, it changes the state to not_home. iC3 looks for this and will discard that transction and keep the ic3 device_tracker in the zone.
Create an automation that triggers when the iosapp device tracker goes to not_home and another one to trigger when the ic3 device tracker goes not_home. Send a notification to the device when these events happen. Also look at the ha log for device tracker state changes.
If ic3 sees a state change trigger from the ios app (home to not_home), ic3 will discard it if there was no Geographic Region Exit trigger if it falls inside the zone*2.5 radius.
iCloud3 v2.2.0 Release Candidate 6 is now available here .
The new features are:
- Added an Event Log card version check. When iCloud3 starts, the version of the Event Log in the custom_components /icloud3 directory is compared to the Event Log in the www/custom_cards directory. If the version in the custom_components directory is newer, it will be copied to the custom cards directory and a message is displayed in the Event Log indicating that the Event Log was updated and the browser and the iOS App cache’s need to be cleared and refreshed. See the Change Log for more details.
Hi Gary,
“Person” is the new combined status for a person for Integrations that provide location. Been around for a while now, actually.
Basically it’s an “or” switch for flakey location detectors.
If someone uses an Integration that say, watches for the mobile device on the local LAN and also uses something like the HA official tracker, together, the “Person” registers “Home” (not “home” by the way, stuff like NodeRed is case-sensitive) whether either one shows that status.
It’s also heavily pushed as the way to detect people in the new-ish web-UI when making automation without touching YAML code. The base HA just grabs the main location status from the Integration, whatever the Integration is.
The handling of your different statuses also had me scratching my head pretty hard since not many Integrations aren’t using it now.
I have a Lovelace card with the Person, HA ios status, and your statuses, and due to being rural with horrid wandering I used to use Person to make things very locked to the local LAN when we are here. iOS location is just garbage at home, even with your nice tweaks. (I’ve seen our iOS devices go wandering hundreds of miles away at night when they’re asleep.) One of my LAN Integrations was also cancelled as a project a while back, so less data for Person to utilize.
Watching that card all sorts of weirdness happens with all of the statuses lately. My wife was mapped away at someone’s house today and ALL (including icloud3) were showing a “home” status.
It’s worth a good laugh anyway.
I’ll have to write custom logic both in HA and NodeRed (whereas the single “Person” built in handled it all before) to truly get good effect from icloud3. But it think your Integration is behaving better than anything else.
Interestingly I got a fun test tonight. My phone showed “stationary” on iCloud3 just north of my home by a half mile or so. By simply opening Google Maps and waiting for the dot to center on the house, then doing a refresh on the HA ios App to force a location send… instant “Home” on everything. The HA ios app needs to turn the GPS on longer and wait for accuracy number to come in, before recording the location. Similar logic to your app. It’s just doing a single snapshot of an inaccurate location and firing it to you. Bummer.
(Opening any driving app or GPS location app will pull the accuracy in after a few seconds.)
Anyway now that I know your “zone” is a lot more accurate than the status provided to the HA core via the Entity, that makes more sense and I can code around it. But it’ll be massively confusing to anyone setting up the Integration through HACS and expecting it to integrate with Person.
Hope that helps.