Hi all! I am trying to get presence detection working with IFTTT and I could use a bit of help. I am trying to set up geofences for two users. Both users will have “home” and “work” locations defined, and IFTTT will fire a webhook whenever a user enters or exits the location.
I have the basic webhook working so I can send JSON data to HA. I’m trying to understand how to use templating in the automation so that I can have a single automation handle all of the cases. I’d like to set up an automation to set the presence to “home”, “work”, or “away” depending on the results. Here’s an example of the JSON payload:
Example JSON payload from IFTTT - describes which user, which zone, and whether the user entered or exited the zone
Where do you want to store the presence information? In an input_text? If so, and if the object_id’s of the input_text’s are the user reported in the JSON, then you might do something like this:
I can test it with this command:
curl
–header “Content-Type: application/json”
–header “X-Limit-U my_name”
–request POST
–data ‘{“action”:“set_location”, “user”:“input_select.MY_NAME_home_ifttt”, “location”:“Work”,“enteredorexited”:“Entered”}’
https://MY_DOMAIN.duckdns.org/api/webhook/SECRET_WEBHOOK_KEY