Geofencing with IFTTT on Fibaro

Needed:

  • IFTTT account with IFTTT App installed on iphone (Not yet tested with Android).
  • Fibaro controller available through port-forwarding
  1. Create Global Variable for User with 2 possible values (aanwezig(=present) and afwezig(=away) or choose your own.
  2. Create virtual Device with 2 buttons

    Choose 2 buttons, choose toevoegen (add)

    Change icons (if you want, available on Gateway Pictures).
    Change buttons from String to LUA Code
    Add Lua Code:fibaro:setGlobal(“Bram”,”Aanwezig”);
    This will only set the Global variable “Bram to either “Afwezig” or “Aanwezig” (or “Present” and “Away” if you prefer).
    If you want to call a scene directly from this you can add:
    fibaro:startScene (<nr of scene you want to start>);
  3. Save Virtual Device
  4. Create a user on fibaro with access to only the just created virtual device.
  5. Create New Applet in IFTTT:
  6. Search for Location:
  7. Select Location:

    Adjust the location to your liking, do not make the range too small, so IFTTT has time to react.
    Click “Create trigger”.
  8. Now we provide the action:
    Click “that”:
  9. Search for webhooks:

    Click “Webhooks”.
  10. Click “Webrequest”:
  11. Fill in all the fields as follows:

    URL = http://<user>:<Password>@<IPADRESS>:<PORT>/api/callAction?deviceID=<DeviceID>&name=pressButton&arg1=<Buttonnr>
    Where:
    <user> is the user created in step 4
    <Password> the password of the above user
    <IPADRESS> the external ipadress of the Fibaro controller
    <PORT> the port the Fibaro can be reached on (through portforwarding)
    <DeviceID> the DeviceID of the virtual device created in steps 2 & 3
    <Buttonnr> the Nr of the button to be activated (First button =1, etc)Set Method to “Get”

    Set content Type to “text/plain”.

    Select “Create Action”.

  12. Select Finish.
    If you do not want to be notified each time the applet runs, turn off notifications
  13. Your done!
    Each time you enter the specified area, IFTTT when it detects this, will send a request to the Fibaro controller, pressing the specified button on the virtual device.
    You can of course expand this with exiting an area, etc..
    Have Fun!