iCloud binding force refresh

Hi

I changed the refresh from 5 minutes to 15 minutes in the binding, and now the items do not refresh anymore.

With 5 it is all OK, but I use it for 7 devices, that might be a bit too much and I don’t need that granularity.

15 or 30 minutes is more than enough, but doesn’t work

Here is my config

Bridge icloud:account:karl [appleId=“xxx”, password=“xxx”, refreshTimeInMinutes=15]
{
Thing device iPhoneKarl “iPhone Karl” @ “World” [deviceId=“xxx”]
Thing device iPadKarl “iPad Karl” @ “World” [deviceId=“xxx”]
}

And for the items

String iPhoneKarl_BatteryStatus “Battery Status [%s]” (iCloud_Group) {channel=“icloud:device:karl:iPhoneKarl:batteryStatus”}
Number iPhoneKarl_BatteryLevel “Battery Level [%.0f %%]” (iCloud_Group) {channel=“icloud:device:karl:iPhoneKarl:batteryLevel”}
Switch iPhoneKarl_FindMyPhone “Trigger Find My iPhone” (iCloud_Group) {channel=“icloud:device:karl:iPhoneKarl:findMyPhone”}
Location iPhoneKarl_Location “Coordinates” (iCloud_Group) {channel=“icloud:device:karl:iPhoneKarl:location”}
Number iPhoneKarl_LocationAccuracy “Coordinates Accuracy [%.0f m]” (iCloud_Group) {channel=“icloud:device:karl:iPhoneKarl:locationAccuracy”}
DateTime iPhoneKarl_LocationLastUpdate “Last Update [%1$td.%1$tm.%1$tY, %1$tH:%1$tM]” (iCloud_Group) {channel=“icloud:device:karl:iPhoneKarl:locationLastUpdate”}
Switch iPhoneKarl_Refresh “Refresh”

As a side question, I added a Switch to force a refresh, linked to a rule

rule "Button Refresh Karl iCloud"
when
Item iPhoneKarl_Refresh changed to ON
then
postUpdate(iPhoneKarl_BatteryStatus, REFRESH)
postUpdate(iPhoneKarl_Refresh, OFF)
end

In the description for the binding they mention we can send a REFRESH to any channel, but then I got

2018-02-16 15:19:43.137 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Button Refresh Karl iCloud’: The name ‘REFRESH’ cannot be resolved to an item or type; line 39, column 46, length 7

2018-02-16 15:19:42.938 [ome.event.ItemCommandEvent] - Item ‘iPhoneKarl_Refresh’ received command ON
2018-02-16 15:19:42.962 [vent.ItemStateChangedEvent] - iPhoneKarl_Refresh changed from NULL to ON

Thanks for feedback

Try REFRESH in quotation marks - for OH2 the notation is:
YetkinsiPhoneLocation.sendCommand(“REFRESH”)

I assume it would be
sendCommand(iPhoneKarl_BatteryStatus, “REFRESH”) in your case.

Yahoo, works, thanks

Hi @karld I was wondering if you found a solution to reducing the iCloud refresh ? I am experiencing the same, when I increase the refresh time to a value larger than 5 minutes the items remain offline.
The reason I want it increased is that I noticed that battery life is greatly reduced when using the default refresh rate.

Well, no. I had it working and I kept the 5 minutes.
I was using this mostly for “presence”, but now I’m using a custom bluetooth script runiing from my Raspi