Sensor for IFTTT

Hello, I’am also new here with Home Assistent.

I was wondering how to create a sensor to retrieve data from IFTTT?
What kind of sensor do I have to create? And how to setup?
So I need a little help for defining that in my sensors.yaml file…

  • platform: ???
    name: my sensor name
    ???
    ???

The part of IFTTT I understand, but not yet the part in home assistent.

I’ve seen IFTTT used as a trigger but I don’t know how you’d use it as a sensor; can you be a bit more specific about the IFTTT side of your equation?

What I want to create is a visible log file when someone last pushed my doorbell.
I’ve a Ring Doorbell. IFTTT can connect Ringdoorbell as trigger.

So, in my IFTTT I used if Ring Doorbell ring then do Maker

In maker I have: (webrequest)

URL: http://IPADRESS:8123/api/states/sensor.ring_doorbell_ring?api_password=xxxx
Method: POST
Content type: Application/json
Body: {"state":"on", "attributes": {"friendly_name": "Doorbell Ring", "icon":"mdi:bell-outline"} }

I follow the steps explained: https://home-assistant.io/components/ifttt/#sending-events-from-ifttt-to-home-assistant

However, like above, it will send it to a sensor…
So in that case, a sensor need to exist to receive that command…

My question is, what kind of sensor do I need to create to receive to receive the value of the state… There are a lot of sensors, like http sensor, template sensor, command line sensor…
Which sensor can be use to get his data from outside?
And how do I need to setup that sensor in my Home Assistent?

1 Like

Seems that IFTTT automatically create a sensor, when its triggered…so no need to create one…

Topic can be closed…

Thanks for sharing this; I have a Ring doorbell too and might give this a try.

In mij case its like this:

URL: http://IPADRESS:8123/api/states/sensor.ring_doorbell_ring?api_password=xxxx Method: POST Content type: Application/json Body: {"state":"{{CreatedAt}}", "attributes": {"friendly_name": "Doorbell Ring", "icon":"mdi:bell-outline"} }

in the groups, you put only

- sensor.ring_doorbell_ring

That way, it shows always when the last time was pushed on the doorbell

2 Likes

This is so cool. Can I suggest that you do a quick write up on this for the “Share Your Projects” section? I think a lot of folks would benefit from it!

Cool! Is there anyway to get the sensor to switch back to an off state after a period of time? I’d like to use this to create an automation that turns on the porch light to scare away deer eating my plants in the middle of the night. Ultimately it I want to also turn on the sprinkler when they show up as well.

I tried the same thing with my Ring Doorbell (I don’t actually use it anymore as the latency on the IFTTT channel is slow, which makes it useless)

I have a simple bash script named ring_reset.sh which resets the sensor state via an API call

curl -H "Content-Type: application/json" -X POST --data '{"state":"off", "attributes": {"friendly_name": "Front Door", "icon":"mdi: bell-outline"} }' https://myserver.com/api/states/sensor.ring_doorbell_ring?api_password=********

I then have an automation script which calls this script whenever the state changes to on/pushed (after a 5 second delay), this means that the sensor is reset back to an off state

hide_entity: True
trigger:
  platform: state
  entity_id: sensor.ring_doorbell_ring
  to: 'pushed'
action:
  service: shell_command.ring_reset```