Another feature request

Hi amg0,
Can it be possible to return the battery percentage when a particular IPhoneLocator device is queried from the iCloud?
Thanks,
Chris

[quote=“ChrisTheC, post:1, topic:198898”]Hi amg0,
Can it be possible to return the battery percentage when a particular IPhoneLocator device is queried from the iCloud?
Thanks,
Chris[/quote]

Good idea, I created v2.45 with that feature.
it is not yet in MCV app store but you can get it directly from GitHub - amg0/IPhoneLocator: IPhone Locator plugin for Micasaverde VERA and openLuup

Thanks a lot Amg0!
Works good!
Chris

2018-04-03 06:56:33.454   luup.variable_set:29: 29.urn:micasaverde-com:serviceId:HaDevice1.BatteryLevel was: EMPTY now: 100 #hooks:0
2018-04-03 06:56:33.454   luup.variable_set:29: 29.urn:upnp-org:serviceId:IPhoneLocator1.PrevUpdate was: 1518274853.565 now: 1518817246.555 #hooks:0
2018-04-03 06:56:33.454   luup.variable_set:29: 29.urn:micasaverde-com:serviceId:HaDevice1.LastUpdate was: 1518817246.555 now: 1522752794.594 #hooks:0
2018-04-03 06:56:33.455   luup.variable_set:29: 29.urn:upnp-org:serviceId:IPhoneLocator1.CurLat was: XX.000000 now: XX.000000 #hooks:0
2018-04-03 06:56:33.455   luup.variable_set:29: 29.urn:upnp-org:serviceId:IPhoneLocator1.CurLong was: -XX.000000 now: -XX.000000 #hooks:0
2018-04-03 06:56:33.455   luup.variable_set:29: 29.urn:upnp-org:serviceId:IPhoneLocator1.PrevDistance was: 9.235 now: 0.003 #hooks:0
2018-04-03 06:56:33.455   luup.variable_set:29: 29.urn:upnp-org:serviceId:IPhoneLocator1.Distance was: 0.003 now: 0.005 #hooks:0
2018-04-03 06:56:33.455   luup_log:29: IPhoneLocator: ETA set to =>0.3
2018-04-03 06:56:33.456   luup.variable_set:29: 29.urn:upnp-org:serviceId:IPhoneLocator1.ETA was: 0.18 now: 0.3 #hooks:0
2018-04-03 06:56:33.456   luup_log:29: IPhoneLocator: Device Status(29): in Home
2018-04-03 06:56:33.456   luup_log:29: IPhoneLocator: updateHouseMode(true)
2018-04-03 06:56:33.456   luup_log:29: IPhoneLocator: HouseMode, getMode() returns: 1, Home

Just updated the plugin. I’ll see how VeraMate displays the battery.

Edit: I guess this version is 2.45. I’ll have to wait a little longer.

Hi amg0,
And now when battery is low make announcement on Sonos, Please charge your Iphone ?
Thanks

[quote=“michelhamelin, post:5, topic:198898”]Hi amg0,
And now when battery is low make announcement on Sonos, Please charge your Iphone ?
Thanks[/quote]

That’s easy to do… with a scene triggered by the battery level.

[quote=“Don Phillips, post:4, topic:198898”]Just updated the plugin. I’ll see how VeraMate displays the battery.

Edit: I guess this version is 2.45. I’ll have to wait a little longer.[/quote]
this should install it : open this url in your browser and ignore error message, let time to download & reload luup
http://:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=4686&Version=36126

When i try to create the scene, i give me only 3 trigger choices:

1-A device is present or away
2-Distance goes below
3-Distance goes above

[quote=“rafale77, post:6, topic:198898”][quote=“michelhamelin, post:5, topic:198898”]Hi amg0,
And now when battery is low make announcement on Sonos, Please charge your Iphone ?
Thanks[/quote]

That’s easy to do… with a scene triggered by the battery level.[/quote]

[quote=“michelhamelin, post:8, topic:198898”]When i try to create the scene, i give me only 3 trigger choices:

1-A device is present or away
2-Distance goes below
3-Distance goes above

[quote=“rafale77, post:6, topic:198898”][quote=“michelhamelin, post:5, topic:198898”]Hi amg0,
And now when battery is low make announcement on Sonos, Please charge your Iphone ?
Thanks[/quote]

That’s easy to do… with a scene triggered by the battery level.[/quote][/quote]
you can try these json files, the trigger will appear but I had no chance to test if it really work. normally it should

[quote=“amg0, post:7, topic:198898”][quote=“Don Phillips, post:4, topic:198898”]Just updated the plugin. I’ll see how VeraMate displays the battery.

Edit: I guess this version is 2.45. I’ll have to wait a little longer.[/quote]
this should install it : open this url in your browser and ignore error message, let time to download & reload luup
http://:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=4686&Version=36126[/quote]

+1 amg0. And icon shows up on VeraMate.

[quote=“amg0, post:9, topic:198898”][quote=“michelhamelin, post:8, topic:198898”]When i try to create the scene, i give me only 3 trigger choices:

1-A device is present or away
2-Distance goes below
3-Distance goes above

[quote=“rafale77, post:6, topic:198898”][quote=“michelhamelin, post:5, topic:198898”]Hi amg0,
And now when battery is low make announcement on Sonos, Please charge your Iphone ?
Thanks[/quote]

That’s easy to do… with a scene triggered by the battery level.[/quote][/quote]
you can try these json files, the trigger will appear but I had no chance to test if it really work. normally it should[/quote]

Otherwise if you use ALTUI, you can trigger through a variable watch on the battery level. On UI7, you can also set the variable watch in the startup LUA but it takes a bit more coding.

Works but after 2 or 3 hours it show Iphone battery at 0% why?

[quote=“amg0, post:9, topic:198898”][quote=“michelhamelin, post:8, topic:198898”]When i try to create the scene, i give me only 3 trigger choices:

1-A device is present or away
2-Distance goes below
3-Distance goes above

[quote=“rafale77, post:6, topic:198898”][quote=“michelhamelin, post:5, topic:198898”]Hi amg0,
And now when battery is low make announcement on Sonos, Please charge your Iphone ?
Thanks[/quote]

That’s easy to do… with a scene triggered by the battery level.[/quote][/quote]
you can try these json files, the trigger will appear but I had no chance to test if it really work. normally it should[/quote]

the 0% is an indication that icloud lost track of your phone. This has nothing to do with the plugin but rather the connection between your phone and either GPS satellites or internet as it needs both to update icloud. I have observed this too and I found that checking the extra polling helps decrease the frequency. It does not appear that icloud polls the phone that often either so the API sometimes gives an empty response and needs a second poll after it found the phone.