This object is in archive! 

Toggle between scenes in a rule

Magnus Wingqvist shared this question 8 years ago
Need Answer

Hello,


Can I toggle between 2 scenes in a rule? Have 2 scenes, lights on and lights off. Wan't to toggle between these by a http request. Created a virtual meter that triggers on a value 1. Can I use this to trigger scene toggle?


Or is there a better way to solve this?


Why? I'm using DO ifttt for triggering. Have created a button for "toggling", this sends a http request with a value (1) to Zipabox.


Regards

Magnus

Replies (8)

photo
1

I think it would be easier to use a virtual switch.


When - virtual switch any

Join


If - virtual switch on

action - run scene lights on


Join


If - virtual switch off

action - run scene lights off


Not sure this is the best way. Works for me :)

photo
1

How do I toggle a virtual switch with a http request?

photo
1

I manage to solve it by using a second value in the virtual meter. One as status and one as trigger. Now, another issue. Can I create a rule that runs when a scene runs? In other words, can I use a scene as a sensor?

photo
1

Sorry. Read your post to quickly :) I use IFTTT for my geofence to turn things on and off. Someone in this forum gave me a tip to not use a virtual meter but a virtual sensor instead. Then you are able to use it with more in rules like "and" and "or" puzzels. I use the makerchannel and use the url in the "state" from the virtual sensor and add "true" or "false" depending on the action on IFTTT. Then in Zipato rules I use "when - virtual sensor active or inactive" or "if - virtual sensor active or inactive" to trigger events.

photo
1

Thanks for the info, I'm using IFTTT also but I manage to solve it with a virtual meter, but virtual sensor should be more simply and cleaner solution.


But I still can't figure out if I use the scenes manually, then the status och virtual meter (or virtual sensor) doesn't change.


One solution is to never to use the scenes "manually", but I wan't a fully secure integration without any room for mistakes. :)

photo
1

Hi Magnus, I am not fully understanding what you want to achieve. I have attached a pic of a virtual meter and how I use it for IFTTT triggers in Zipabox. If you wish to run another rule upon one triggered, just use a another virtual switch or meter. In the rule set the switch to on, then have another rule activate when this switch is on.


What do you mean "you can not figure out how to use the scenes manually?"

photo
1

This is the case. When I trigger a virtual device value, trigger=1, in my virtual device using Makerchannel in LFTTT, then It runs a rule that toggles between 2 scenes "lights on" and "lights off". The rule sets trigger value back 0 and also a "status" value to 1 if lights on or 0 if lights off (for toggling function). So far, it's working fine.

But, if someone in my family uses the scene "lights on" without triggering the rule, then it will be missmatch in the "status" value and the Makerchannel that makes the Makerchannel needed to run twice to get back in sync. Is this avoidable?

photo
1

sorry still not comprehending. Could you attached a pic of the rules?

Try using a virtual switch in the on scene. The on scene can activate the switch to on. Then your IFTTT rule can activate only when the virtual switch is in the off position. And again in the off scene it can turn the switch off. Is this what you mean?

photo
photo
1

Can I use a scene as the same way as a sensor? If I run a scene, then something will happend? (When <scene>)

photo
1

afraid not, again easiest thing to do is include a virtual switch or meter to trigger another rule.

photo
Leave a Comment
 
Attach a file