Is there anyway to get the state of a piston?
Here is what I want to do.
Piston B:
If Piston A = paused
then
Do some Stuff
else if Piston A = running
then
Do other stuff
Is this possible?
Is there anyway to get the state of a piston?
Here is what I want to do.
Piston B:
If Piston A = paused
then
Do some Stuff
else if Piston A = running
then
Do other stuff
Is this possible?
What is a use case for this? There is no easy āif piston A is paused thenā¦ā
If you are pausing the pistons via the action āpause pistonā then you could set a global Boolean variable true/false when paused/running.
If you are just clicking the button to pause then I donāt have any ideas for you.
submit a feature request for @ady624 to provide function for access to piston state attributes.
I second this request, here is a use case exampleā¦
Piston 1 a laundry monitor piston that sets its own piston state to ACTIVE if either the washing machine or dryer is currently running and IDLE once it stops.
Piston 2 is an away setting piston that monitors presence changing to ānot presentā. If everyone in the house leaves and the front door is unlocked, or the garage door is open, or THE LAUNDRY IS ACTIVE, then send a notification.
Sorry for taking so long to reply. Work has been killing me lately
Here is my use case. I have tablet controller which I use to control my hue bulbs directly through the Hue bridge. I also have the bulbs in smartThings so I can control them with motion. What I want to do is pause the piston when I touch the tablet. I know I could just create a virtual button and have that turned on/off by my tablet and then the piston A would Pause or resume piston B, but I donāt want to maintain all of those virtual buttons.
What Iād like to do is use the External URL generated for the piston to pause or resume the piston. Since I could find no way to send an update via the external URL to pause or resume the piston, I thought I could create another piston that only has an action that would Pause/Resume Piston B.
I thought about doing that, but that can cause a bit of out of sync condition. If piston B fails to update the variable for some reason then piston A wouldnāt perform the correct action. I just figured getting the piston State was more exact and leaves no chance for error.
Depending how you are executing the external URL creating another piston to pause/resume could be a single piston for as many pistons you want to pause and resume. Just depends if you are able to attach arguments to the end of the URL or not.
I am using an http gateway in an app called iRule then passing the external URL to the piston. I know how to pass params, but I have no idea how to get the piston to consume the params.
So I would put that into an if statement?
I donāt suppose you could show me an example, could you?
@bangali
Without thread hijacking too much - could you either post your WUPollenCount piston to the examples or if its already somewhere drop a link? I am working on something that needs pollen counts for my area - but trying to avoid reinventing the wheel
Iād like to use the pollen count for some internal home bits, but if i could then take that and push it to my weather site, which I should be able to do a push from WebCore -> myURL for processing I would be one extremely happy (and less sneezy) camper
no other category seems appropriate, so let me just post my response here.
i started working on the pollen count piston using ifttt at the request of an user who asked for an example using http requests. unfortunately after spending a little time on it, i found a couple of things that didnāt work for my needs:
so, the piston i have now is still a snippet and not a full fledged example that i would feel good about sharing. there are other parts from the snippet that i shared at link below, in case thats useful for you:
my intent has been to find a pollen api, hopefully freely available, then build an example with that. but, just been distracted with other things.
sorry, i wasnt more helpful.
Thanks ā I have not found a pollen open API ā¦ been searching a while then gave up ā¦ if you find one do let me know
@bangali hmm this thread has burst my bubble! I was hoping to find a piston which would push a notification to my phone if the pollen count in my area on a particular day was going to be high. But from everything Iāve read it sounds like the issue is a getting a data source with API to get the pollen data - I saw something that may have helped but it was only available in the US and Iām in UK.