Toggle Hive Active Lights

83 views
Skip to first unread message

Richard A

unread,
Jan 11, 2017, 11:06:07 AM1/11/17
to Apilio
Hi,

I'm trying to set up an NFC tag as a light switch for my Hive lights using Maker on IFTTT.  Unfortunately the toggle functionality is not yet available for hive lights so I thought I'd try and set up a toggle function via apilio.  I've managed to fumble my way through a bunch of arguments, but to be honest all I've managed to do is get the thing to turn on.

So, I've set up light_on and light_off web requests on Maker, which both work fine.  But I want to use apilio to trigger light_on when the light is off and trigger light_off when it's already on.  I'm thinking maybe using conditions is the answer, but I'm having trouble phrasing it. Essentially, I want the trigger to perform the following:

IF Light is on, THEN trigger light_off, OR if light is off, THEN trigger light_on.

I've set up light_off and light_on as Boolean variables and as far as I can tell they are set correctly, but I know logicblock isn't set up correctly.  It turns the light on when it's off, but doesn't turn it off when it's on.  I don't know if it's because I've basically made an unnecessarily long formula for turning the light on, or if it's just that it's not carrying out that first check - "Is the light on or off?"

Hopefully the above all makes sense.  If anyone could provide any pointers it'd be much appreciated.  I know this system is far more powerful than that, but unfortunately my chosen smart home devices are currently fairly limited in terms of what you can automate.

Many thanks in advance,

Richard

P.S. If anyone knows of a better way to automate a simple light switch function via an NFC tag, I would be keen to hear it!

pebneter

unread,
Jan 12, 2017, 1:29:26 AM1/12/17
to Apilio
Hi Richard,

try the following:

  1. Setup a Boolean Variable. I'd call it "let_there_be_light"
  2. Make a condition for it, "light_on", which requires the above variable to be true
  3. Logicblock linked to "light_on":
    1. If the Logicblock evaluates to positive, turn on the lights
    2. If the Logicblock evaluates to negative, turn light off
    3. Check the option "Automatic evaluation"
Now whenever you touch the NFC tag, your device should trigger the "toggle" action on the "let_there_be_light" variable. This will cause the Logicblock to evaluate and turn the light on or off.
In case you are controlling the light via other ways too it might happen that you have to tap the NFC tag twice in order to be in sync again.

Hope this helps!
Philipp

Reply all
Reply to author
Forward
0 new messages