'The YAML configuration is being removed' but iPhone Device Tracker no longer works if you delete the settings in the YAML files
- Hardware: Rpi4B 4GB
- Core: 2025.1.2
- Supervisor: 2024.12.3
- Operating System:14.1
- Frontend: 20250109.0
- iPhone Device Tracker: 2.4.0
The new iPhone Device Tracker 2.4.0 introduces the ability to configure via UI. Thanks for this great feature!
However, after installing version 2.4.0, if I delete the iphonedetect settings from 'configuration.yaml' and from 'device_tracker.yaml', upon reboot the four iPhones in our family disappear from Home Assistant.
If I restore the settings in 'configuration.yaml' / 'device_tracker.yaml' and then reboot, iPhone Device Tracker starts working again.
Below I transcribe the content of 'configuration.yaml' :
device_tracker: !include /config/includes/device_tracker.yaml
and of 'device_tracker.yaml' :
- platform: iphonedetect
scan_interval: 12
consider_home: 120
new_device_defaults:
track_new_devices: false
hosts:
hostname1: 192.168.178.**
hostname2: 192.168.178.**
hostname3: 192.168.178.**
hostname4: 192.168.178.**
Thank you for your kind attention and support
Same here
Hardware: Intel NUC Core: 2025.1.2 Supervisor: 2024.12.3 Operating system 14.1 Frontend 20250109.0 iPhone Device Tracker: 2.4.0
Hi,
I didn't think of using split configuration, looks like the import fails somehow.
Just to ask, you did restart HA after installing 2.4.0 and then deleted iphonedetect from config? Two restarts
The import should remove tracked devices from know_devices.yaml so that the entity can keep its name.
It worked for me by removing entities from the configuration.yaml before the restart and re-adding them in the UI
I tried installing 1.4.2 with a split configuration and after struggling with known_devices got it to work. Upgrading to 2.4.0 did work: entities were imported and remained after removing iphonedetect from YAML configuration. Weird!
I see you have "track_new_devices" set to False. What is the content, if any, in the known_devices.yaml file?
Thank you for this, it works great. Just an FYI, the entity ID's chang with the update. Is there a way to delete the "old" entities so that the new entities can be updated to reflect the old names (I have automations that use the old entities)
By entity ID do you mean the device_tracker.name changed to device_tracker.name_2 ? I was kind of hoping that the import from YAML should've handled that...
My automations are based on the Person Home/Away (they might have several device_tracker's) so didn't notice
Yes, exactly.
As far as I can tell the old names are preserved by still being in the known_devices.yaml file. Do you have other integrations using those?
After upgrading from the earlier version of iphonedetect and restarting, the YAML-configuration should be imported after HA has completely loaded. Then first remove the entries in known_device before creating the "new" entities allowing the name to be the same. Names are slugified though, so "My iPhone" becomes "my_iphone"
I didn't remove the known_devices first...can I delete that file completely now? I just want to get rid of the "old" entities as I can't delete them...
Yes, that should work fine. I would create a backup first, of the file content at least
I deleted known_device.yaml, but the old entities are still showing.....can't figure out how to remove them
Sorry to hear that raspman, don't know what's going on. Some other integration, like the HA app, that has the name?
If you can access /config/.storage and search for the names in the files there, maybe some hint might be found
It's gone now :) Maybe it just took some time..anyways, thanks again for the great service you provide!
Hi,
I didn't think of using split configuration, looks like the import fails somehow.
Just to ask, you did restart HA after installing 2.4.0 and then deleted iphonedetect from config? Two restarts
The import should remove tracked devices from know_devices.yaml so that the entity can keep its name.
First of all, thank you again for your work. About your question, I've installed 2.4.0, then I've deleted yaml configuration, then I've restarted HassOS
I tried installing 1.4.2 with a split configuration and after struggling with known_devices got it to work. Upgrading to 2.4.0 did work: entities were imported and remained after removing iphonedetect from YAML configuration. Weird!
I see you have "track_new_devices" set to False. What is the content, if any, in the known_devices.yaml file?
I didn't check this file after installing 2.4.0. Now its content is this below
{}
From a previous backup (2025.01.14) the content was:
hostname1:
icon: mdi:cellphone
mac: **:**:**:**:**:**
name: hostname1
#picture:
track: true
hostname2:
icon: mdi:cellphone
mac: **:**:**:**:**:**
name: hostname2
#picture:
track: true
hostname3:
icon: mdi:cellphone
mac: **:**:**:**:**:**
name: hostname3
#picture:
track: true
hostname4:
icon: mdi:cellphone
mac: **:**:**:**:**:**
name: hostname4
#picture:
track: true
@liuk4friends Sorry for the unclear release notes for upgrading! The intention was
- Upgrade to release 2
- Restart
- Let the integration import from YAML (and remove from known_devices.yaml if found).
- Remove iphonedetect from configuration.yaml
- Restart again
Hopefully re-adding the configuration and restarting would recreate the entities. (track_new_devices must be true for entries to be added to known_devices.yaml) Then when HA completely has started, the integration will remove them and after another restart be ready to finally be removed.
or, if ok with you simply recreate the entries via UI as your known_devices already is empty (no name conflicts)
I've followed exactly that sequence ... I really don't know what has gone wrong.
A few minutes ago I tried to recreate the entries via UI but after reboot none of them was present.
So then I've tried to:
- recreate (another time) all the entries via UI;
- manually rewrite my old known_device.yaml;
- reboot
after reboot all the entries were gone .. another time.
So I decided to go back to version 1.4.2 by rewriting the manual configuration (yaml). Now everything works again...
While waiting to understand better where the problem is, I think I will stay with version 1.4.2. Thanks for your support
@mudape - Thank you so much for this integration and the work you've done on it. I was able to follow your instructions above to move my devices into the UI, and clean up the config yaml.
I wanted to say, your system is the only "reliable" device tracker that has worked for me and I use it every day to control automations when my wife and I both leave the house, and when one of us arrives.
I tried several "geo" versions and other things and didn't have reliable events, so thanks again for making this work so well!
I just wanted to ask, I didn't see a "buy me a coffee" or some other way to give you some tip for the work since I know it takes time to do these updates, do you have some way to receive some sort of monetary gift?
Thanks! Dennis