IFTTT Switch

I have a fan that can only be triggered from IFTTT. I created the triggers and added the integration to home assistant. I also made the webhook recipes in IFTTT to call the bond fan controller.

From what I gather I need an input boolean to track state. So I made this:

input_boolean: 
  lr_fan_light:
    name: Living Room Fan light

That shows up in the dev states fine as off. Trying to figure out the format for this switch has me lost though.

Before it was a command line switch like this:

- platform: command_line
  switches:
    living_room_fan_light:
      friendly_name: "Living Room Fan Light"
      command_on: '/usr/bin/curl -H "BOND-Token: <token>" -i http://x.x.x.x/v2/devices/00000041/actions/TurnLightOn -X PUT -d {}'
      command_off: '/usr/bin/curl -H "BOND-Token: <token>" -i http://x.x.x.x/v2/devices/00000041/actions/TurnLightOff -X PUT -d {}'

My new fan doesn’t support this method. I just need some direction on how to make an ifttt.trigger switch that can remember state. I’ll take any direction you can offer. I am still a newbie so sorry if my lack of knowledge is a drag. I tried a lot of different configuration methods I have found but I can’t get it to pass a configuration check. Thanks for your consideration. I will supply more info if that helps.

1 Like

Okay figured it out.
In case this helps anyone.

input_boolean: 
  lr_fan_light:
    name: Living Room Fan light

and the switch

- platform: template
  switches:
    living_fan_light:
      value_template: '{{states("input_boolean.lr_fan_light")}}'
      turn_on:
      - service: ifttt.trigger
        data: {"event":"lr_fan_light_on"}
      - service: input_boolean.turn_on
        entity_id: input_boolean.lr_fan_light
      turn_off:
      - service: ifttt.trigger
        data: {"event":"lr_fan_light_off"}
      - service: input_boolean.turn_off
        entity_id: input_boolean.lr_fan_light