I have a simple device (Nordic Thingy 52) with a push button which can trigger the Maker Webhooksservice in order to pass an event (button_press
), which I am currently using to then trigger the Smart Life service's "Turn Off" or "Turn On" action.
The problem is that, since I can only pass the one event (button_press
), I have to choose whether that event triggers either "Turn Off" or "Turn On". But what I want is to add some logic to say, "If the previous request was to turn off the Smart Life device, make the next one turn on the smart life device."
So I set up a boolean `button_press` - default false
Then I set up a condition: button_on - which requires a button_press value of of true
Now I am trying to set up a logic block `button_on_true` - and in the action chains section, under Add IFTTT actions, I see IFTTT Maker Channel Event name field. What do I enter here?
I want this to trigger the smart things app on or off modes.
In my IFTTT account, I actually have two maker event applets - if maker event button_on > Turn On Smart Plug, and if maker event button_off > Turn Off smart plug. Does that mean I just put `button_on` and `button_off` in the Action chains section for positive and negative results / respectively?
If I was doing this, I’d probably do it like this:
Create a Boolean variable something like “bln_light_on” and set it to false.
Create a Boolean condition called something like “cnd_light_on” with the required state being “true”.
Create a logicblock called something like “lgc_light_on”, and choose the “cnd_light_on” condition to test. In the positive result, I’d put “light_on” and in the negative result I’d put “light_off”. Put a check in the automatic evaluation of the logicblock when the value changes (at the bottom) to get it to fire.
From the “bln_light_on” Boolean value’s save screen copy the Toggle URL and use this from your button to do the toggling of the state.
I’d then set up two applets within IFTTT to receive a WebHook from the logicblock above. For the light on applet, use the “light_on” action and of course, for the negative action I’d use “light_off”. Then for the THAT part use whatever it takes to turn your light on / off.
I haven’t tested this and can’t hand on heart say that it works, but it sounds solid in theory…