IFTTTs, webhook, automations

I have had little to no success executing the “vacuum.send_command” as we have to pass a parameter. When Parameters are involved, the workaround I have done is to have them execute as a script. For instance, I execute the vacuum_clean_zone script via IFTTT integration using script name.

For instance, on IFTTT, body of web request look like this:

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

Assuming you have already setup the HA IFTTT integration, the automation.yaml file should have the following:

- id: ifttt_trigger
  alias: Receive from 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 }}'

In the script.yaml file I have:

vacuum_bedroom:
  alias: Vacuum Bedroom
  sequence:
  - data:
      entity_id: vacuum.my_vacuum
      repeats: 1
      zone:
      - - 21771
        - 18454
        - 26071
        - 22904
      - - 26087
        - 18498
        - 29287
        - 21398
    service: xiaomi_miio.vacuum_clean_zone