I have working IFTTT Maker channel to set the state of my sensor (sensor.ring_doorbell_motion) to ‘on’, now I want to set state of that same sensor to ‘off’ after 15 seconds. I was thinking to write automation/script which triggers when state changes to ‘on’ by IFTTT Maker channel and then add delay of 15 seconds and try to reset it to ‘off’. I could not figure out a way to do it using automation/script. I can think of writing a external command/batch file to make rest call to Home Assistant with ‘off’ sensor state but looking for easy way to do it. Any help how to achieve it? I did search forum but did see anything which can help.
Thanks all.
Do you only want this state to go from ON to OFF if IFTTT sets it? Or anytime the state goes to ON?
If you simply want to make a state go from ON to OFF after 15 seconds then:
- alias: "Switch ring_doorbell_motion to OFF"
trigger:
platform: state
entity_id: sensor.ring_doorbell_motion
to: 'on'
action:
- delay: '00:00:15'
- service: ****
entity_id: ****
I put in the asterisks because I don’t know enough about the doorbell to know how Home Assistant can interact with it. I assume you already know this piece? If not, I can probably help you with some screenshots of your services and states from the developer tools section.
Thanks for the reply.
Yes, I want state to go off in 15 seconds once set on from IFTTT; as this sensor is created by and updated by only IFTTT using Maker channel using following information and Home Assistant has no idea what kind of sensor it is and how it gets sets/resets, there is no component connected to it.
URL:
https://********.duckdns.org/api/states/sensor.ring_doorbell_motion?api_password=*******
Method:
POST
Content Type:
application/json
Body:
{“state”:“on”, “attributes”: {“friendly_name”: “Doorbell Motion”, “icon”:“mdi:bell-ring-outline”} }
So as you mentioned what do I need for service?
- alias: “Switch ring_doorbell_motion to OFF”
trigger:
platform: state
entity_id: sensor.ring_doorbell_motion
to: ‘on’
action:- delay: ‘00:00:15’
- service: ******
entity_id: sensor.ring_doorbell_motion
In the above automation what service I should use? Can I use homeassistant/turn_off or something else?
Once more thanks a lot for your help.
I am having the same problem, did you ever figure out how to do it?
No, I don’t have any solution to set sensor state within HA but I did use command line component to call my python script to reset it using rest call to HA for that sensor.
Hope this helps
which kind of sensor did you use? can you show the setup of your sensor?
My config file has sensor like below and gets updated to ‘on’ by IFTTT Maker channel not from the Home Assistant, but once updated by Maker channel I want to reset it back in 15 seconds withing Home Assistant automation rule.
- sensor.garage_door
Thanks
I’m also new with Home Assistent, so I was wondering what kind of type sensor you used for retrieving data from ifttt, and how you setup. If you could show your configuration of the sensor, it would be a great help for me as well…
I would create a similar thing as you, because I’ve also a ring doorbell. I would create a log file on my Home Assistent.
Below is my setup in IFTTT
If part:
Channel: ring
Trigger: New Ring Detected
Then part:
Channel: Maker
URL: http://your_ha_url:8123/api/states/sensor.ring_doorbell_ring?api_password=xxxxx
Method: POST
Content Type: application/json
Body: {"state":"on", "attributes": {"friendly_name": "Doorbell Ring", "icon":"mdi:bell-outline"} }
That should set state of Ring Doorbell in your Home Assistant with nice icon too.
Only thing is it will stay ‘on’ with that state unless you have some mechanism to reset it. As a work around I am using python script to reset it after 15 seconds.
Hope this helps.
Thank you, but that part I already figured out… But how do you setup your sensor in your configuration yaml?
What kind of sensor do you use to retrieve the data? a template sensor, html sensor, etc? In other words, how and which sensor did you define in your configuration.yaml?
Nothing in configuration.yaml but only in groups.yaml to show it somewhere like below:
- sensor.ring_doorbell_ring
But if you call your sensor in the groups, you also need to define those in your sensors???
No, you don’t need to define it. UI will not show the sensor until the value is pushed from the Maker channel. Once value is available it will show up in the UI. Good part is it will not give you any error if value doesn’t exist until someone rings your doorbell.
It doesnt work, nothing is showed on my frontend… I pushed several times, nothing happens
after several times pushing, it showed up… seems that ifttt is not that reliable… it has sometimes huge delays…
Agree,
I have noticed too that Ring also has issue of reporting delayed by couple (few) seconds.
The latest time, I got several problems with my ring, it does not always send me notifications. Mostly when I logoff in the app and logon back, it will be online… Its annoying… when it works, its great, when it doesnt its very annoying…