HA 自带 iCloud 的集成,但如果开启了二次验证经常需要输入验证码。这里介绍一个第三方项目 iCloud3 v3 Device Tracker Custom Component,可以用来跟踪 iOS 设备
文档:https://gcobb321.github.io/icloud3_v3_docs
iCloud3 是一个设备跟踪器自定义组件,可跟踪您的 iPhone、iPad、Apple Watch、AirPods 和其他 Apple 设备。 它从 Apple 的 iCloud 定位服务请求位置数据,并监控从 Home Assistant 伴侣应用程序(iOS 应用程序)发送到 Home Assistant 的各种触发器。 传感器会根据设备的位置、距区域的距离、到区域的行驶时间等进行更新
地址:https://github.com/gcobb321/icloud3_v3
最新版本是 v3,虽然还在测试阶段,这里选择仍然直接安装最新版
HACS 集成中搜索 iCloud,这里已经下载过了所以是【等待更新】的状态
介绍页面
安装,选择下载【v3.0-pr1.4】版本
或者升级至【v3.0-pr1.4】版本
安装完成后重启 HA 服务
搜索【icloud】,添加【iCloud v3】
开始配置
选项
输入用户名密码,登录
因为开启了 2FA,所以 iOS 设备需要接收 2FA 代码
输入验证码
更新配置文件
新增设备
选择 iPad
确认更新
这里报错了,Family Share, Find-my-Friends, or iOS App devices 必须选择一项
前两者都是空的,也就是这种场景必须得安装 APP 了,于是安装 APP 后然后重新配置
选择 APP 源
添加设备完成
第二页,这里暂不修改
回至首页,重启
现在重启
新增面板,选择自定义 yaml 模式
title: iCloud3
views:
- title: iCloud3
cards:
- square: false
columns: 1
type: grid
cards:
- type: glance
state_color: true
show_name: true
show_icon: true
show_state: true
columns: 5
entities:
- entity: device_tracker.gary_iphone
name: Gary
- entity: sensor.gary_iphone_arrival_time
name: Arrive
- entity: sensor.gary_iphone_zone_distance
name: Distance
- entity: sensor.gary_iphone_travel_time
name: TravTime
- entity: sensor.gary_iphone_next_update
name: NextUpdt
- type: glance
columns: 5
entities:
- entity: sensor.gary_iphone_battery
name: Battery
- entity: sensor.gary_iphone_interval
name: Interval
- entity: sensor.gary_iphone_moved_distance
name: Moved
- entity: sensor.gary_iphone_last_located
name: Located
- entity: sensor.gary_iphone_last_update
name: LastUpdt
- type: entities
entities:
- entity: sensor.gary_iphone_info
name: Info - Lillian
icon: mdi:information-outline
- type: grid
square: false
columns: 1
cards:
- type: custom:icloud3-event-log-card
保存
icloud3 是一款非常优秀的 HA 拓展,具有非常多的跟踪选项,值得使用
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有