Issues with IFTTT automations

Hi all!

I am pretty new on HA and playing around for a couple of months (coming from another home assistant solution).
I have been able to achieve moreorless what I wanted to do with all the entities I have at home.
I followed several guides and have ended up into adding the two following automations into my file in order to interact between IFTT and HA.

One is to interact with my alarm system and update its state within HA.
The other one is the “basic” one found into the documentation.

The interaction which are expected to be running are definitely running:
If I run a command through Google Home calling a script this is working.
If I change the state of my alarm system via HA or via the mobile app of my alarm system, it works to and update the status in HA.

Unfortunately, there are two issues which are flooding my logfile which I do not find any way to solve.

- alias: '[IFTTT] Recup action IFTTT'
  trigger:
  - event_data:
      action: call_service
    event_type: ifttt_webhook_received
    platform: event
  condition: []
  action:
  - data_template:
      entity_id: '{{ trigger.event.data.entity_id }}'
    service_template: '{{ trigger.event.data.service }}'

Gives the following into my logs:

[IFTTT] Recup action IFTTT: Error executing script. Invalid data for call_service at pos 1: required key not provided @ data['state']
- alias: Webhook received
  initial_state: 'on'
  trigger:
    - platform: event
      event_type: ifttt_webhook_received
      event_data:
        action: call_service
  action:
      service_template: '{{ trigger.event.data.service }}'
      data_template:
        entity_id: '{{ trigger.event.data.entity_id }}'
        state: '{{ trigger.event.data.state }}'

Gives the following into my logs:

Webhook received: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['state']
Webhook received: Error executing script. Invalid data for call_service at pos 1: required key not provided @ data['state']

I do think that this is a stupid issue but unfortuantely, do not find the solution…

Many thanks in advance for your support!

Regards

Don’t know if this is relevant, but have you got a paid-for IFTTT plan? Under the old free plan you can only have three applets (from today, I think).

Hi,

IFTTT is one of the first thing I had setup and I am living with these issues for 2 or 3 months now but has it is working (despite the errors in log) since the beginning I did not really care about this.
On top of it I suscribed to the Paid-for IFTTT plan so it is not coming from this.

As it is working despite the errors in logs, I wonder if there is not anything useless in the code I have put into my configuration which is generating such message or maybe something redundant between the two blocs of config?

Hi,

Sorry to bump this topic but the issue is annoying and I do not find the proper way to fix it…

Thanks in advance,

Regards,

Hi,

I think I now understand the issue…

One of the IFTTT Webhooks is dedicated to run scripts which I use for opening closers and so on.
The Webhooks loks like this:

{ "action": "call_service", "service": "script.turn_on", "entity_id": "script.ouverture_volets_terrasse" }

So I do not need any state data into my automation.

For the alarm panel, I need a state (armed_away, disarmed,…)

{"action": "call_service", "service": "ifttt.push_alarm_state", "entity_id": "alarm_control_panel.myfox_evology", "state":"disarmed"}

So the issue I have is when I run the Webhooks to call a simple script and it looks like the automation which is used in that case is the one for the alarm panel which has a state data:

    data_template:
      entity_id: '{{ trigger.event.data.entity_id }}'
      state: '{{ trigger.event.data.state }}'

Then the error message is due to the fact that it doesn’t find any state in the webhooks received.

Is there any possibility to split both kind of Webhooks so it is using the proper automation (the one with state data when it concerns the Alarm Panel and the one without when it concerns the closers)?

Thanks again,

Hello guys,

I keep struggling with this automation and have not figure out how to fix it.
Does any body has an idea?

Thanks in advance,

Regards,

Maybe got the final way to do get it working.

Hopefully that could help someone facing the same issue!

- id: Webhook received 
  alias: Webhook received
  trigger:
  - platform: event
    event_type: ifttt_webhook_received
    event_data:
      action: call_service
  condition: []
  action:
  - choose:
    #IF State in trigger  
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.state is defined }}'
      sequence:
      - data:
          entity_id: '{{ trigger.event.data.entity_id }}'
          state: '{{ trigger.event.data.state }}'
        service: '{{ trigger.event.data.service }}'
      #ELSE no state in trigger        
    default:
    - data:
        entity_id: '{{ trigger.event.data.entity_id }}'
      service: '{{ trigger.event.data.service }}'