CoRE - Get peer assistance here with setting up Pistons

I’ve posted this to a “Ring Doorbell” thread as well, but thought someone here might also have an idea re: CoRE, which I am just learning. Basically have a easy piston setup to turn on front 2 porch lights when Ring detects motion, and then turns the lights off after 2 minutes. Problem is that the Ring interprets the lights going back off as motion and then the piston/rule kicks off again, putting the lights back on for another 2 minutes and then into an infinite loop. Is there something in CoRE I could utilize that would perhaps check to see if this piston “just ran” (for instance, in the last 1-2 minutes) and then NOT run it again, but have it valid to run again OUTSIDE that 1-2 minute window ? I’ve put WAITS into the conditions but, TBH, I’m not sure they’re having any affect.

I just installed Core yesterday so these might be easy/dumb questions.

I am attempting to create an automation that changes the color of hue lights based on the temperature outside. I created a basic piston with the following pseudocode:

if accuweather connect temperature is between 40-49 degrees change the color of lights to “white”.

Fairly strait forward, however the lights are not changing color. The temperature reported from accuweather is 45 degrees outside and the piston is reporting a current evaluation of true.

Is there a polling interval that needs to occur for the trigger to occur?
Anyway to troubleshoot or debug?
Do the smart things manual settings on the device overriding the piston settings?

Also, I see on the tread where other folks have posted their piston in the form of screenshot show the text version of the logic statements. Where can i find this information in the app?

In your task that turns on the porch light, add a set variable boolean to true, then add a wait 2 minutes, then another set variable to reset it to false.

Now use that variable in your condition set to turn on the light only if the variable is false. I hope that made sense :slight_smile:

Yes that’s correct.

I just started using CoRE (really just started with HA too) and love the degree of customization available.

Have a question regarding piston stability/bug. I searched the forum but couldn’t find anything & slowly reading thru the threads to learn more about CoRE.

Say, after setting up a piston that is functioning fine, I found that sometimes it will not trigger, then I go into the piston to check it & the triggers/conditions have disappeared? At first I was re-adding the triggers/conditions but then noticed after selecting the option to rebuild the piston, the original triggers/conditions would reappear & join the ones I just added. So now if I ever find them missing, I’ll just select rebuild & they return. Is this either a bug or did I as a user do something/omit something that could have caused the issue?

I’m trying to enable IFTTT in CoRE, but when I tap from the CoRE screen to go to IFTTT and get the maker key, I’m not getting anything called a “Maker key” on the IFTTT page that appears. I am confirmed as connected to Maker if I tap on the Settings (gear) icon on the Maker page, and there is a URL provided: https://maker.ifttt.com/use/<bunch of letters/numbers>.

Status on that Maker setttings page on IFTTT shows Active, there is an Edit Connection link but clicking that doesn’t bring up any UI.

I tried putting the whole URL from the Maker settings page into CoRE, and also tried putting in just what looked like the “key” portion of the URL into the Maker Key field in CoRE, but when I hit Next, even though the app tells me I’ve connected CoRE to IFTTT, when I hit Done it keeps taking me back to the IFTTT connection screen in CoRE, and if I hit back from there to go back to the CoRE general settings screen that I start the IFTTT integration from, it says CoRE is not connected to IFTTT. <aigoo!>

Kinda stuck in a weird loop…appreciate any help with this.

Thanks. Appears you have an iPhone - I don’t see anything in my Android IFTTT app like the step/options you describe above.

And I looked around and I can’t find the word “channels” anywhere in the app, in settings or anywhere else. Weird…

Post a pic of your piston using the steps below:

Can someone help point me towards the right logic for use with my Harmony Hub. I currently have a piston which has all harmony “switches” (each activity is a switch) in on large trigger that says “stays on for 2 hours”. Then I can take an action after they stay on for 2 hours. This works, but if the activity changes (from Chromecast to TV) I believe the counter starts over due to the timer applying to each switch individually. (maybe it is because it goes off then immediately back on for the new activity?)

I noticed there is a Media Controller object, so I tried making a rule based off of this. The problem being that the default off state returns a value of null, so I haven’t found a way to say when not off for 2 hours, because I can’t say when stays away from null in my piston. Perhaps if there is a wildcard that will match anything BUT null, I could use that?

This might get even more complicated as I am not 100% sure if switching activities is seen as “off” and then immediately “on” again on the switches or even on the hub. So if I can find the correct logic/comparison I may need to complicate it by adding in a bit of a latching so that it has to stay off for at least 1 minute before resetting the counter.

So… if anyone has some suggestions on how this might be configured, please let me know.

Ok so I played around with the fade to level like you have it pictured. What I noticed watching the dashboard is that the fade to level (120s) and wait (125s) actually start at the same time. So its seems like its trying to do everything almost at the same time (5s between actions). This may be why its not working out how your expecting. What I did was keep the fade to 120s and increase the wait to 250s. Since the timer starts at the same time its now doing what your expecting I believe (effectively still only waiting 125s). If you want to try this as single piston use a latching and put your motion in the first if and your home changes to night in the but if. Basically just copy your 2 pistons over to a latching. I would however restrict all your motion actions to home only and use cancel on piston state change too. I also setup my motion pistons a bit differently than you have it but I have seen others here do it the way you have posted as well. Theres multiple ways of doing things with CoRE and that’s the beauty of it. If it works the way your expecting than no need to change it. Hope this helps.

1 Like

Can someone help me. I want the second or to be an and. How can I get this to be away or vacation and motion or sensor?

Sooo, I thought this through and you gave me another idea. I think this is working. Instead of the manual variable, I am now checking to see if $currentStateDuration is less than 50,000. If it is, then it just ran (in most cases I can think of anyway and during my initial testing).

1 Like

Hi, I’m new in core. I wonder how can I create 1 piston with multiple if else. I currently try to write a piston for remotec device which include 24 buttons, each button control a light/scene/mode. I would like achieve something like followings:

if(button==1){
then do something
}else if(button==2){

}else if(button==3){



}else if(button==24){

}

Please advise. Thanks

@eibyer & @anon36505037:

It was the OATH - I wasn’t aware that was required and don’t think it’s indicated anywhere in the flow. Thanks for helping me sort it out - IFTTT is now connected.

Thanks!

Use a basic piston and create groups in the conditions. Once you’ve created more than two, you can change it to ELSE IF.

Fellow CoRE masters… Ithere has been a lot of new faces here over the past couple of months, so I thought I would throw out this lesson learned for the new guys…

1 Like

How about “Then” inside each condition.

I’m having trouble figuring out how the nested (grouped) conditions are formatted in CoRE.

What I’m trying to do is… when I’m leaving the house, turn off a group of lights if it’s daytime, and turn them on if it’s night time. (Sort of my own “Hello World” program fore core. :slight_smile: )

IF {switch is on} THEN

    reset the switch

    THEN IF {daytime}

        turn lights off

    ELSE

        turn lights on

    END IF

END IF

For some silly reason, I can’t wrap my head around how to set this up with the grouping workflow

EDIT:

Ok, this seems to work, but is it the cleanest way to go about it?

Have a strange issue and I am not sure where the problem is, I have a small Hue setup with 3 colour bulbs and a light strip, I am using the Hue B Smart app and DTH’s and using the Smart things app everything works quickly and as expected but when I try and setup a simple rule in CoRE to change the colour it doesn’t work, I can turn the lights on and off but they never change colour - E.G

What happens if you use set colour to blue?