Help with CoRE Piston

Hi. wondering if anyone can help me out. I’ve recently moved from Rule Machine to CoRE and slowly getting the hang of it.

So I want to setup a piston.

if: after sunset
then: turn on outside lights

i have the above setup and working.

next i have another piston that is

if: door contact sensor opens
AND:
if: between sunset and sunrise
then: turn on outside lights and porch lights
then: turn off (delayed) 10 mins

this again is all working. HOWEVER. as the 2 pistons overlap. i.e. i want my outside lights on constant from sunset to 10.30pm. but the second piston overrides the first piston and turns the outside lights off after 10mins after the door contact opens.

is there a way to say if outside light already on before piston 2 runs then dont turn it off after 10mins?

think i may have worked it out. will need to test.

but looks like i can set the piston to only run if the lights are off.

example

Piston 1
if: after sunset
then: turn on outside light
then: turn off outside light at 10.30pm

Piston 2
if: door contact sensor opens
and
if: between sunset and sunrise
then: turn on outside and porch lights
then: turn off (delayed) 10 mins
(Only execute when these switches are off: outside lights)

Piston 3
if: presence sensor arrives
and
if:between sunset and sunrise
then: turn on outside lights and porch lights
then: turn off (delayed) 10 mins
(only execute when these switches are off: outside lights)

reason i didnt want to set the presence sensor and contact sensor to only active after 10.30pm is that if for any reason the wife turns the switch off physically and i arrive home between sunset and 10.30pm then the lights wouldnt come on.

1 Basic Piston in Expert mode.

  1. Use Groups where there are multiple conditions to satisfy argument
  2. Then use When True, When False
  3. Use an “Or” separator for each Group and/or Condition
  4. Be sure not to use two Triggers for one Group. However, you can use two triggers if they are separated by an “Or”.
  5. Use "Cancel on Piston State Change " where applicable.

Here is an example of using multiple conditions and/or groups in one Piston for various scenarios.

2 Likes

I love CoRE… but just FYI - you can do everything you want with the SmartLighting app. This also has the advantage of running locally on your hub (i.e., no internet latency).

It looks to me like you only need two lighting rules:

  1. Turn on outside lights (except porch) at sunset, turn off at 10:30
  2. Turn on porch light when door opens, turn off after 10 min delay, restrict to only after sunset and before sunrise.

thanks for all the options. i decided to use CoRE. mainly because i needed a few extra conditions and triggers. All seems to be working really well and there seems to be no lag.

1 Like