Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error displaying the Update Devices screen - Solved #281

Closed
gcobb321 opened this issue Feb 27, 2024 · 50 comments
Closed

Error displaying the Update Devices screen - Solved #281

gcobb321 opened this issue Feb 27, 2024 · 50 comments

Comments

@gcobb321
Copy link
Owner

Unable to add new device to iCloud3 on Configure Settings > Update Devices screen.

@gcobb321
Copy link
Owner Author

Blockquote
02-26 15:29:54 [init…:0141] iCloud3 v3.0, Log File: Monday, 2024-02-26 15:29:54
02-26 15:29:54 [init…:0141] Profile:
{‘version’: 1, ‘ic3_version’: ‘3.0’, ‘version_install_date’: ‘0000-00-00 00:00:00’, ‘config_update_date’: ‘0000-00-00 00:00:00’, ‘event_log_card_directory’: ‘www/icloud3’, ‘event_log_card_program’: ‘icloud3-event-log-card.js’, ‘event_log_btnconfig_url’: ‘’, ‘event_log_version_running’: ‘’, ‘event_log_version’: ‘3.0.17’}
02-26 15:29:54 [init…:0141] Tracking:
{‘username’: ‘br…@me…’, ‘password’: ‘i5…’, ‘encode_password’: True, ‘icloud_server_endpoint_suffix’: ‘None’, ‘setup_icloud_session_early’: True, ‘data_source’: ‘famshr,mobapp’, ‘devices’: ‘0’}
02-26 15:29:54 [init…:0141] General Configuration:
{‘log_level’: ‘debug-auto-reset’, ‘unit_of_measurement’: ‘mi’, ‘time_format’: ‘12-hour’, ‘display_zone_format’: ‘fname’, ‘device_tracker_state_source’: ‘ic3_fname’, ‘max_interval’: 240, ‘offline_interval’: 20, ‘exit_zone_interval’: 3, ‘mobapp_alive_interval’: 60, ‘old_location_threshold’: 3, ‘old_location_adjustment’: 0, ‘gps_accuracy_threshold’: 100, ‘display_gps_lat_long’: True, ‘travel_time_factor’: 0.5, ‘tfz_tracking_max_distance’: 8, ‘passthru_zone_time’: 0.5, ‘track_from_base_zone_used’: True, ‘track_from_base_zone’: ‘home’, ‘track_from_home_zone’: True, ‘center_in_zone’: False, ‘discard_poor_gps_inzone’: False, ‘distance_between_devices’: True, ‘inzone_intervals’: {‘iphone’: 120, ‘ipad’: 120, ‘watch’: 15, ‘airpods’: 15, ‘no_mobapp’: 15, ‘other’: 120}, ‘waze_used’: True, ‘waze_region’: ‘us’, ‘waze_min_distance’: 1, ‘waze_max_distance’: 1000, ‘waze_realtime’: False, ‘waze_history_database_used’: True, ‘waze_history_max_distance’: 20, ‘waze_history_track_direction’: ‘north_south’, ‘stat_zone_fname’: ‘StatZon#’, ‘stat_zone_still_time’: 8, ‘stat_zone_inzone_interval’: 30, ‘stat_zone_base_latitude’: 1, ‘stat_zone_base_longitude’: 0, ‘display_text_as’: [‘#1’, ‘#2’, ‘#3’, ‘#4’, ‘#5’, ‘#6’, ‘#7’, ‘#8’, ‘#9’, ‘#10’], ‘away_time_zone_1_offset’: 0, ‘away_time_zone_1_devices’: [‘none’], ‘away_time_zone_2_offset’: 0, ‘away_time_zone_2_devices’: [‘none’]}
02-26 15:29:54 [init…:0141] {‘country_code’: ‘CA’, ‘region_code’: ‘QC’, ‘zip_code’: ‘J7Y’, ‘region_name’: ‘Quebec’, ‘city’: ‘Saint-Jerome’, ‘time_zone’: ‘America/Toronto’, ‘latitude’: 45.804, ‘longitude’: -74.0176, ‘use_metric’: True}
02-26 15:29:54 [init…:0141]
02-26 15:29:54 [init…:0141]
02-26 15:29:54 [init…:0147] Setting up iCloud3 v3.0 - Using Integration method
02-26 15:29:54 [sensor…:1212] Sensor entity created: sensor.icloud3_event_log, #1
02-26 15:29:54 [sensor…:1212] Sensor entity created: sensor.icloud3_wazehist_track, #2
02-26 15:29:54 [sensor…:0112] Sensor entities created: 2
02-26 15:29:54 [sensor…:0113] Sensor entities excluded: 0
02-26 15:29:54 [waze…:0073] Set Up Waze > Server-United States, Canada (US), CountryCode-CA, MinDist-1km, MaxDist-1000km, Realtime-False, HistoryDatabaseUsed-True
02-26 15:29:54 [waze_history:0179] Waze History Database > /config/.storage/icloud3/waze_location_history.db
02-26 15:29:54 [start_ic3…:0402] Configure iCloud3 Operations >
• Load configuration parameters
• Set Display Text As Fields (0 used)
• Set Default Tracking Method (iCloud)
• Initialize Debug Control (debug-auto-reset)
• Set Unit of Measure Formats (mi)
• Set Event Log Record Limits (1500 Events)
• Device Tracker State Value Source
(iCloud3 Zone Friendly Name)
02-26 15:29:54 [init…:0220] START iCloud3 Initial Load Executor Job (iCloud3.start_icloud3)
02-26 15:29:54 [start_ic3_co:0034] STAGE 1> +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
| Stage 1 > Initial Preparations
+━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
02-26 15:29:54 [start_ic3_co:0069] STAGE 1> iCloud3 Directory > /config/custom_components/icloud3
02-26 15:29:54 [start_ic3_co:0073] STAGE 1> iCloud3 Configuration File > /config/.storage/icloud3/configuration
02-26 15:29:54 [start_ic3…:0878] STAGE 1> iCloud3 Event Log >
• Current Version Installed-v3.0.17
• File-/config/www/icloud3/icloud3-event-log-card.js
02-26 15:29:54 [start_ic3_co:0079] STAGE 1> LocationInfo-{‘country_code’: ‘CA’, ‘region_code’: ‘xx’, ‘zip_code’: ‘J7Y’, ‘region_name’: ‘xxxxx’, ‘city’: ‘xx-xx’, ‘time_zone’: ‘America/Toronto’, ‘latitude’: xx, ‘longitude’: -xx, ‘use_metric’: True}
02-26 15:29:54 [pyicloud_ic3:0151] STAGE 1> Connecting to and Authenticating iCloud Location Services Interface (init)
02-26 15:29:54 [pyicloud_ic3:0521] STAGE 1> Initialize PyiCloud Service, establish iCloud Location Services connection
02-26 15:29:54 [time_util…:0539] STAGE 1> Local Time Zone Offset > UTC-05:00 hrs, EST, Country Code-CA
02-26 15:29:54 [start_ic3_co:0095] STAGE 2> +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
| Stage 2 > Prepare Support Services
+━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
02-26 15:29:54 [pyicloud_ic3:0924] STAGE 2> Read Cookies from /config/.storage/icloud/xxxxxx
02-26 15:29:54 [pyicloud_ic3:0483] STAGE 2> AUTHENTICATING iCloud Account Access, br…@me… (init)
02-26 15:29:54 [pyicloud_ic3:0598] STAGE 2> Authenticating account br…@me
02-26 15:29:54 [start_ic3…:1095] STAGE 2> Set up Zones > zone, Display (fname)
• home, Maison (r100m/328.1ft)
02-26 15:29:54 [start_ic3…:1118] STAGE 2> Special Zone Setup >
• Enter Zone Delay > DelayTime-30 secs
• Stationary Zone > Radius-100m, DistMoveLimit-125.0m, MinDistFromAnotherZone-200.0m
02-26 15:29:54 [waze…:0073] STAGE 2> Set Up Waze > Server-United States, Canada (US), CountryCode-CA, MinDist-1km, MaxDist-1000km, Realtime-False, HistoryDatabaseUsed-True
02-26 15:29:54 [waze_history:0179] STAGE 2> Waze History Database > /config/.storage/icloud3/waze_location_history.db
02-26 15:29:54 [start_ic3_co:0133] STAGE 2> CONFIGURATION ALERT > DEVICES MUST BE SET UP TO ENABLE TRACKING
02-26 15:29:54 [start_ic3_co:0140] STAGE 2> Gb.Zones=[<Zone: not_home>, <Zone: Not_Home>, <Zone: not_set>, <Zone: Not_Set>, <Zone: ──>, <Zone: NotSet>, <Zone: stationary>, <Zone: Stationary>, <Zone: unknown>, <Zone: home
02-26 15:29:54 [start_ic3_co:0147] STAGE 3> +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
| Stage 3 > Prepare Configured Devices
+━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
02-26 15:29:54 [start_ic3_co:0170] STAGE 3> Gb.Devices=
02-26 15:29:54 [start_ic3_co:0170] STAGE 3> Gb.DevDevices_by_devicename={}
02-26 15:29:54 [start_ic3_co:0170] STAGE 3> Gb.conf_devicenames=
02-26 15:29:54 [start_ic3_co:0170] STAGE 3> Gb.conf_famshr_devicenames=
02-26 15:29:54 [start_ic3_co:0180] STAGE 4> +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
| Stage 4 > Setup iCloud & MobApp Data Source
+━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
02-26 15:29:54 [start_ic3_co:0200] STAGE 4> iCloud Account Used > br…@me
02-26 15:29:54 [pyicloud_ic3:0112] STAGE 4> iCloud Location Svcs Interface > Started during initialization
• Completed: Setup
• Inprocess: Authenticate
• Needed: FamShr, FmF
02-26 15:29:54 [pyicloud_ic3:0151] STAGE 4> Connecting to and Authenticating iCloud Location Services Interface (stage4)
02-26 15:29:54 [pyicloud_ic3:0521] STAGE 4> Initialize PyiCloud Service, establish iCloud Location Services connection
02-26 15:29:54 [pyicloud_ic3:0924] STAGE 4> Read Cookies from /config/.storage/icloud/brunolalongemecom
02-26 15:29:54 [pyicloud_ic3:0483] STAGE 4> AUTHENTICATING iCloud Account Access, br…@me… (stage4)
02-26 15:29:54 [pyicloud_ic3:0598] STAGE 4> Authenticating account br…@me
02-26 15:29:56 [pyicloud_ic3:0653] STAGE 4> Authentication completed successfully, method-Token
02-26 15:29:56 [pyicloud_ic3:0226] STAGE 4> Re-authenticating iCloud Account (450)
02-26 15:29:56 [pyicloud_ic3:0598] STAGE 4> Authenticating account br…@me
02-26 15:29:57 [pyicloud_ic3:0653] STAGE 4> Authentication completed successfully, method-Token
02-26 15:29:57 [pyicloud_ic3:0226] STAGE 4> Re-authenticating iCloud Account (450)
02-26 15:29:57 [pyicloud_ic3:0598] STAGE 4> Authenticating account br…@me
02-26 15:29:58 [pyicloud_ic3:0653] STAGE 4> Authentication completed successfully, method-Token
02-26 15:29:58 [pyicloud_ic3:0229] STAGE 4> iCloud Acct Auth #1 > Token, Last-12:00:00a (Never)
02-26 15:29:58 [pyicloud_ic3:0053] STAGE 4> iCloud Location Services interface > Verified (stage4)
02-26 15:29:58 [pyicloud_ic3:0116] STAGE 4> iCloud Location Svcs Interface > Started during initialization
• Completed: Setup
• Inprocess: Authenticate
• Needed: FamShr, FmF
02-26 15:29:58 [start_ic3…:0544] STAGE 4> Checking Mobile App Integration > Loaded, Devices-iPhonebruno14new (2), iPad (80), SM-T227U
02-26 15:29:58 [start_ic3…:2232] STAGE 4> Mobile App Devices > 0 of 0 iCloud3 Devices Configured
× iPhonebruno14new (2), iphonebruno14new_2_2 (2) >
• Not Assigned to an iCloud3 Device
× iPad (80), ipad_80_2 (80) >
• Not Assigned to an iCloud3 Device
× SM-T227U, sm_t227u (SM-T227U) >
• Not Assigned to an iCloud3 Device
02-26 15:29:58 [start_ic3_co:0232] STAGE 4> Gb.mobile_app_device_fnames=[‘iPhonebruno14new (2)’, ‘iPad (80)’, ‘SM-T227U’]
02-26 15:29:58 [start_ic3_co:0232] STAGE 4> Gb.mobapp_fnames_x_mobapp_id={‘xxxxxxxxx’: ‘iPhonebruno14new (2)’, ‘iPhonebruno14new (2)’: ‘xxxxxxxxx’, None: ‘xxxxxxxx’, ‘xxxxxxxx’: ‘iPad (80)’, ‘iPad (80)’: ‘xxxxxxxx’, ‘xxxxxxxx’: ‘SM-T227U’, ‘SM-T227U’: ‘xxxxxxxx’}
02-26 15:29:58 [start_ic3_co:0232] STAGE 4> Gb.mobapp_fnames_disabled=
02-26 15:29:58 [start_ic3_co:0232] STAGE 4> _.mobapp_id_by_mobapp_devicename={‘iphonebruno14new_2_2’: ‘f7ebbf4eef9d7cb2faa0cf7319914192’, ‘ipad_80_2’: ‘2fbf11791a6f177b18d178e4e48d4850’, ‘sm_t227u’: ‘9459903c68e36c2225f14978041181ad’}
02-26 15:29:58 [start_ic3_co:0232] STAGE 4> _.mobapp_devicename_by_mobapp_id={‘xxxxxxxx’: ‘iphonebruno14new_2_2’, ‘xxxxxxxx’: ‘ipad_80_2’, ‘xxxxxxxx’: ‘sm_t227u’}
02-26 15:29:58 [start_ic3_co:0232] STAGE 4> _.last_updt_trig_by_mobapp_devicename={‘iphonebruno14new_2_2’: ‘iphonebruno14new_2_last_update_trigger’, ‘ipad_80_2’: ‘ipad_80_last_update_trigger’}
02-26 15:29:58 [start_ic3_co:0232] STAGE 4> _.battery_level_sensors_by_mobapp_devicename={‘iphonebruno14new_2_2’: ‘iphonebruno14new_2_battery_level’, ‘ipad_80_2’: ‘ipad_80_battery_level’, ‘sm_t227u’: ‘sm_t227u_battery_level’}
02-26 15:29:58 [start_ic3_co:0232] STAGE 4> _.battery_state_sensors_by_mobapp_devicename={‘iphonebruno14new_2_2’: ‘iphonebruno14new_2_battery_state’, ‘ipad_80_2’: ‘ipad_80_battery_state’, ‘sm_t227u’: ‘sm_t227u_battery_state’}
02-26 15:29:58 [start_ic3_co:0281] STAGE 5> +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
| Stage 5 > Tracked Devices Configuration Summary
+━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
02-26 15:29:58 [start_ic3_co:0298] STAGE 5> Gb.Devices_by_devicename_tracked={}
02-26 15:29:58 [start_ic3_co:0298] STAGE 5> Gb.Devices_by_devicename_monitored={}
02-26 15:29:58 [start_ic3_co:0298] STAGE 5> _.inactive_devices=
02-26 15:29:58 [start_ic3_co:0308] STAGE 6> +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
| iCloud3 Initialization Complete
+━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
02-26 15:29:58 [start_ic3…:2641] STAGE 6> StatZones-None
02-26 15:29:58 [start_ic3…:2644] STAGE 6> Devices-None
02-26 15:29:58 [start_ic3…:2652] STAGE 6> Zones-not_home, Not_Home, not_set, Not_Set, ──, NotSet, stationary, Stationary, unknown, home
02-26 15:29:58 [start_ic3_co:0334] STAGE 6> The following issues were detected when starting iCloud3. Scroll through the Startup Log for more information:

  1. iCloud3 Integration not set up
    02-26 15:29:58 [start_ic3_co:0365] 1stLOC > Requesting Initial Locate
    02-26 15:29:58 [start_ic3_co:0367] 1stLOC > +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    | iCloud3 v3.0 > Start up Complete
    +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    02-26 15:29:58 [icloud3_main:0164] 1stLOC > Commit Log File Records, RequestedBy-iCloud3 Initialization
    Blockquote

@gcobb321
Copy link
Owner Author

gcobb321 commented Feb 27, 2024

Link to original note post from Bruno/ goldriver

I tried installing icloud3 V3 from scratch (never installed or use v2) but I guess i might have done something wrong, now it seems I can’t go anywhere.

I have been able to setup my icloud account but I think i missed something doing so ,I can’t create or add any devices. If i select .ICLOUD3 DEVICES add, change delete, i get to a page saying i have no devices, i then select ADD DEVICES, enter the IOS device name iPhonebruno14new (2) and a name and I have the following message:

image
image
520×537 28 KB
I then tried removing the (2) and got

image
image
534×556 27 KB
Also, if i go back on the main iCloud Account & Mobile App Data Sources and try to log into another account it always come back to my original acount

My question, How can I delete icloud3 completely and start with a new fresh setup ?

It seems to always keep the original Apple Id and password ?

thanks

@gcobb321
Copy link
Owner Author

I've added some error catching code to the Configure Settings screen when adding a device and changed a few things around verifying devicename fields. There were some fields being error checked before you had entered any information. Although it had never been a problem, it may have been getting caught in the way you were naming the device Lets see what happens now.

Remember, the iCloud3 Devicename on the Add Devices screen is the name you are device_tracker entity assigning to the ic3 device. You will select the iCloud and Mobile App device for that ic3 device on the screen after the Add Devices screen

Unzip config_flow.zip into the icloud3 directory and restart HA.
config_flow.zip

@goldriver2
Copy link

I took some time to log from the office, unfortunatly, installing and restarting with the new config_flow.py didn't change anything still the same messages Unknown error occured and still nothing in HA logs.

@gcobb321
Copy link
Owner Author

gcobb321 commented Feb 28, 2024

Send me the icloud3-0.log, icloud3-1.log and home_assistant.log files. Zip them together or as individual files and add ‘.html’ as a new extension to get by gmail filters. Email to geekstergary@gmail.com.

EDIT: One thing that is confusing is the mobile apps you have installed and the way iCloud3 is displaying then in the Event Log. You are displaying:

02-26 15:29:58 [start_ic3…:2232] STAGE 4> Mobile App Devices > 0 of 0 iCloud3 Devices Configured
× iPhonebruno14new (2), iphonebruno14new_2_2 (2) > Not Assigned to an iCloud3 Device
× iPad (80), ipad_80_2 (80) > Not Assigned to an iCloud3 Device
× SM-T227U, sm_t227u (SM-T227U) > Not Assigned to an iCloud3 Device 

Mine is:

2226] STAGE 4> Mobile App Devices > 3 of 4 iCloud3 Devices Configured
✓ Gary-iPhone-app, gary_iphone_app_2 (iPhone15,2) > gary_iphone, Gary 
✓ Lillian-iPhone-app, lillian_iphone_app (iPhone15,2) >  lillian_iphone, Lillian 
✓ Gary-iPad-app, gary_ipad_app_2 (iPad8,9) > gary_ipad, Gary-iPad (Monitored)
× Lillian-iPad-app, lillian_ipad_app (iPad14,3) > Not Assigned to an iCloud3 Device 

The first part of the line is the friendly name, then the device tracker entity name, then the device model number. It g gets this data from the HA .storage/entity_registry file mobile_app platform items. Mine shows (iPhone15,2) as the model where yours shows (2) for the iphone and (80) for the iPad. The Samsung phone is the only one that makes sense.

Can you rename them to remove the (2) and (80) to see what happens?

Look at the Mobile App integration and verify the devices and their names. Bring up each device and verify they are not program entries that should be deleted. Look at the. HA Developer Tools > States device _tracker and sensor entities for them also.

@gcobb321
Copy link
Owner Author

What happens if you disable the mobile app device, restart HA and retry

@goldriver2
Copy link

Gary,
Here are the steps I have done in an attempt to start with a clean state

  • I changes the device name in my iphone and ipad (Iphone-Bruno and Ipad_Bruno)
  • I removed and re-install HA mobile app as it did not show the same device name as IOS
  • Remove icloud3 integration
  • Removed icloud3 V3 HACS
  • Removed .storage/icloud
  • Removed .storage/icloud3
  • Removed /config/custom_components/icloud3
  • Restarted HA
  • Installed HACS (downloded the latesticloud3.zip file, created the config/custom_component/icloud3 directory and copied the content of the icloud3.zip file in it)
  • Replace the config_flow.py with the one you provided
  • Restarted HA
  • Added the iCloud3 V3 integration
  • Restarted HA
  • Selected configure and added my icloud account/password, send the validation code and the verification code was accepted
  • Saved the configuration and submit
  • try adding the device with Iphone-bruno-test as name and iphone test bruno as friendly name
  • same message
  • closed the Add iClous3 Device winwos

There is only the icloud3-0.log file in the config/ directory, NO icloud3-1.log
I have sent you the zip files via email, hope it helps narrowing the problem

I have no clue where icloud is still getting the iphonebruno14new name from as I confirm that I see it changed in both IOs information and in Mobile HA settings

@goldriver2
Copy link

goldriver2 commented Feb 28, 2024 via email

@goldriver2
Copy link

goldriver2 commented Feb 28, 2024

Could not deactivate the HA app, I deleted it, rerstarted HA and still have the same error message (still no icloud3-1.log file) sent the log from this test by email

@gcobb321
Copy link
Owner Author

gcobb321 commented Feb 28, 2024

The icloud3-0.log file is the current one. The -0.log file is renamed to -1.log at midnight and a new -0.log file is created so it’s not a problem if it doesn’t exist.

I have not received the zip files yet. You can also attach them to a comment here if that is easier.

Edit: got the 2nd try one

@goldriver2
Copy link

I just found what you meant by 'disable mobile app' ...
I desactivated both my ipad and my iphone and re-did the tests

home-assistant.log
icloud3-0.log

@gcobb321
Copy link
Owner Author

Here is a new config_flow with a lot of debug tracing code. It will add a lot of variable value trace statements to the icloud3-0.log file. I've also added a lot of error logging statements.

Unzip to icloud3 directory and restart ha. Then lets run through this again.
config_flow.zip

If this does not pinpoint what is going on, I'm going to create a configuration file with your devices in it and send it to you to see if that does something.

@goldriver2
Copy link

Great just so you know,

  • Mobile HA are activated for all devices
  • I only disabled the integration, replaced the config_flow.py
  • Restarted HA
  • Enabled the integration
  • Tried adding a device (always same error)
  • Disabled the integration
  • Extract bot log files

home-assistant.log
icloud3-0.log

@gcobb321
Copy link
Owner Author

Making progress. Another config_flow with more traces trying to display the update_devices form

config_flow.zip

@goldriver2
Copy link

Tried adding a device (always same error)

icloud3-0.log

@gcobb321
Copy link
Owner Author

I got the file and want to verify it. Post it again without a restart or anything else to see if there is anything that happened since the last one

@goldriver2
Copy link

Hre is the latest
BTW thanks for looking into this, really appreciate
icloud3-0.log

@gcobb321
Copy link
Owner Author

  1. It looks like iCloud3 builds the specs needed for HA to display the Update Devices form to finish configuration the device you are adding and send it to HA to display it but it never does. HA then displays the extra keys not allowed (mob app) message or the Unknown error occurred message. I’ve lost track of which one is displayed.
  2. There is a message about Authenticating the iCloud account every 15-secs in the log. Did you ever enter the 6-digit code? Did you ever get the alert on your phone after you entered your username/password and then enter the 6-digit code? Go to the Enter/Request Verification Code screen, select Request a code, then Submit. Your phone should give you the login alert and then the code. Enter it, select Enter code and Submit. Hopefully, you will get a Code Accepted message. If you do, add the phone again and see if the screen is displayed.

@goldriver2
Copy link

goldriver2 commented Feb 29, 2024

I do remember at installation time I entered my ICLOUD Account user/password and press submit, i received and accept the 6 digit on my phone and entered it back in icloud3 to send the verification code back to icloud.

I just did a new Request, accepted it and sent back the verification code;
image

unfortunatly, the problem is still there, unable to create the device with the following message
image

about 5 minutes after doing the request, HA showed a ATTENTION NEEDED, the icloud integration needed to be reconfigured
image

I pressed the reconfigure button that brought me back to the Apple ID Verification Code page^, i selected request again,accepted and send back the 6 digit wich leads to a Reauthentification is complete message

I then tried again to add ICLOUD 3 DEVICES and again received the infamous Unknown error occured

Restarted HA just for fun, nothing new again the same message ... EXCEPT that by mistake i forgot to enter a FRIENDLY NAME wich gave me This parameter must be specified, I then filled the field and pressing the Submit button even if the field was filled, I got the following:

image

if i changed nothing and press again the NEXT button then the following:
image

it seems like data are catched and cached but the app can't have access to the data

then again, looking at the log, even if i reauthenticated the app, it seems like the info was not saved and it keeps saying it is not authentified

icloud3-0.log

@gcobb321
Copy link
Owner Author

I redone the config_flow to remove most of the trace statements and concentrate on the general flow now that I know nothing is failing in processing the initial request.

Here is a new config_flow.zip file.
config_flow.zip

Unzip config_flow into the icloud3 directory, restart ha and go to it. Go to the other menu page > Format Parameters and set log level to rawdata. This will now log all traffic between you and your icloud acct. I want to see if the data is actually going back and forth.

Add any device and see what happens. It will probably fail again but I'm thinking that iC3 is passing a show Update Device form to HA and the HA is generating the error showing the form, not iC3.
Copy the icloud3-0.log file because it will be recreated below and I want to see this one.

Then unzip the configuration file below into .storage/icloud3 directory and restart ha and do the same as above.
Do this after the above.
I have also made a configuration file with all your info to see if it will get past this problem.
configuration.zip
except your username & p/w.

Enter your username & p/w, the auth tokens should already be there.
See if iphone bruno is listed on the devices list screen
add a new one and see if the Update Devices screen is displayed.

Send me the icloud3-0.log file from before and the new one that is created

@goldriver2
Copy link

goldriver2 commented Feb 29, 2024

Hi, Sorry for the delay, was working out of the office today

Please Find attach ...-step1 and ...step2 files
1-First you are right, the first step still show the same message and it did not work
2-With the configuration file installed, the device WAS in the list
- Could not create a new device, same message
- Could not update or change the existing device you created with always the same message

Hope you are not too desperate ... thanks for taking so much time on this, hope this will serve many others

icloud3-0-step-2.log
icloud3-0-step-1.log

@gcobb321
Copy link
Owner Author

Do you know anything about computer code. If yes, great. If no, done worry. We will be using a text editor to update a text file to add a character (#) in front of a line of code to turn it into a comment so it will not be processed.

It always dies going to HA to display the Update Devices screen. The config_flow.py module I have been sending you contains the instructions HA uses to build the screen and there must be something in that specification HA can not handle. What I will need you to do is to comment out a group of lines that are the specifications for each parameter and then restart HA and try to display the Update Devices screen. We’ll do this one parameter at a time until it works. That will identify the one creating the problem.

I’ll give you more detail with examples tomorrow when I’m on my computer.

@goldriver2
Copy link

goldriver2 commented Mar 1, 2024 via email

@gcobb321
Copy link
Owner Author

gcobb321 commented Mar 1, 2024

  1. In config_flow.py, the "update_device" form definition handler starts at (or around) line 4388 with the statement elif step_id == 'update_device':.
  2. Preliminary setup code continues until line #4452 (return vol.Schema({) where the definition of each data entry line starts.
  3. Each parameter on the data entry form consists of a group of lines that looks like :
vol.Required(CONF_DEVICE_TYPE,
                            default=self._option_parm_to_text(CONF_DEVICE_TYPE, DEVICE_TYPE_FNAME)):
                            selector.SelectSelector(selector.SelectSelectorConfig(
                                options=dict_value_to_list(DEVICE_TYPE_FNAME), mode='dropdown')),
  1. What you need to do is to put a number sign (#) in front of each of these lines in the line group, save the file and restart HA. Then see if the Update Device form displays correctly. When it does, it was the last group you commented out that was creating the problem.
  2. Once you comment out a line group, leave it commented out while you try the next line group. When the screen finally displays correctly, starting with the first group you commented out, uncomment that line group (remove the #), save, restart and redisplay. That will narrow the problem down to a specific line group(s) by checking to see if a line group you had commented out actually works.

There is one line group that is already commented out (lines 4471-4475 -- # vol.Required(CONF_FMF_EMAIL,) to give you an idea of one that os commented out.

  1. We already know the devicename. friendly name, device type and tracking mode are ok from the Add screen so I would start with the CONF_FAMSHR_DEVICENAME one and work down.

Good luck and have fun
Gary

@goldriver2
Copy link

goldriver2 commented Mar 1, 2024

Hi Gary

by removing the following I was able to pass to the next step:

vol.Required(CONF_PICTURE,
default=self._option_parm_to_text(CONF_PICTURE, picture_by_filename)):
selector.SelectSelector(selector.SelectSelectorConfig(
options=dict_value_to_list(picture_by_filename), mode='dropdown')),

but trying to go further, I entered all fields on the next page and got the following message trying to submit (I guess this is related to the filed we commented ???)

image

@gcobb321
Copy link
Owner Author

gcobb321 commented Mar 1, 2024

Great.

This dumps a lot of info building the picture table used to display existing pictures on the Update Devices screen. Lets see what is in that variable. I suspect it has to do with going through the www directory looking for image files. We'll see
config_flow.zip

@goldriver2
Copy link

what do you want me to do ? copy the config_flow.py i guess but do i reactivate the commented lines ?

@goldriver2
Copy link

Forget my previous question, here is the log file trying to add a device with the latest config_flow

icloud3-0.log

@gcobb321
Copy link
Owner Author

gcobb321 commented Mar 2, 2024

The problem was the files in your www/icon directory far exceeded the number that HA could handle in a dropdown list. HA was giving the error message that said nothing regarding the problem.

I have changed the way the picture file selection table is loaded to not include every file it finds in all of the www directories. It now loads the image files in the www/images,/ www/icloud3, www/custom_cards & www/community. On the Tracking and Other parameters screen is a new parameter that lets you choose a directory other than these to load . It will also only load the first 25 files of a directory.

This is a full icloud3.zip file since it involved changes to multiple modules. It will still read as v3.0, not v3.0a.
Unzip it into the icloud3 directory, restart HA and lets see what happens.
icloud3_v3.0a.zip

@goldriver2
Copy link

Thanks Gary,

Installed and got the wanted devices configured, will run it for sometimes and report if I find anything else.

Maybe the issue titile should be changed ?

Thanks again for the time spent on this, really appreciate
Bruno

@gcobb321 gcobb321 changed the title Proxmox vm - Unable to add new device Error displaying the Update Devices screen - Solved Mar 3, 2024
@gcobb321
Copy link
Owner Author

gcobb321 commented Mar 3, 2024

I've simplified things a bit in the Tracking & Other Parameters screen to make it easier for the v2-to-v3 migration. You will need to go to that screen and verify the www directories that should be scanned for image files. Uncheck your www/icon directory if it is checked. The Update Devices > Picture parameter will only load the first 25 images from a directory so it will not die like it was before.

Unzip the icloud3_v3.0a.zip file into the icloud3 directory and restart HA. Then go to the Configure Settings and verify the Tracking & Other Parameter > Picture directories and the picture file assigned to you on the Update Devices screen.

Thanks for you help getting this error fixed.

icloud3_v3.0a.zip

@goldriver2
Copy link

That was more than a pleasure, thanks to you for taking time fixing this issue that seemed only related to my specific case yet ...

bruno

@pauly7300
Copy link

Gary, I have the same problem as golddriver did. At least I am getting the "Unknown error occurred" error when I try and go in to the ICLOUD3 DEVICES area to modify a device. I am on version 3.0.5.2 as of a day or two ago. I believe this problem was present on the previous version I had been on which was 3.0.2 from March. I did go in and uncheck all of the picture directories except for the root of the www folder and I have less than 10 images in the root.

I tried using commenting out the "vol.Required(CONF_PICTURE" section of the config_flow.py file in 3.0.5.2 but that didn't get me passed the error. Any suggestions?

@gcobb321
Copy link
Owner Author

gcobb321 commented Jul 5, 2024

Edit the configuration file and change the picture to ‘None’ for all devices, save it, restart and see if it reoccurs

@pauly7300
Copy link

In the main ha config?  i dont see any mappings to pics there. 

@gcobb321
Copy link
Owner Author

gcobb321 commented Jul 5, 2024

iCloud3 config. In /config/.storage/icloud3/configuration.

W what is the error message you are receiving?

@pauly7300
Copy link

When trying to go in to add or change a tracked device I get the error message above.

image

@gcobb321
Copy link
Owner Author

gcobb321 commented Jul 5, 2024

That just says an error occurred but does not say weather the error is. Get the error at _Settings > System > Logs _. Then find the iCloud3 error entry. Copy and paste it in this issue

@pauly7300
Copy link

In Settings>System>logs, I don't have any icloud3 error entries nor is there an icloud3 in the dropdown. Should there be? I've loaded ic3 via HACS. should I send you the logs from icloud3-0, 1, 2??

image

@gcobb321
Copy link
Owner Author

gcobb321 commented Jul 5, 2024

Zip the icloud3-0.log file in the _config_directory (same place as the home_assistant.log file)
Add a .png to the end to get by Google filters
Email it to geekstergary@gmail.com and I’ll look at it when I get a chance. I’m away from home at the moment

@gcobb321
Copy link
Owner Author

gcobb321 commented Jul 6, 2024

-0 for now

@pauly7300
Copy link

Hi Gary, I still can not get into the menu to edit my ic3 devices. Any thoughts? I emailed you another set of logs a couple days ago. Sorry to be a pest

@gcobb321
Copy link
Owner Author

Sorry, I had a lot going on. To make sure you are on the latest, unzip icloud3 v3.0.5.6.zip into the icloud3 directory and restart HA. This is v3.0.5.6, which has not been released yet.. Then lets see what happens.

I found your files in my junk folder between emails from Ace Hardware and NetFlix.

icloud3 v3.0.5.6.zip

@pauly7300
Copy link

OK, interesting. I have upgraded to 3.0.5.6 and I have emailed you the logs.

First interesting difference in this version... I am able to navigate into the Devices screen and see the list of devices which is one step further than previously. But now, when trying to update any of the devices in the list, I get the "unknown error" message again.

Please note, I captured the logs in two ways. One is debug_all, as in all components in HA. The other is isolated to icloud3 and the aiohttp component as I noticed that seems to be where the detail of the error when I click on each device.

In each log file, I tried to click into the update for each of the 5 devices so you'll see the 5 attempts in a row in each log file.

Let me know if you need any additional info.

Here's an example of the aiohttp error from one of the clicks:
2024-07-24 10:02:55.315 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 77, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 285, in post return await super().post(request, flow_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post result = await self._flow_mgr.async_configure(flow_id, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure result = await self._async_configure(flow_id, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 415, in _async_configure result = await self._async_handle_step( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/icloud3/config_flow.py", line 2672, in async_step_device_list return await self.async_step_update_device() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/icloud3/config_flow.py", line 2920, in async_step_update_device await self._build_update_device_selection_lists() File "/config/custom_components/icloud3/config_flow.py", line 3277, in _build_update_device_selection_lists await self._build_famshr_devices_list() File "/config/custom_components/icloud3/config_flow.py", line 3303, in _build_famshr_devices_list self._check_finish_v2v3conversion_for_famshr_fname() File "/config/custom_components/icloud3/config_flow.py", line 3350, in _check_finish_v2v3conversion_for_famshr_fname device_id = Gb.device_id_by_famshr_fname[famshr_fname] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'iphone14promax'

image

@pauly7300
Copy link

pauly7300 commented Jul 24, 2024 via email

@gcobb321
Copy link
Owner Author

the iCloud3 devicename is iphone14promax. Is the iPhone's name on Settings > General > About also iphone14promax? If it is change the name on the phone to iPhone14 ProMax or something else so they are not the same. Wait a few minutes for the Apple account databases to be updated and restart HA.

@pauly7300
Copy link

It is the same name on the phone. In fact, I've always made sure to match the IC3 device name with the name on the phone as a matter of consistency. I've done the test (renamed my device to "iphone14 promax" and that appears to have let me in to edit the phones. Can you explain? Each of my other family devices match the IC3 name and the name on the device in General-About. Does it have something to do with the length of the name?

@gcobb321
Copy link
Owner Author

iC3=iphone14promax, Apple= iphone14promax --> They are the same, letter by letter
iC3=ipadair3, Apple=ipadair3 (2) --> They are not the same, the Apple has a (2)
iC3=katiesiphone, Apple=KatiesiPhone11 (2) --> not the same, a k is not the same as a K
iC3=bethsiphone13promax, Apple=BethsiPhone13promax --> not the same

There are some internal tables in iC3 that are used to match the iC3 device name and the FamShr devicename and items can not be found if they are the same. I'll add a check for that in the Configuration Update Device screen.

image

@pauly7300
Copy link

ok, I completely stand corrected. Regarding your comment about internal tables in iC3 for matching names... Is that something you added in the last year as I'm fairly sure my device name has been that way for over 2 years. Either way, it seems to be working now. Thanks a bunch.

One other question, what do the yellow exclamation marks mean beside each of my devices? Are these just indications of which devices are already tracked by another entry?

image

@gcobb321
Copy link
Owner Author

I did add it to solve some problems matching the iCloud3-Apple devices at various points in the setup routines and to cross reference them to each other.

The triangles do mean they are already assigned (It shows who they are assigned to). In v3.1, the assigned devices will have a red circle with a line through it and listed after the available devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants