Scope of project: Using device_tracker, log an entry in a Google Spreadsheet with IFTTT every time a given entity is set to ‘not_home’
Additional considerations: Insert the trigger.from_state information (previous location of the entity) into one of the 3 available IFTTT values
at execution of the action. (not yet attempted.)
Problem: Current configuration is adding an entry to the spreadsheet, but none of the service data is being passed. I’m using this page as a reference: https://home-assistant.io/components/ifttt/
- alias: Jon Changed Locations
trigger:
platform: state
entity_id: device_tracker.jons_iphone_7
to: 'not_home'
action:
service: script.location_tracking
data_template:
value1: 'one'
value2: 'two'
value3: 'three'
None of the variable values are being passed to IFTTT. A new row is added to the spreadsheet entitled ‘Location Tracking’ with the first cell containing the OccurredAt values generated by IFTTT, but none of the variable values I’ve set are passed.
If I replace {{value1}} in the script with something like {{ states.sun.sun.state }} the value of the sun’s horizon attribute is recorded to the spreadsheet if I activate the script. But if I try to force a ‘not_home’ state for the device tracker in the automation, none of the data values are passed.
I don’t need to escape anything. I figured it out. It was required to put {{value1}} in side of the quotes in the script, but the instructions on the IFTTT page show no mention of the {{value1}} variable templates.
In fact, however, if you edit the GitHub page, the variables are there. They just don’t display on the web.
When I trigger an ifttt script (to record in a google sheet)
But the only thing that was transferred as value was: states.media_player.central.attributes.media_title
Not the correct value.
I’ve also tried to record the correct state of sun.sun (states.sun.sun.state) into my spreadsheet (for test reasons) But the only value that was transferred was --> states.sun.sun.state
The value that you’re sending in the “value1” pair is a string. You need to pass the {{states.media_player.central.attrubutes.media_title}} value to a variable through an automation, then in your script you would just use: