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

I don’t see how checking the state of a device will help here. If you had a device that was always changing states then yes, that would work. But I don’t have anything like that.

When you select a device in WebCore, one of the options is status. But I can’t figure out what you would compare it to. There are no preset options for that.

Power state of the hub won’t work for me. I have mine on a UPS. Unless if the hub is offline then the power status would show up as nothing??? I might try that.

I set up a piston to execute on a timer, used 1 minute for testing, then put in an IF statement to check for power status of the hub. Unplugged the ethernet from the hub. Tried over 5 minutes and never got a result back from the power status. So unless there is some way to force a read of the power status, I don’t think that will work.

You are probably referencing the $status attribute. It directly reads the device’s Health Check Status. Unfortunatelly, there is no preset list of possible values, which led to some devices reporting as ACTIVE / INACTIVE and some as ONLINE/ OFFLINE. And some report as UNKNOWN…

1 Like

I kinda figured it was ambiguous. Just trying to figure out some way to determine if the hub is offline.

Ady did you see c1arkbars post when he tried it he wrote the max expression just as I did and it appears to have worked for him

EDIT: after much testing I believe this to be the correct way to write it. Thanks for all the help and tips, much appreciated


Actually, my use-case is different. I’m wanting to check the online status of ip-addressable things that are not known to ST.

I’ve tried using various forms of HTTP get and checking the response codes, but (as more knowledgeable networking experts here could probably have predicted since that’s much different than an ICMP ping) that didn’t work.

I’ve been banging my head on this for a while, so I’m just going to ask. How does one start a while loop in Webcore? I can’t find the option for it.

What would be the easiest way for me to prevent a piston from running if it ran in the last 5 minutes? Set a variable to runtime and then check it?

After starting a new piston click options and enable ‘Advanced Statements.’

1 Like

How do you check the response codes for an HTTP get? I see where in Webcore to program the get, but can’t seem to figure out how to get the response code.

I believe there’s a system variable $httpResponse?

Correction: integer $httpStatusCode, boolean $httpStatusOk

1 Like

They don’t seem to be of much help. If I do a get with the hub hooked up I get a code of 408 and a statusok of false. If I unhook the ethernet from the hub I still get the same values. I wouldn’t care what the values are if they were different when it is hooked up and when it isn’t. But they aren’t.

I’ll have to scroll back up to see what you guys are doing lol :slight_smile:

Just trying to figure out a way to see if the hub is offline.

Trying to figure out if internet is down, or just hub is offline in general?

Hub offline in general. Since I enabled contacts I no longer get a notification if my hub is offline for any reason. I have a ups on the system so the power option is of no use.

It’s no big deal. If I don’t get the notification I’ll notice it sooner or later anyway. Just something to play around with.

I’m trying to do the exact same thing as @Jwwhite so it’s gonna be a two birds one stone advice for anyone who figure out how to do so.

Thanks everyone!

I would like to use CoRE to control my automower but I don’t know enough to dive in yet. I know that I can send GET requests to the server to control the mower but the server requires authentication and I don’t know how to incorporate the username and password. I’m not a programmer so I am looking for help in simple terms. Thanks much!

Don’t know if I’m much help but doesn’t ifttt support sending get request using webhooks, I’m guessing automation can be achieved that way by creating a virtual switch in smart things, then linking that switch to ifttt to make the get request. And automating what ever you want with conditions for the virtual switch in webcore.

As for as the log in goes I’m not sure for your particular mower but some of the things I’m used to dealing with when making web request have the login info built into the url or body

Don’t know what your are talking about :rofl: I only publish the parent app and it works fine :wink:
Am I missing something?