icloud3_v3 icon indicating copy to clipboard operation
icloud3_v3 copied to clipboard

Error displaying the Update Devices screen - Solved

Open gcobb321 opened this issue 1 year ago • 32 comments

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

gcobb321 avatar Feb 27 '24 09:02 gcobb321

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 avatar Feb 27 '24 09:02 gcobb321

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 avatar Feb 27 '24 09:02 gcobb321

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

gcobb321 avatar Feb 27 '24 22:02 gcobb321

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.

goldriver2 avatar Feb 28 '24 00:02 goldriver2

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 [email protected].

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 avatar Feb 28 '24 07:02 gcobb321

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

gcobb321 avatar Feb 28 '24 12:02 gcobb321

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 <Unknown error occured> 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 avatar Feb 28 '24 12:02 goldriver2

I just sent a note on GITHUB and here are the log files

I will disable the app and retry

De : Gary Cobb @.> Envoyé : 28 février 2024 07:58 À : gcobb321/icloud3_v3 @.> Cc : bruno lalongé @.>; Comment @.> Objet : Re: [gcobb321/icloud3_v3] Proxmox vm - Unable to add new device (Issue #281)

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

— Reply to this email directly, view it on GitHubhttps://github.com/gcobb321/icloud3_v3/issues/281#issuecomment-1968930574, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABXBTSL23LX2A2PNWPCZCPLYV4SVRAVCNFSM6AAAAABD3YSCBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRYHEZTANJXGQ. You are receiving this because you commented.Message ID: @.@.>>

goldriver2 avatar Feb 28 '24 12:02 goldriver2

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

goldriver2 avatar Feb 28 '24 13:02 goldriver2

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

gcobb321 avatar Feb 28 '24 13:02 gcobb321

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

goldriver2 avatar Feb 28 '24 13:02 goldriver2

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.

gcobb321 avatar Feb 28 '24 20:02 gcobb321

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

goldriver2 avatar Feb 28 '24 21:02 goldriver2

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

config_flow.zip

gcobb321 avatar Feb 28 '24 23:02 gcobb321

Tried adding a device (always same error)

icloud3-0.log

goldriver2 avatar Feb 29 '24 00:02 goldriver2

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

gcobb321 avatar Feb 29 '24 01:02 gcobb321

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

goldriver2 avatar Feb 29 '24 02:02 goldriver2

  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.

gcobb321 avatar Feb 29 '24 07:02 gcobb321

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

goldriver2 avatar Feb 29 '24 10:02 goldriver2

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

gcobb321 avatar Feb 29 '24 17:02 gcobb321

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

goldriver2 avatar Feb 29 '24 22:02 goldriver2

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.

gcobb321 avatar Feb 29 '24 23:02 gcobb321

No problems, I am not a programmer but I can easily manage this.

Just let me know the blocks to comment and I will proceed with pleasure Thanks

Bruno ’

Le 29 févr. 2024 à 18:13, Gary Cobb @.***> a écrit :



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.

— Reply to this email directly, view it on GitHubhttps://github.com/gcobb321/icloud3_v3/issues/281#issuecomment-1972130196, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABXBTSO3Q3R7RF4GB3AMTCTYV62ZPAVCNFSM6AAAAABD3YSCBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZSGEZTAMJZGY. You are receiving this because you commented.Message ID: @.***>

goldriver2 avatar Mar 01 '24 00:03 goldriver2

  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

gcobb321 avatar Mar 01 '24 16:03 gcobb321

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

goldriver2 avatar Mar 01 '24 20:03 goldriver2

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

gcobb321 avatar Mar 01 '24 20:03 gcobb321

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

goldriver2 avatar Mar 01 '24 20:03 goldriver2

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

icloud3-0.log

goldriver2 avatar Mar 01 '24 20:03 goldriver2

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

gcobb321 avatar Mar 02 '24 20:03 gcobb321

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

goldriver2 avatar Mar 03 '24 11:03 goldriver2