HTTP Binary Sensor using IFTTT

I am trying to create a binary sensor for a door using IFTTT trigger and webhook. But it is not working as I am trying to piece together a bunch of reading.

I originally started here: Sensor for IFTTT

The api password…is that the legacy password? https://www.home-assistant.io/docs/authentication/providers/#legacy-api-password

Here are the configurations I did so far.

In configuration.yaml

homeassistant:
  auth_providers:
   - type: legacy_api_password
     api_password: !secret http_password

Then ins secrets.yaml

http_password: MYPASSWORD

In IFTTT

URL: https://domain:8123/api/states/binary_sensor.skylink_basement_sensor?api_password=MYPASSWORD

METHOD: POST
Content type: application/json

BODY: {"state":"on", "attributes": {"friendly_name": "Skylink Basement Sensor", "icon":"mdi:human-male"} }

After this when the sensor triggers, I get the notification in Hassio, Login attempt or request with invalid authentication from IP ADDRESS

What am I doing wrong here?

Also I am reading that the new method for HTTP is to use the long lived token. I have created the token, but how do I use it in the URL? What are the additional config I have to do?

Sorry, for some I know this is obvious. I am still learning and hope you guys will be patient. And I truly appreciate the help.

Ok…looks like my approach to this was all wrong. The better approach is to create and Input Boolean.

In the configuration.yaml I created the following:

input_boolean:
  skylink_basement_sensor:
    name: Basement Sensor
    initial: off
    icon: mdi:car

and in IFTTT I used the webhook method (the IFTTT integration): https://www.home-assistant.io/integrations/ifttt/

https://domain.duckdns.org:8123//IFTTKEY

URL: https://domain:8123/api/webhook/IFTTTKEY

METHOD: POST

Content type: application/json

Body:
{ "action": "call_service", "service": "input_boolean.turn_on", "entity_id": "input_boolean.skylink_basement_sensor" }

I am going to now look into how to customize the sensor further.

Hey War, would that url work does it not need to include webhook, in example :

https://yourdomain.duckdns.org:8123/YourApiKey

ps to get mine to actually work I had to remove the port from the url

1 Like