gcobb321 / icloud3_v3

iCloud3 v3, Development Version - This Repo/Version is used for development and testing of new and updated features. It is not the official release of iCloud3 v3, .
MIT License
169 stars 13 forks source link

Could you please add a way to disable "Personal Device" room creation #231

Closed jflefebvre06 closed 11 months ago

jflefebvre06 commented 1 year ago

Could you please add a way to disable "Personal Device" room creation ?

gcobb321 commented 1 year ago

You can change it to anything you want on the HA Settings > Devices & services > Devices screen. Then select the device tracker entity and click the edit pencil in the upper-right corner to open the edit window.

jflefebvre06 commented 1 year ago

No thats not works, if iI remove the the room for each device and after remove rhe room, after restart, thé room is created again and devices attached to it

gcobb321 commented 1 year ago

Actually, what you are referring to is not technically a room. HA considers it an 'Area' that the can put the entity into a category or a type. Looking on the Devices & settings screen, you will find 'System'. I have A/C units that put themselves into a 'Native Zone', the Ring Doorbell puts itself into a 'Ring' Area.

You can assign the device_tracker entity to any area you would like but if it is blank, it will put it into a ;Personal Device' area that can also be used for other devices.

I do not see providing an option to change this.

Edit: Apple describes the this as a device on the FindMy App.

jflefebvre06 commented 1 year ago

What's weird is that I didn't have this behavior in iCloud3 v2.4, it's been happening since I upgraded to V3

jflefebvre06 commented 1 year ago

I found that :

custom_components\icloud3\device_tracker.py

Gb.area_id_personal_device = area_reg.async_get_or_create('Personal Device').id

gcobb321 commented 1 year ago

I’m going to look at only assigning the area when a device is added. However, I did see that it is always assigning it to a personal Device area. What I will probably do is to only assign it if it not assigned which will let you change it to something else.

But I still do not understand why this is important. How are using the area that the Personal Device gets I in the way. Just trying to understand the issue.

jflefebvre06 commented 1 year ago

Why do you need to create this "Personal Device" room and add device to it ?

gcobb321 commented 1 year ago

I have changed the code (not released yet) to add a device to the 'Personal Area' only when the device_tracker entity is created by iC3 (added on the Update Devices screen or changed from Inactive to Tracked/Monitored). After that, you can change the Area or remove it and it will not be overwritten by iC3. iC3 will never touch it again.

But I am still trying to understand if you are not using Area or do you just want to set it to a different text value. In any case, I will send you rc9 before I release it to make sure there are no issues.

gcobb321 commented 1 year ago

I've wrapped up rc9. Here is a preliminary copy with the code that addresses the problem you had, along with a bunch of other things. I have not uploaded this to GitHub yet but probably will this coming Wednesday. Let me know how things go (ok or there is a problem).

Unzip icloud3-rc9.zip into the icloud3 directory and restart HA. icloud3_v3-rc9.zip

rc9 Change Log:

  1. Stationary Zone

    • Fixed a bug restarting iCloud3 when reinitializing the zones and a Stationary Zone already existed. Some of the zones were not reloaded and the Stage 2 Zone setup process would end.
    • All Stationary Zone information persists over iCloud3 restarts and devices that were in the Stationary Zones will be moved back into it.
    • Unused Stationary Zones will be checked and deleted every hour
    • A nearby device results will not be used if the device's stationary zone timer has expired
  2. The iOSApp Location Time was not being saved correctly when it processed an update handling the Initial Location triggers when starting iCloud3.

  3. Bug fix - Devices that were paired with a Watch that was not being tracked were displaying a message in the Event Log that they were paired with themselves.

  4. Battery - Fixed a problem so the battery sensor would only be updated when the battery level or status changed. It was updating when the information hadn't changed which was causing excessive and unnecessary HA battery sensor state changes.

  5. Near zone (home) old location update retries - When approaching Home, the location request time was small (15-secs) and old location info was being returned from iCloud, the old location threshold was set to 15-secs to try to get a good location. This sometimes resulted in the location always being old even when it was good enough to be used. Now, the small interval will only be used for 4 Location requests. The old location threshold of 2-3 minutes will then be used.

  6. Waze History Database - Removed some maintenance activities being done when iCloud3 starts that was delaying the startup process by almost 2-minutes for a database with 10,000+ entries. This is now done at midnight. 7: Event Log - The Event Log items are displayed a lot faster after selecting a different device or refreshing the screen.

  7. HA Area - iCloud3 was assigning or reassigning the tracked and monitored devices to the 'Personal Device' area when starting. This will now only be done when the devices is added or changed from Inactive to Tracked. You can now change or delete the device's HA Area and it will not be reassigned.

  8. NEW FEATURE - Away Time Zone - "The time displayed in the Event Log and Sensors show the time an event took place using the Home 'time zone' from your Home Assistant computer. When you are away from Home and in another time zone, your tracking events are still based on the time at your Home 'time zone', not time in your current location. This feature lets you display time events on the Event Log, Sensors, Sensor Attributes and the Device_Tracker Attribures using your Away location's time zone.

This is useful if you are away for a holiday or business trip to a location in another time zone. For example, you may create a temporary zone for a house you rented, set that zone up as a 'track from' zone on the device's update screen and then all time based tracking events (arrival time, location time, etc) will show your local time instead of your Home time zone time.

The Away Time Zone screen has been added to the Configure Settings, Menu Page 1. On this screen, you can configure the devices that should display the time based entities in the Away Time Zone and the Away Time Zone's time. Two configuration fields are provided if you have several devices that are away and they are in different time zones.

  1. NEW FEATURE - Log Activity for Zones - When a device exits a zone, the zone information (Enter Time, Exit Time, Time in the Zone (minutes & hours), zone name and device_name) can be written to a spreadsheet .csv file. This file can be imported into a spreadsheet (Excel, etc) and used for travel expense reporting, monitoring when a device entered and exited a zone, who entered a zone, etc. The zones and file name format is specified for each device you want to monitor. You can monitor multiple zones for one or more devices.

The file name format is:

gcobb321 commented 11 months ago

Below is the latest rc9 update. Unzip icloud3_v3-rc9.zip into the icloud3 directory and restart HA.

There are a lot of updates, bug fixes and new features. Review ChangeLog.txt for a complete list. They are at the top under the rc9 heading.

icloud3_v3-rc9.zip

jflefebvre06 commented 11 months ago

Hello, Thanks for the update, with that release devices are not automatically added to room, thats great image

but "Personal Device" room still created image

Could you please just disable the automatic creation of this room ?

gcobb321 commented 11 months ago

The Personal Device lives in the HA Area Registry. Now that you have removed all devices from Personal Device, can you select the Personal Device area and then delete it? If you do that, is it recreated when you restart HA ?

Edit: Ignore the question. It will be created.

jflefebvre06 commented 11 months ago

I have delete the area from cora_area_registry image

After restart HA area created again

jflefebvre06 commented 11 months ago

Same if I delete area from UI

gcobb321 commented 11 months ago

I will change iCloud3 to only create Personal Devices area when iCloud3 is first installed and there are no devices and send you another update when done. Probably later today.

My Ring doorbell creates a Ring area. Do you think the area name would be better if it was named iCloud3 Devices instead?

jflefebvre06 commented 11 months ago

I think the best is to let end user create a room and attach devices to it if needed

gcobb321 commented 11 months ago

Good point. I now realize that having iCloud3 create an Area could create confusion and potential problems for non-English users. I have removed the area updates from iCloud3. Thanks for your feedback.

Unzip icloud3_v3-rc9 into the icloud3 directory and restart HA.

icloud3_v3-rc9.zip

jflefebvre06 commented 11 months ago

Perfectly works, thanks a lot