Ifttt on and off

Hi and thanks for any help
I have a led strip and i have setup the ifttt webhook one to turn it off and one to turn it on,
turn_on_led_strip
turn_off_led_strip

I have tried to add them into home assistant but all the videos and search results dont seem to work, the youtube videos are mostly from 2016 so i think thats why.

ideally i want one switch to turn it on and off but two switches wont matter. can anyone please help me out? where do i start? im pulling what hair ive got left out.

I did get somewhere once but it seems to want to know the entity name for my switch, but i havnt got one for it and dont know how to add a blank switch, if its possible?

So to make sure I understand, you have successfully used IFTTT to turn the LED strip on and off. If so, what did you put in the IFTTT webhook for each? My guess is that you can use the following to create an entity that controls your LED strip:

If that won’t work there are other ways, too, but it would help to understand the API of the LED strip.

I have an input Boolean and was able to use toggle vs on/off. I’d bet you can do the same.

it will be called switch.led_strip
Add that and restart

Before I flashed my S22’s with Tasmota, I had them working in IFTTT and Boolean Switches in HA:

# IFTTT
ifttt:
  key: enter-your-ifttt-api-key-here

We also need to add the Binary Switch in configuration.yaml. Add these lines:

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

This was in my automations.yaml file:

- 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'

Thanks all for the help, that looks a bit easier than what ive got, im using the one in another post and at the moment its working

input_boolean:
my_fancy_switch:
name: Led Strip Light
icon: mdi:led-strip
initial: off

automation:

  • alias: turn on when fancy switch on
    trigger:
    • platform: state
      entity_id: input_boolean.my_fancy_switch
      to: ‘on’
      action:
    • service: ifttt.trigger
      data: {“event”:“strip_light_on”, “value1”:“on”}
  • alias: turn off when fancy switch off
    trigger:
    • platform: state
      entity_id: input_boolean.my_fancy_switch
      to: ‘off’
      action:
    • service: ifttt.trigger
      data: {“event”:“strip_light_off”, “value1”:“off”}

Will have to adapt it even more. But i will also try the way its done above.

I do this.

I use IFTT to directly toggle the switch with a webhook jsn

https://sitename.duckdns.org:8123/api/services/input_boolean/toggle?api_password=password_here

Method Post
Application/json
Body
{ “entity_id”:“input_boolean.name_of_switch” }

Of course you can do on and off vs toggle.

I like this method because I don’t need to create an automation or script, to turn on/off the switch, Boolean, etc.

If your led is a “switch” then it would be
https://sitename.duckdns.org:8123/api/services/switch/toggle