Run pump x min on, x min off on continuous loop?

For what it’s worth, I created my virtual switch using the IDE. It is marked as local.

You have to go in to IDE and make sure the virtual device is set to your hub. Once you set that, it’ll show as local.

2 Likes

Still “Smart”…I have a handful of basic motion light sensor switches (closets, laundry room, etc.) that are standalone and I NEVER have to worry about them not working because of some cloud glitch. I wish all the other stuff was that reliable but unfortunately, the more components you add, the more points of failure are added as well. Sometimes, simple is best.

My recirculating pump has a built in timer but I chose to go the other “Smart” route…So far, everything has worked great and no complaints. Here is the Piston to give you an example of how I made my pump “Smarter”…Of course this is way overkill for your needs but you can get an idea of how you can dig down deep using webCoRE to accomplish all sorts of things. You should really consider giving it a go.

1 Like

I just used the new app to add a smart lighting routine with a virtual switch and a Fibaro dimmer. both devices run locally and now so does the smart lighting automation.

I have not used the Virtual Device Creator smart app. I created mine in the IDE. Maybe that’s the difference? I am on the EU instance so my link to the IDE is https://graph-eu01-euwest1.api.smartthings.com/ Depending on where you are, yours may be different.

In there select My Devices and then + New Device. Give it a name, a device ID (something like FFEF) and select virtual switch as the type. It doesn’t hurt to select the location and hub as well.

After all this though, Webcore would be a better way to accomplish the whole task.

Ok, progress. I had to go into IDE and set the virtual switches to my hub as Andrew C suggested above. After that they became local. After that I was able to set my 4 automations to local. So what was previously running in the cloud is now running locally. It’s still the same automations and I suspect they will fail just as in the cloud. I will report back in a few days just in case anyone is interested. If it still fails I will likely move unto webCoRE or maybe just keep my electronic plug in timer. Thanks everyone for your help.

3 Likes

Glad to hear it.

Good news on the progress.

Failed. The continuous loop managed to run 3 days until one of the virtual switches failed to shut off at the time set up in power allowance of the automation which stops the loop. So basically 2 virtual switches running the above loop whether locally or in the cloud fail in about 2 to 3 days . This is without any connection to my real switch yet so no signal issues.
For now I’m back to my $15. digital timer which runs without issue. I may set this up and run the same test in Webcore if I find the time.

1 Like

Headache over…

If that happened yesterday, it was likely because the hub rebooted after the firmware update.

My outlet/virtual switch power allowance loop runs for months but gets broken every time the hub reboots.

2 Likes

So glad you caught that. I didn’t even think to check anything being I had this fail so many times in the past when it was in the cloud. However, I did have a good feeling this time when it made it to three says when previously it was more like 2 days but that went away quickly when it failed. I did check and failure was right at hub reboot time. Test is restarted.

2 Likes

A question about webCoRE. What happens after a internet disconnect, hub reboot or power failure? Will the on/off loop restart automatically or does it require intervention?

1 Like

Using triggers (think of action verbs) such as Stays, Changes, Rises, Happens, etc., the timer will reset once power is restored. Using conditions (think of the current state) such as Is, Was, Changed, etc., it will need something to trigger the Piston such as all conditions being met.

So it sounds like your webCoRE Piston suggestion above will automatically resume after a power failure being it is using “stays”. I guess I will move onto webCoRE. Thanks for your help.

1 Like

Hello, @mpnret

Another approach that you could try to develop your automation, is the Rules API. With it, you can define your conditional statements in a simple JSON format.

See the example below that describes the next workflow:

  1. If GE-SmartSwith is ON
  2. Wait 1 minute and turn OFF
  3. Wait 19 minutes and turn ON

This basic Rule will maintain the loop active, as it detects the switch state as ON.

{
    "name": "Example Pump Automation - Turn ON for 1 minute - Turn OFF for 19 minutes",
    "actions": [
        {
            "if": {
                "equals": {
                    "left": {
                        "device": {
                            "devices": ["Your-GE-SmartSwitch-ID"],
                            "component": "main",
                            "capability": "switch",
                            "attribute": "switch"
                        }
                    },
                    "right": {
                        "string": "on"
                    }
                }
            },
            "then": [
                {
                    "sleep": {
                        "duration": {
                            "value": {
                                "integer": 1
                            },
                            "unit": "Minute"
                        }
                    }
                },
                {
                    "command": {
                        "devices": ["Your-GE-SmartSwitch-ID"],
                        "commands": {
                            "component": "main",
                            "capability": "switch",
                            "command": "off",
                            "arguments": []
                        }
                    }
                },
                {
                    "sleep": {
                        "duration": {
                            "value": {
                                "integer": 19
                            },
                            "unit": "Minute"
                        }
                    }
                },
                {
                    "command": {
                        "devices": ["Your-GE-SmartSwitch-ID"],
                        "commands": {
                            "component": "main",
                            "capability": "switch",
                            "command": "on",
                            "arguments": []
                        }
                    }
                }
            ]
        }
    ]
}

I hope this results useful to you,
Erick.

1 Like

It took a bit but I managed to get webCoRE loaded and running and created the piston as you suggested. It works nicely but doesn’t start back up after a power failure. If I manually change the state of the switch it starts back up.

Hi Erick,
Thanks for your suggestion of the rules API and the example you provided. Where do I even begin with this? I did some searching on Rules API and it started mentioning loading Postman and things started to look complicated. Can you point me in the right direction or should I just leave this one alone?
thanks,
Mike

1 Like

I think I came up with something in webCoRE that works, is pretty simple and automatically restarts after after a power failure. I will need to let it run for a few days to be sure but initially it looks good:

Every 20 minutes
Turn on
Wait 1 minute
Turn off
Wait 19 minutes

1 Like

The more you play around with webCoRE, the more you will realize that there are multiple ways to create a Piston to achieve the same result. The timers are more advanced but yeah, that should work even without the last wait segment.

I have failsafes built into most of my Pistons which are basically additional If blocks for checks and balances.

Glad you got it figured out!

Hi, @mpnret

You can create your Rule Automation using either Postman or Insomnia. Personally, I’d suggest you to use Insomnia, as it has a simplier and intuitive UI to perform your API calls. Please, follow the steps below:

  1. First, you must create a Personal Access Token that you’ll be using at your Requests Headers to the SmartThings API.

  2. Then, you must get the list of your devices making a GET HTTP Request at the SmartThings Devies API and track your GE SmartSwitch’s Id.

  3. Finally, update the JSON file from above with your GE SmartSwitch Id and make a POST Http Request to the Rules API.

I hope this information results useful to you.

Best regards,
Erick.

1 Like