Script for getting data from icloud. This script is using pyicloud. This is layer for integration to openhab only.
- Install library - pyicloud pip install pyicloud - on the openhab server
- Setup pyicloud on your server based on documentation. Pay attention - you have to run command under openhab user - for example "sudo - u openhab icloud --username=[email protected]"
- Install exec binding at openhab
- Install jsontransformation binding at openhab
- Copy icloud.py to your folder openhab/scripts
- Update username at icloud.py
- Create Things from exebinding as command and setup command - python /etc/openhab/scripts/icloud.py -l "your phone key"
- You can create rule for run of this things or setup timer
- Create Item for gps location
- Create rule for update item gps location:
rule "Location"
when
Item Location_Output received update
then
val mygps = transform("JSONPATH","$.localization.latitude",Location_Output.state.toString)+","+transform("JSONPATH","$.localization.longitude",Location_Output.state.toString)
Location_Item.postUpdate(mygps)
end