CoRE - Get peer assistance here with setting up Pistons

Hi all, thanks so much for all the help. I’m looking for a solution for motion sensors and physical switches.

Master bath has a motion sensor and a switch. When motion is active, lights should come on. When someone leaves the room and physically hits the switch, lights should go out. Lights should also turn off after a time of inactivity.

Problem is, when someone hits the switch to turn lights off when they leave, the motion is still on active, so it turns the lights right back on.

I’ve tried using “motion changed to” active (instead of “is”). This works but there’s a problem waiting to happen: if someone leaves the room, hits the switch, but goes back in before the motion has reset, the lights will never turn back on.

This has to be a common problem… But I’ve searched previous threads to no avail. (One day I’ll read this entire thread I swear)

quote=“ady624, post:7546, topic:50187, full:true”]
Any errors in the ide?
[/quote]
Nothing at all in IDE, so not sure it is even working.

Do you have debugging enabled in that piston please?

I’d like to have the following run

If Routine “I’m home” ran
AND front door is closed
Turn on light
Wait 15mins
Turn off light

But I’ve got another trigger to turn it off with a global variable when the front door is opened.
I want to cancel the wait if on this piston if the front door is opened, selecting cancel on piston state change doesn’t work for me, the timer carries on even if the state of door changes.

I just enabled it and tomorrow I will try. I think my error is in the first AND variable as I know I didn’t do the maildelay correct. If you can give me the instructions for the first variable I will be fine after that. Thanks. Below is what was in IDE after I ran the .simulation. I have two sims the last was when I hit done.
<img src=“//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/smartthings/original/3X/7/4/74f04bc17988f062785b4bcc6b85086019f0ca00.png” width=“690”

I just did the Piston all over again,still not sure if it is correct. But here it is below. If I am making a mistake it looks like the same mistake.

The First is new code for speak using speaker R1, the second was my working code using media player. I need the one on the left to work.

,

Case Study - Toggle Light with Delayed Off

You were correct in part about the motion sensor whether to use ‘is’ or ‘changes to’. I also had to play a lot with nested conditions and when to call them.

Press the button, the light turns on.
Press the button, the light turns off.
Trigger the motion sensor, lights go on. If you forget to push the button, light goes off in 60 seconds.
Trigger the motion sensor, lights go on. Push the button, lights go off.

The first ‘if’ statement is a nested statement [A and B] not simply A and B. The ‘B’ side of this condition is testing if the motion sensor ‘is inactive’. We want a working button first without interference from the motion sensor. You’ll note I’m using a ‘Toggle’ to turn the light on/off.

The second condition, ‘ELSE IF’ is testing if the motion sensor ‘is active’, NOT changes to. If true, turn on the light. If false, wait your wait time and then toggle the light.

Requires:
1 bulb
1 motion sensor
1 button

Piston Mode: Basic

Before starting piston, set CoRE for expert mode: Settings->ExpertFeatures turn ON Expert Mode

1 Like

i have a couple of contact sensors that when triggered will output “dogs barking” as shown on this selectable options.

i can’t seem to find anyway to integrate this directly in CoRE. i however can achieve this using Echosistant.

for me to get this to happen in CoRE i had to integrate the Echosistant profile/s to my piston.

is there any direct way to achieve this in CoRE?

thank you.

Simplified version of what I’m trying to do. If the Routine is ran, then within 30 seconds there’s motion it should turn the light on but not set the light to red. It carries on running though. Any ideas?

Does this code even look correct? Why is it purple on the variable at the top?

The variable is showing blue because it is true. i.e. it is false which is true.
When your mailbox changes to open that will turn blue and the whole piston will become true.

Does my code look correct? This is what I want to do.
What it should do is when the mail box contact is open it speaks from my speaker and sends a push notification then waits 5 minutes before it will speak again when contact is opened. This gives me 5 minutes to get my mail without push and a voice notification. I think I screwed up the AND, can someone talk me through it? When I was trying to create the AND I couldn’t figure out how.

It will only speak once.
Do you want it to keep repeating every 5 minutes while your mailbox is open?

Hello,

I’ve been trying to setup a new piston, but have really been struggling to nail it down. I’ll try to describe the logic and hopefully someone can help me a bit.

I have two smart plugs that I want to be switched on Monday-Friday between 6:30-18:30 and off all other times. I also want them on anytime person1, or person2, or person3 are present.

I’ve got a basic Monday-Friday 6:30-18:30 automation setup as a separate rule at the moment which takes care of the most important part of the automation. It’s the last bit I can’t get. I’ve been trying to set it up something like this:

IF person1, person2, person3 are NOT PRESENT; AND IF it’s NOT 6:30-18:30 on Monday, Tuesday, Wednesday, Thursday, Friday; THEN turn plugs off.

Whats the best/simplest way to program this?

Thanks!

If you want it to keep repeating just do:-

IF
Mail box contact is open

THEN
Using Samsung R1.

Speak text.
Send Notification.
Follow up with My Mailbox piston after 5 minutes.

This way as long as your mailbox contact is open it will keep repeating every 5 minutes.

If you want to do it a set number of times you can use a variable that increments by 1 every time it speaks up to a set number.

I want it to speak as follows.

  1. Door Contact Opens

  2. Send Push

  3. Speak once

  4. Wait 5 minutes before it will speak again if door is opened, that gives me 5 minutes to get to the box

Just tested it sends the push but no voice.

Have you tried it with a global variable? Put @ in front of the variable name.

Gavin, are you referring to my problem?

I was - but i see your issue now is the text to voice not working, but you get a push alert. So i don’t think it’s your piston but the voice integration.

Is there a way in core to send an alert if a device is not Polling. Here is my goal. Recently my garage fridge lost power because a GFI breaker tripped. I did not have my fridge on any sort of smart connection, so I did not know. Fortunalty it was only off for a few hours and nothing was lost. I then thought to my self that I have a Z-Wave Metering plug sitting around not being used. I plugged the fridge into that, but cannot figure out how to get an alert when its not getting power. I tried monitoring when the power usage was below 2 watts, but of course the plug does not report usage when there is no power.

Anyone find a way to trigger a core when something is not reporting?

I have tried music player/ speech renderer and it worked once when I choose Music Player. Is there a way to tell if the speech was rendered as I am alone now and the speech will sound before I get back in after opening the mailbox?