The last_zone sensor is set to the value of the zone sensor before the zone sensor is changed. It is not formatted like _name1 & _name2. Rather than using {{states.sensor.doug_iphone_last_zone.state}} in a message, use the from trigger state {{trigger.from_state.state}}. That will give you the value of doug_iphone_zone_name1 before it was changed.
I probably need to review the sample automations & scripts to make sure they are current. I may have included this as an example earlier but this is what I use for leaving a zone:
#--------------------------------------------------------------
# Gary leaves a zone
#--------------------------------------------------------------
- alias: Gary Leaves Zone
id: gary_leaves_zone
trigger:
- platform: state
entity_id: sensor.gary_iphone_zone_name1
to: 'Away'
condition:
- condition: template
value_template: '{{trigger.from_state.state != "Home"}}'
- condition: template
value_template: '{{states.sensor.gary_iphone_distance.state | float > 0}}'
- condition: state
entity_id: input_boolean.ha_started_flag
state: 'on'
action:
- service: script.gary_leaves_zone
- service: script.notify_gary_iphone
data_template:
title: 'Gary Leaves Zone'
message: 'Zone: {{ trigger.from_state.state }} --> {{ trigger.to_state.state }}, Distance: {{ states.sensor.gary_iphone_distance.state }}'
Is it possible to exclude creation of all the sensors? Either a parameter in the icloud3-component or by commenting out a block of code.
I succesfully slimmed down the number of entities/sensors/switches in my HA setup but icloud3 added so much sensors that is increased my total entitities by 300%. This is an issue as I am using the /dev-state page often.
Also all sensors are automatically logged which makes the database grows, unless all sensors are manually entered as recorder exlusions.
I have an error:
Error returned from pyicloud: (âInvalid email/password combination.â, PyiCloudAPIResponseError(âFailed to validate the credentials from cookieâ,))
but email and passed are OK.
always i get Battery State: Charging but my iphone not charging, i have iphone 6
in past he used to show me when to charge when I was not charging.
How do you fix it?
thanks
iCloud3 v1.1.0 has been updated to track devices with Find-My-Friends. Iâve uploaded the new code to the beta directory on the iCloud3 github repository Go here for the modules (device_tracker.py & pyicloud_ic3.py). The ChangeLog lists the âbreaking changesâ and how to set it up.
I want to do some more testing before issuing a formal release (probably next week) so let me know if you see anything weird or it it seems to work fine.
I havenât tested it with multiple accounts being used at the same time but donât expect any issues.
Gary
There is one other thing I omitted from the instructions.
FmF uses an ID code (âMTg2Djk7ODEqâ) to identify contacts (friends) with the location data. During initialization, iCloud3 matches the email address in the devicenameâs tracked_devices parameter with the email address in the FmF accounts contacts/friends record to tie the FmF ID code to the devicename. You have to set up a contact in the Contacts App while logged into the FmF iCloud account. If you donât, error messages are displayed during initialization and no devices will be tracked.
The minimum amount of information you need to enter into the Contacts app is the First Name, Last Name and email address.
Iâve just updated iCloud to v1.1.0 beta 2. Get it here
Since I canât tell how many people are trying the beta, Iâd appreciate any feedback on the installation instructions (easy to follow, not enough detail, missing steps, etc.), set up issues (parameter explanations, not enough examples, better or more configuration samples, etc.) and if you run into any problems using it.I want to make the instructions as clear as possible to minimize questions and problems.
@gcobb321 came across this for the first time, and I am must say I am blown by the extensive documentation and the work you have done. Thank you. Do you recommend that a first time user of this custom component should try the beta version or the stable version
I would use the beta. Itâs stable. The big difference is the added ability to use Find-my-Friends to the locate the phone and other devices. If youâve followed the above posts, youâve seen that Apple is now sending notifications when logging into an iCloud with 2fa to use the Find-my-phone location services, which is very annoying. The docs are not up to date but the ChangeLog does have the instructions on setting it up. There will be a few more betas in the next few days as things get checked out. Let me know how the install goes and if the instructions need to be changed to make it easier.
Gary
Iâve just updated iCloud to v1.1.0 beta 3. Get it here .
It corrects crashes if the username/password are invalid
Added a new base_zone parameter to select a zone other than the âhomeâ zone to be used as the basis for distance and time calculations.
Changes the way a day number is displayed to see if iCloud3 will run under Windows
Displays a warning if the track_devices parameter is configured incorrectly.
Verified that Find-my-Friends works when it has several platforms in the device_trackers configuration file all logged into the same or different icloud accounts. For example: