I am trying to parse extra information from IFTTT to Home Assistant.
More specificaly trying to say to my google home Clean Kitchen. Than parsing the Kitchen part with an extra command to run a certain script in Home Assistant.
Now i already have had IFTTT setup before with Home assistant and i found this new way to parse extra data wich does work:
And finaly this has to run a python script because of the number not being input corectly:
Alright great you would think. But i also use the same Ifttt_webhook trigger to for example turn on or off a light. and when trying to use the same webhok to turn on or of a light for exmaple
Wich is in the IFTTT automation, but if i remove these i cant find an other way to send the extra data. I have been reading all over the forums but have not found a solution for this.
Any lead in the right direction would be greatly apreciated.
- id: '1555877822388'
alias: Webhook from IFTTT w/Execute Text
trigger:
- event_data:
action: execute
event_type: ifttt_webhook_received
platform: event
condition:
condition: template
value_template: '{{ trigger.event.data.service == ''script.ifttt_execute'' }}'
action:
- service_template: '{% set ex = trigger.event.data.ifttt_text.lower() %} {% if
''pool'' in ex and ''fill'' in ex %} {% set what = ''pool_filler'' %} {% elif
''asdf'' in ex %} {% set what = ''do_nothing'' %} {% else %} {% set what = ''do_nothing''
%} {% endif %} script.{{what}}'
Then I have a script.pool_filler that will turn my pool filler on for 10 minutes via Rachio. My thought is to build out the if / elif logic and ‘listen’ for open/close/turn on/turn off/hold/ etc and trigger scripts that way - things that are more complex than switches that Google will recognize already.
THanks for your reply. I see what your doing but it is a lot different from what im trying to do.
So sadly i can not really use this. And i think i will have to resort to making an script or automation for every room and also make a Applet in IFTTT for every room. I was hoping for a more generic aproach but cant not really find an easy example how to parse the extra data into home assistant.
You should be able to take parts of my example and apply them to your needs. Believe IFTTT also allows a Text and Number Input, so could add that as well fairly easily. I do have a lot of IFTTT applets that execute only one script, but w/ their paid plan now, was trying to condense and get away with only 1. Bit the bullet and paying them, worth it for me, but always fun to tinker around.
Basicly the above is working for me, BUT with the exeption that when i dont have a command or params to use in the ifttt json that i send i get the following error:
event put through: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['command']
So basicly what i need in the automation is a way to check if there is data send within comand and params and if not dont use it.
Or i need to be able to make 2 different automations. But i dont understand how to trigger the different ones because the trigger is the iftt_webhook_received so how do i filter it out?