You can accomplish this by using a custom Hue Connect service manager. There are several to choose from - try searching for “hue connect”.
Okay I have been lured back in and setup CoRE and starting to rebuild everything from the ashes.
Using principles @bamarayne @SBDOBRESCU @bridaus use, I am going to greatly reduce/simplify actions taken by ST functions - such as routines, etc. - based upon the principle they time out within ST?
So to do so I am taking such group actions and having CoRE run them under the premise that CoRE creates individual tasks for each action… I think I remember reading that anyway.
I have moved a few test things over, I have question now on calling Pistons.
QUESTION:
If I want a piston to execute another piston - the only way I can currently get it to do so is to set no conditions and negate that no condition in the piston to be executed. What is the the right way to setup a piston that will only be called upon to be executed by another piston and you don’t really want triggers or conditions?
Was about time! Let me know how it goes for you, maybe I dive back into it too
Good luck!
You could use a follow up piston. To do what you are asking, first create the non conditional pain, then in the master piston chose the ‘follow up with a piston’ option and choose the applicable piston.
Something I have found that works really good is to use the ‘Simple’ piston. I leave everything blank except the ‘Else’ block. This is adv example of one I use. This particular piston is called to run by the askAlexa app. There are no conditions or restrictions, only actions.
You will find that there are a multitude of ways to accomplish something. No way is actually wrong. Just go with your own logic flow and experiment… Some ways are better than others lol.
Ok, I can really use some help setting up a new Piston. Here is the scenario: I have a room with 2 doors and I want my lights in the room to turn on when I enter the room and turn off when I leave the room from either door. Each door has contact sensors, but I do not have a motion sensor in the room and don’t plan on putting one. You can assume I am present in the room when the light is on.
My guess is when the light comes on, I need to store it in some sort of variable that I can leverage in my logic, but I am relatively new to CoRE, so I can use some guidance.
Is there any way to convert the value from the HUE API to the degree CoRE is looking for?
I Have used one of those, but every time I have problems, ST support wants me to remove the custom app and use the supported app. I have to rebuild my automation every time just to prove it’s not an app problem.
Well, what color did you get for the 47126 hue? If it’s blue, perhaps hue*360/65536 would work.
Yes it was a blue. Will this formula work for every color?
It should, assuming the range your Hue is using is a 16 bit unsigned integer. That means 65536 unique values, hence the f(x) = x * 360 / 65536
You seem to be trying to use your output (lights on) as input (assume I am present when light on), which makes a circular reference. You need to first figure out when to turn on the lights without relying on the status of the lights as input. Do you want to turn the lights on and off on every other door opening? If so, you could take advantage of the latching piston’s built in logic: (haven’t tested, not 100% sure this will work, but it should)
IF
Any of two doors contact changes to open
THEN
Using light
> Turn on (only on piston state change)
BUT IF
Any of two doors contact changes to open
THEN
Using light
> Turn off (only on piston state change)
But if you assume you are in the room when light is on, how do you ever turn it off? You need a motion sensor to mock the occupancy. A variable in this case would not help. You have the state of the switch already. You can assume if the switch is on, you are in the room. Unless you think of a multi event - like variable is true when light switch is on AND the sensor changes to close or some something along those lines.
An even simpler approach, duh! Basic piston:
IF
Any of two doors contact changes to open
THEN
Using light
> Toggle
Duh to me!
Loool, toggle nullifies his intent to assume he is in the room while the light is on. That would work only if he is the only one in the house.
@Mbhforum the easiest thing to do is to keep the door cracked, so you can turn off the lights when closed.
@Mbhforum, Actually, what you’re looking for is this piston. You go in the room by opening the door, the light turns on. Close the door, the light stays on. Open the door to leave, lights stays on, close the door as you leave, the light turns off. This also allows you to turn the lights on manually and not throw the scenario out of sync.
The only flaw to this, and it’s because it’s not using a motion sensor, is if someone else comes in behind you, you’re both in the dark. The ONLY way to stop that is install a motion sensor.
Give this a shot, it works good.
Thanks. Actually, now that I think about it, your right. If I am downstairs working out with door closed and light on, and my wife comes downstairs to open the door, the light is going to go off if I toggle. Can’t I put in a rule that says “If the door is open and the light is already on, don’t toggle” though??
Yeah but when I close the door the first time, isn’t it going to turn off the lights???
No, it won’t. This piston is designed to turn on the lights with the first open and turn them off with the second closed. Trust me, I’ve been using this for a while and so has another forum member. This does exactly what I described… As long as you set it up correctly.
With what I just posted, if your wife comes in later, tell her to leave the door open when she leaves… Or else you’re in the dark.
A 30.00 motion sensor from Lowe’s is probably going to save you a whole lot of dark frustration… But if you get one let me know. I can work it into the piston I just posted… I’ve I’ve been meaning to do that, but just haven’t had a reason to yet. Lol
Thanks, after seeing that piston and looking at some of the drawbacks, I might just get a motion sensor LOL
This piston is great if you’re the only one using the room.
@Toy4Rick has a modified version of this for his garage. Maybe he can post that and how he avoids being in the dark. Lol



