Home Assistant version 0.104.0 has added a new platform for iCloud battery sensors:
Add battery sensor to iCloud (@Quentame - #29818) (icloud docs) (new-platform)
According to the iCloud sensor docs it should add battery sensors for each device that is available on the specified iCloud account, which it does. I’ve tested that.
I’m using the mobile app, so already got a battery sensor of my iPhone through that integration, but I got one through the icloud:
integration (for the same iPhone) as well, as well as battery sensors for other devices which are in my ‘Find My’ app (read: connected to my iCloud account). So far, so good.
The thing is though… those battery sensors which I got through the new integration, well… they don’t update unless I restart Home Assistant.
So, what did I do?
At first I added the integration. After a restart I got all the new battery sensors. One of the sensors showed that the battery of that device was at 15% and it stated that it wasn’t charging. So, I started to charge it. About an hour later, it was at 70%. The battery sensor was still showing 15% and that it was ‘Not charging’. 6 hours later it still didn’t update. None of the new battery sensors had updated. They all showed that their last update was 7 hours ago (when I first restarted the server after adding the configuration).
The next day I restarted Home Assistant again, just to see whether the battery sensors would update or not. They did. Some of the devices now changed to ‘Unknown’ and others updated the battery percentage. Why some changed to ‘Unknown’ I honestly don’t know, because I checked the state in the ‘Find My’ iOS app and they showed up there.
Has anyone ran into this issue? Or is everything working correctly for you? Also, how often are they supposed to update its state?
Oh, btw… the only configuration I’ve added to get the new battery sensors is the following:
icloud:
username: USERNAME
password: PASSWORD
So, nothing special.