Results 1 to 2 of 2

Thread: TP-Link smart bulb control using geofencing ?

  1. #1
    Automated Home Legend
    Join Date
    Sep 2014
    Location
    Scotland
    Posts
    1,843

    Default TP-Link smart bulb control using geofencing ?

    In our back porch we have a TP-Link smart bulb which is Wifi connected and has both a schedule and is linked to Alexa...

    As the location of the switch for the porch light is very inconvienient (it's in the kitchen, so you can't get to the switch when approaching a dark house until you've already been through the dark porch and tripped over in the dark ) we have a schedule that turns on soon before leaving for work and turns off soon after leaving for work and also turns on for us before we come home.

    However we're frequently late home and find the light has already gone off. I can launch Kasa on my phone to turn it back on remotely but that's not particularly convienient either when everyone is impatient to get inside.

    What I would like is some sort of Smart Phone based Geofencing system with flexible customisability that can detect when we leave and approach the house.

    The idea is that a schedule would turn the bulb on soon before we leave for work, however geofencing would turn the bulb off once my phone is about 2 miles from home. And it should only turn on if it is dark at that time of the year at that time of day.

    Then in the evening it would turn back on once I come within a 2 mile radius, and then about 10 minutes after we are home (perhaps based on WiFi geofencing
    to know that I am actually in the house and not nearby ?) it would turn off again. Once again it should only turn on when we approach the house if it's dark by that time - no need for it to come on during broad daylight in the summer.

    Optionally I would also like to be able to receive a push notification on my phone when actions that turn on or off the light take place - such as informing me that the light has turned on when I'm within 2 miles of home.

    TP-Link smart devices can link with IFTTT and IFTTT has geofencing in the iPhone app but from memory the flexibility of designing your own control scenario is very limited to basic "modules" that aren't very configurable or flexible.

    I guess what I really need is some service like IFTTT that has an iPhone app that supports feeding geofencing data to a cloud service and receiving push notfications AND supports some kind of flexible scripting language to achieve what I would like, including calculating whether it is currently day or night at a given time of year.

    Can anyone recommend any services that are a bit more flexible and nerdy than IFTTT which will integrate with TP-Link smart controls and bulbs ?
    Last edited by DBMandrake; 25th November 2019 at 09:32 PM.

  2. #2
    Automated Home Legend
    Join Date
    Sep 2014
    Location
    Scotland
    Posts
    1,843

    Default

    Thought I would post for those that may be interested that I think I have found a solution: https://apilio.com/

    This is a free service that can be linked to IFTTT as a service, (previously it relied on IFTTT webhooks but is now officially an IFTTT integrated service) that essentially provides flexible "logic middleware".

    IFTTT by itself doesn't allow you to combine multiple triggers to control the result of an outcome and part of that is that there is no persistence of state anywhere.

    For example you could have a trigger that happens at dawn and one that happens at dusk but without state, any other trigger running (like entering a geofence) would not be able to make use of that.

    With Apilio you can set up persistent variables like booleans, strings etc, and use IFTTT triggers to update them, and then later use those variables as part of the logic that is run based on yet another trigger to finally produce an action.

    So in my example they provide a couple of IFTTT applets which can trigger at dawn and dusk based on my location, I have set them to update the status of an Apilio Boolean called "daytime", thus the state of this variable should be an accurate indication of whether its day or night, year round as the trigger times will vary each day to account for seasonal changes.

    Then when another trigger like my Geofence trigger runs it can take the value of the daytime boolean into consideration when deciding what action to perform.

    It initially looks slightly daunting but there seems to be a lot of flexibility, and the great thing is because it's an IFTTT service you can use it with any services supported by IFTTT, which is nearly everything. It looks like you could cook up some fairly complex logic to control a full smart home.
    Last edited by DBMandrake; 27th November 2019 at 01:52 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •