This will be your first piston. You will need to enable expert mode in the settings of CoRE to accomplish this next part.
In the IF section of your piston create a group. In there you are going to check the location mode is morning. When you do that and are back in the group with this IF statement you will see a section “when true”. Click into that and set up all the actions of fading to 0 over 2 seconds, changing the color, and fading back up. You should have these all grouped by adding a task instead of having 3 single actions.
Back out to the main group now and follow the above steps for the mode being night and away. Once you do this you should see “AND” between all your groups. Click on one and change it to “OR”. This will change all of them.
The next part will be determined by how you are currently changing modes for ST.
Since the above piston is handling the lights based on the mode you only need to worry about setting the mode and not anything with the lights.
Just to be clear that example I gave you is a single piston. It should do everything you explained you wanted but if I misunderstood you or there is more you want to add into that piston just let me know.
I don’t know if you ever got an answer. Here is an example of one of my pistons that I use the values from one RGB light set to control another.
If I change the front right set it gets loaded to the front left set. If I change the front left set, only it changes . Then if I change front right set again it will bring the front left set back in sync.
Probably a newbie question that has been ask a 1000 times before, but I couldn’t find the answer in a quick search. Apologies up front.
Is there a simple way of duplicating pistons? I have a large install and would love to be able to copy complicated pistons to then change the specific device(s) in each case. Would speed up the creation no end.
Now that my first Piston is working as it should, I’m working on my next one… Presence based on location Modes.
In this new piston I have this logic set:
IF everyone one is “not present” WHEN TRUE set location mode to “Away”
ELSE IF
Anyone is “present” WHEN TRUE set location mode to Morning/Day/Evening/Night based on day of the week and time ranges.
This one is much harder to test since I have to take all the phones out of the geofence, so I’m wondering if the ELSE IF is the correct thing to use to make this work as intended. Below is a screenshot of my actual piston:
While maybe some others in the community would know how to do it with how you built that piston I don’t. First, you are only triggering it with motion in the hallway, it won’t re-evaluate on the Bedroom Lights changing. Second, you built the actions in the THEN and not in an ELSEIF so there is no easy way I know of to do other evaluations. And you also used “only execute when” restriction which I personally don’t use so sorry it is hard for me to suggest a change there.
To do what you want I would create the piston like this:
IF
GROUP [motion in hallway AND time between A & B] OR
Bedroom Light changes to On THEN <<leave this blank THENIF
Bedroom Lights are off When True:USING Bedroom Lamp - Turn On, Wait 5 Mins, Turn Off ELSEIF
GROUP [Bedroom Lights is on AND Bedroom Lamp is off] When True:USING Bedroom Lamp - Turn On ELSIF
GROUP [Bedroom Lights is on AND Bedroom Lamp is on AND time between A & B] When True:USING Bedroom Lamp - Turn Off
I am fairly certain that will do everything you want. The way I wrote it the Lights will always shut off the lamp when they are turned on and between time A & B. If you want the turn on the lights to shut off the lamp only after it’s been triggered by the motion in the hallway just add another AND in that last group for motion changed in last ## minutes.
Well, first you’ll need to save the attribute to a variable. Then you can Load state of attributes from variable. Mind elaborating on what you are trying to accomplish?