homebridge-ifttt
homebridge-ifttt copied to clipboard
sending switch as value instead of event
I have by now +/- 15 different buttons set up in my config.json, mostly to Trigger an Automation or add a Condition to an Automation there were HomeKit currently doesn't allow it out-of-the-bow. As IFTTT makes a http-request, I also append a line to a log file in Evernote every time one of those buttons is activated, allowing me to follow up what has been executed when. Makes troubleshooting easier.
Now, because the button "trigger" is sent as an event to IFTTT, I had to make an applet for each of these buttons, every time basically doing exactly the same thing. Having the "name" sent as the event and the "trigger" as value1 would allow to simplify a lot.
I do see the value of having the "trigger" sent as the event too though, so maybe having both options available could be an idea?
Would obviously program it myself if I knew how to do so :)
You use case is not very clear to me. Can you elaborate it and make same example?
Right now, the logging and notification options to see which Scenes or automations have been executed (or at what time exactly) within the Homekit environment are pretty limited (actually, not existing even I believe).
Your IFTTT plugin makes that possible though. By sending a web request to my IFTTT Maker channel, I can create an Applet that captures this web request and upon execution appends a line in a specific Notebook in Evernote (event name & time stamp) + optionally get a Push Notification on my iPhone. To do this, I have created a (stateless) button in your plugin for every Scene and Automation that I have in my Homekit environment. In each of these Scenes and Automations, I add the specific button and trigger it as part of the Scene / Automation, so that your IFTTT plugin sends a web request to my IFTTT Maker channel.
Now, given that the Trigger value of the Button in your plugin as the Event name for the web-request, I have to create a separate Applet for each of the buttons.
A way to avoid that could be to use the Accessory name of your plugin as the IFTTT Event value that is to be included in the URL. The Trigger of the button could then be added in the optional JSON body as value1. I could even imagine some specific use cases would benefit from 2 additional fields per button (next to the now existing Caption and Trigger) to also be able to send a value2 and value3 to IFTTT.
I hope I was able to explain better now :)
{ "platform": "IFTTT", "name": "IFTTT", "makerkey": "PUT KEY OF YOUR MAKER CHANNEL HERE", "accessories": [{ "name": "Accessory 1", "buttons": [ { "caption": "A1-3", "trigger": "T1-3" },{ "caption": "A1-4", "trigger": "T1-4" } ] }, { "name": "Accessory 2", "buttons": [ { "caption": "A2-1", "trigger": "T2-1" },{ "caption": "A2-2", "trigger": "T2-2" } ] } ] }
I would like to know how how you send a body of ["1"] or ["0"]