Is it possible to use the Advanced tab of the PLEG device to add a storage for a variable? My thought here is around using the currently device instead of the Variable plugin for storing variables. I want to use one PLEG device for my thermostats, and would like to leverage a variable in the device to store a state of the thermostats. I use the Energy Saving Mode on my Trane thermos instead of turning them off. Just sets limits for the current heat/cool settings.
My goal is to have automated actions that will set the thermo to ESM mode when the alarm is set. The problem, is sometimes I actually put them into ESM mode manually myself. Thus, what I’d like to do is have a variable created on the Thermo PLEG for when I manually set ESM. This will let me add in logic to leave the ESM on when disarming the alarm, if the ESM mode was set prior to the alarm being armed, instead of turning it off when disarming.
You can create a new variable on any device but the device will not provide an action to set it. You would only be able to set the variable using luup.variable_set(…) from scene Luup. The advantage of VariableContainer or VirtualSwitch is that they contain actions that can be fired from scenes or PLEG logic.
I generally use VirtualSwitch or MultiSwitch plugins as state memory for my PLEG logic.
@Rex - Thanks for the input. I figured that would be the easy way to go, but was trying to resolve this using less plugins. Since I’m running a Vera Lite, I’m trying to save as much precious memory as possible. I think the amount of plugins I had recently was causing issues, so I nixed all unnecessary and trying to limit the new devices I create.
Thinking about it from a different angle, is it possible to instead do something like leverage Arm/Bypass of the PLEG that handles my thermos? My thought here would be to leverage that instead of touching the ESM status, disarm the PLEG and just changes the settings on the thermos to the same as the ESM. It would leave me with thermos saving on being used, and not regard whether the ESM is on or not. My real question comes in what happens when the PLEG is then ARMed again? Will it pickup the schedule and apply the correct settings if ESM is not on? And if ESM is on/off, will it recognize this as well and set the ESM temps?
When you put PLEG into Bypass it just blocks the actions. Putting it back into Arm enables future actions but doesn’t cause any past actions to re-fire - unless you write your conditions with terms that include PLEG’s own Armed status, of course.
So I’m thinking a little further on this tonight and had an idea that I was curious if someone could help frame the logic for.
What if I was to use 2 different conditions to actually satisfy inside the PLEG and compare which one was the more recent one to be satisfied with a True condition? My thought here, is create the same condition for both that I desire (i.e. set the alarm, leaving the house, etc). The caveat is that I add an AND condition for one with ESM On and one for ESM Off. I would then create 2 conditions for how to “resume” when coming home based on which condition was the more recent one to be satisfied.
Is there a way to achieve this logic in the PLEG? And/or is it possible that by creating 4 conditions, I’m burning just as much memory as adding in the variable plugin? I’m trying to utilize PLEG as much as I can, and so far it’s been working perfectly for my needs. Tackling the location logic with iPhone Locator next while saving battery using PLEG for mute/unmute. Appreciate any advice or direction that can be provided here.
All riggers and conditions get a timestamp when they become true so it is easy to do what you are considering. You can test the order of the timestamps using a sequence expression like this:
GoingOut motion-sensed and (door-opened; motion-sensed) ComingIn door-opened and (motion-sensed; door-opened)
Best Home Automation shopping experience. Shop at Ezlo!