Calling ifttt service

Hello,
I would like to call a ifttt applet which uses ewelink and webhooks to switch on/off an original sonoff switch.
I linked my ifttt account with my ewelink account.
Then I created an applet to switch off and another one to switch on.
In HA i placed the ifttt key in my secret.yaml file.
The i created a couple of script like:

xmas_light_on:
  sequence:
    - service: ifttt.trigger
      data: {"events":"Xmas_light_ON"}



xmas_light_off:
  sequence:
    - service: ifttt.trigger
      data: {"events":"Xmas_light_OFF"}

If I try to call the script from HA nothing happens to my sonoff switch.
Looing at the log file I can see:

2018-11-16 22:51:30 ERROR (MainThread) [homeassistant.core] Invalid service data for ifttt.trigger: extra keys not allowed @ data[‘events’]. Got ‘Xmas_light_OFF’

required key not provided @ data[‘event’]. Got None

What am I missing?
Sorry I’m quite new to this :sweat_smile:

Thank You

Regards

When I was doing this prior to flashing with Tasmota I used an automation like this:

- action:
  - data:
      event: sonoff-2-on
    service: ifttt.trigger
  alias: Home Assistant Switch On
  condition: []
  id: 'some-unique-number'
  trigger:
  - entity_id: input_boolean.sonoff_switch_2
    from: 'off'
    platform: state
    to: 'on'
- action:
  - data:
      event: sonoff-2-off
    service: ifttt.trigger
  alias: Home Assistant Switch Off
  condition: []
  id: 'some-unique-number'
  trigger:
  - entity_id: input_boolean.sonoff_switch_2
    from: 'on'
    platform: state
    to: 'off'

and an input boolean:

# Sonoff S22 Switches
input_boolean:
  sonoff_switch_2:
  name: Home Assistant Switch
  initial: on

and on the IFTTT side:

1 Like

The error message you received suggests that ‘events’ is not needed, but ‘event’ (ie try without the s).

1 Like

You are right!
Thanks!