[DEPRECATED Thread: visit community.webcore.co for assistance] webCoRE - Piston Design Help (ask your fellow members for assistance)

Yeah … perhaps not knowing how to deal with a Line-In override is bringing things to a “resume” halt. I still have to try to confirm this myself by disconnecting my Alexa Dot & seeing what happens when I do a text-to-speech trigger. Until then Happy4th.

Why the need for the Wait 10 Seconds command?

Hm. So what’s different? @ady624, would it matter that I’m using a custom DTH, since I presume you’re just querying what capabilities are supported?

The ‘ifs’ are synchronous so they willrun one after the other.
The wait just puts a pause in before the second if runs.

This is where I’m currently at:

It would be very useful if the Piston State could indicate why a device was not turned On, e.g. “Not turned On due to Presence Sensor being absent” e.g.

Anyone have any suggestions? I posted this pretty late at night so thought people might have just missed it.

Which piston of mine did you try? I do not use restrictions, instead I just add things into the IF blocks. Try changing all your with blocks to async and then toggle the switch.

I’m trying to figure out how to run a piston on odd-numbered days only. I’ve successfully implemented a poor-man’s sprinkler system using a smart outlet, a 24V transformer and a 24V water solenoid, running from a webCore piston. Unfortunately, my city only allows for watering on odd-numbered days, so now I need to figure out how to add that logic to the piston.

Essentially I need a way to parse out the “day” from the current date, then do some math against that value to see if it’s odd or even. The wiki doesn’t show any built-in functions to parse out the date parts, so I’m basically stuck there.

Any suggestions?

thats cool.

no need to parse out the day, use the timer function statement and select the odd days from only on these days of the month.

1 Like

Doh! Sometimes we all need smacked in the head with the clue stick. So obvious.


1 Like

@949BFN thanks. did you want to do that for the piston devices 1 to 3 only? asking because i see this piston also turns on a TV and lights.

Hi @bangali. Yes - if you could just show me with one of the statements, I’m sure I’ll be able to figure it out. Or I’ll ask again if I don’t come right.

OK. understood, help me with why there is a check for image change at line 40 … what doea that do?

I use this DTH to set the time the piston has to run:

 *  On/Off Alarm Tile
metadata {
	definition (name: "On/Off Button Tile", namespace: "Test", author: "Test") {
		capability "Actuator"
		capability "Switch"
		capability "Sensor"
        capability "Image Capture"
        attribute "alarm", "string"

    preferences {
    input name: "timer", type: "time", title: "Alarm Time:", description: "Enter time", required: false
	// simulator metadata
	simulator {

	// UI tile definitions
	tiles {
		standardTile("button", "device.switch", width: 2, height: 2, canChangeIcon: true) {
			state "off", label: 'Off', action: "switch.on", icon: "st.Health & Wellness.health7", backgroundColor: "#ffffff", nextState: "on"
			state "on", label: 'On', action: "switch.off", icon: "st.Health & Wellness.health7", backgroundColor: "#00A0DC", nextState: "off"
        valueTile("alarm", "device.alarm") {
			state "default", label:'Alarm: ${currentValue}'
		main (["button", "alarm"])
		details (["button", "alarm"])

def parse(String description) {

def updated() {
        def time = timer.substring(11,16)
        def tz = location.timeZone
        def schedTime = timeToday(timer, tz)

    if(timer) {
    		log.debug "Alarm time set to: $timer"
    		sendEvent("name":"image", "value":schedTime)
            sendEvent("name":"alarm", "value":time)
    } else {
    		log.debug "No alarm time is set"
def on() {
	sendEvent(name: "switch", value: "on")

def off() {
	sendEvent(name: "switch", value: "off")

It’s an adaptation of another forum member’s piston and handler.

you could insert an if after line 136 and set the piston state there for alarm not turned on

if input switch is off OR presence sensor is not present OR temperature sensor is greater than temperature threshold
set piston state = "{Alarm is OFF; Input switch is upper([inputswitch : switch}, Presence Sensor is upper([presencesensor : presence]) and Temperature is [temperaturesensor : temperature]}"
end if

is this along the lines of what you were thinking off?

you are welcome.

Yes, I think I understand what you suggest. Actually much simpler than what I had anticipated. Thanks a million for helping!

Alright if i have GE Smart Switches that are currently tied to a simple motion lighting automation can I make the switch stay on indefinitely using two clicks up or something of the sort? So something like this:

If motion is detected > turn on light > if motion sensor changes to inactive > wait 10 minutes > turn off


switch is turned on 2x (or something) then leave switch on.


@949BFN you are welcome.

thanks for pointing me to your DTH. this is exactly what i have been looking for to set an alarm via ST and use it in webcore for wake up alarms and such.

It is not my DTH - @Arnqvist is the author. He’s made it for a piston he designed to heat his vehicle. You can find it here.