Global Reactions - Constraints ?
-
Global reactions are reactions, not rules. Rules have constraints. Reactions do not. I don't know what "other functions like reset reaction and expressions" means in this context, either. Maybe an example?
-
Global reactions are reactions, not rules. Rules have constraints. Reactions do not. I don't know what "other functions like reset reaction and expressions" means in this context, either. Maybe an example?
-
@cw-kid said in Global Reactions - Constraints ?:
Can I trigger a rule set via a http request in to MSR?
I can't make sense of why one would want to do this. In my view, the only reason to trigger a rule is to get it to run its reaction. You can, instead, just run a global reaction with an HTTP request.
-
@cw-kid said in Global Reactions - Constraints ?:
Can I trigger a rule set via a http request in to MSR?
I can't make sense of why one would want to do this. In my view, the only reason to trigger a rule is to get it to run its reaction. You can, instead, just run a global reaction with an HTTP request.
I know I can run a Global Reaction via a http request.
I am wondering about replacing Vera scenes with either global reactions which I can do for none conditional things.
Or by being able to trigger a rule set via a http command.
These Vera scenes are generally manually triggered.
-
Global reactions are reactions, not rules. Rules have constraints. Reactions do not. I don't know what "other functions like reset reaction and expressions" means in this context, either. Maybe an example?
@toggledbits said in Global Reactions - Constraints ?:
Maybe an example?
I have some scenes in Vera that switch my house modes and do other stuff also. These scenes have no trigger, they are manual and I can run them when I either press a button in the Home Remote dashboard app or when I ask Google Home to run the scene etc.
The Vera scenes just have LUA code in them, no actions under their "Advanced Editor" section.
This is a portion of the LUA code for my Away scene. It just checks if a virtual switch is turned on or not? If its on it does not put Vera in to Away mode, if its off then it does put Vera in to Away mode and the HTTP Requests are just for TTS announcements and alert messages to Telegram.
local status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", 419) --Status of Safe to Arm virtual switch if status == "0" then --Safe to Arm luup.inet.wget("http://SOME-HTTP-REQUEST") luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","SetHouseMode", {Mode = 2}, 0) --Set House Mode to Away luup.inet.wget('SOME-HTTP-REQUEST' ,5); else --Not Safe to Arm luup.inet.wget("SOME-HTTP-REQUEST") luup.inet.wget('SOME-HTTP-REQUEST' ,5); end
My actual LUA code for this "Away" scene is a bit longer and has some function delays in it and it also puts all my Android tablets to sleep, however I cannot currently do that either, by using the VeraScenes.lua file and the Vera startup library, problems are here.
I do not know how to replicate this manually triggered "scene" in MSR.
Only way I have tried so far is to create a Global Reaction and to use the same LUA code in the Reaction. However that is not currently working and the LUA code never runs, which is this thread here.
I could potentially replicate the functionality of this LUA code in a Rule Set but then I cannot manually initiate a Rule Set and its actions via a HTTP Request sent in to MSR like I can with a Global Reaction.
So currently I cannot move this "Away" scene to MSR and delete it off Vera.
I would like to reduce the number of Vera scenes I have and use MSR instead, I want to get to the point where the Vera hub is pretty much just a Z-Wave radio and all logic is done in MSR etc.
For more simple manually triggered scenes, where they just turn something on or off or whatever, I can easily recreate those scenes in MSR as Global Reactions and I have done some already for my LED colour lighting scenes.
However for some scenes like this "Away" one that have some conditional things in them, I cannot currently use Global Reactions or Rule Sets.
-
While I'm not completely certain that this addresses the core of your question, please know that I activate many of my "manual" routines as follows:
(a) On Vera, I establish a virtual switch (e.g. VS named "Lights Out");
(b) In house, I have a 4-button remote control ("Nodon") with multi-press capabilities;
(c) On MSR, I create a Rule that watches for "Nodon" sl_CentralScene == 3 (button #1 pushed and held);
(d) All that rule does is turn on "Lights Out" VS (which is set to auto-reset after 2 seconds by Switchboard plug-in);
(e) On MSR, I have a second Rule which watches for VS "Lights Out" to become TRUE;
(f) That 2nd rule does all the things I want done for my "Lights Out" routine.The reason I do it this way is that the intermediate VS becomes a handy entry point for both the Dashboard, the Vera UI, any Lua code or related plug-ins running on Vera, as well as a visual cue in the app UI to know that the "Lights Out" routine has been triggered.
So few things appear in all those places (VS and Virtual Dimmers being two of them) as well as themselves are controllable by Alexa. If I say "Lights Out" to my virtual assistant, all she does is turn on the VS "Lights Out" and we're off and running!
-
While I'm not completely certain that this addresses the core of your question, please know that I activate many of my "manual" routines as follows:
(a) On Vera, I establish a virtual switch (e.g. VS named "Lights Out");
(b) In house, I have a 4-button remote control ("Nodon") with multi-press capabilities;
(c) On MSR, I create a Rule that watches for "Nodon" sl_CentralScene == 3 (button #1 pushed and held);
(d) All that rule does is turn on "Lights Out" VS (which is set to auto-reset after 2 seconds by Switchboard plug-in);
(e) On MSR, I have a second Rule which watches for VS "Lights Out" to become TRUE;
(f) That 2nd rule does all the things I want done for my "Lights Out" routine.The reason I do it this way is that the intermediate VS becomes a handy entry point for both the Dashboard, the Vera UI, any Lua code or related plug-ins running on Vera, as well as a visual cue in the app UI to know that the "Lights Out" routine has been triggered.
So few things appear in all those places (VS and Virtual Dimmers being two of them) as well as themselves are controllable by Alexa. If I say "Lights Out" to my virtual assistant, all she does is turn on the VS "Lights Out" and we're off and running!
I can see how virtual switches could be used to trigger MSR rule sets and I do that for some things already.
However my remaining Vera scenes are really just scenes that are manually initiated and I'd like to be able to do the same thing in MSR, without having to create a bunch of new and unwanted virtual devices.
-
If I could make one small suggestion, which may not fit your use case... namely, creating a single(!) virtual dimmer -- or even just pinpointing an otherwise unused Variable on an existing Vera device -- which MSR can watch for changes?
Then, (a) you trigger your Vera Scene (manually), (b) the Scene sets the value (of the Dimmer or Variable), (c) MSR detects the change (automatically), and (d) MSR runs the associated Rule (whose trigger is literally "Dimmer" == X or "Variable" == Y). For this setup to work reliably, I'd take it a step further with (e) MSR immediately resets "Dimmer" or "Variable" to 0.
You can tell I'm trying to get things up and running without the need for an as-yet-uncoded "Incoming HTTP Request".
-
T toggledbits locked this topic on