whats a clean way of doing this?
thanks!
@eibyer thank you, this is great!
@ady624 this does not seem to execute the piston ā¦
webCoRE_execute('ID from dashboard piston URL', [name: variableName, value: variableValue, unit: variableUnit])
i do have webCoRE_init() call in my initialize() method.
thank you.
@eibyer this is not working yet, but i am sure it will since housepanel is using it ā¦ so probably something i am doing wrong.
but, you really saved me a bunch of time ā¦ i was literally working in another window on hacking up location events to webcore to get similar results since this morning.
thanks a bunch!
yes, tried both ways ā¦ webcore_list() does not seem to be returning anything ā¦
EDIT: so this prints null
log.debug "webcore list: ${webCoRE_list()}"
8:53:58 PM: debug webcore list: null
the event subscription shows up, but doesnt seem to be receiving any events ā¦ though the rest of my subscriptions are working fine
thanks.
sending a location event does execute the piston, so a step forward:
sendLocationEvent([name:'ID from dashboard piston URL', value:app.label, isStateChange:true, displayed:true, data:[:]])
yep, it is. passing in variables from the smartapp for the piston to save values in global variables which then get used by various other pistons for various tasks or displaying to tiles.
a secondary benefit, dont need to go editing pistons everytime i needed to adjust a handful of variables.
next steps:
thanks.
seems like this should be the event that updates global variables but publishing one of these does not seem to update the variable, so need to dig more as time permits.
sendLocationEvent([name: handle(), value: $variableName, isStateChange: true, displayed: false, linkText: '${handle()} global variable $variableName changed', descriptionText: '${handle()} global variable $variableName changed', data: [id: $pistonID, name: handle(), event: 'variable', variable: [name:${handle()}, oldValue:$variableOldValue, value:$variableValue, type:$variableType]]])
@ady624 this used to work, but since the last update this does not seem to be working any more. now put a log statement in there to check if the piston is even getting executed.
thanks!
so, its working for some of the piston executions but not for every call to execute the piston. will look some more as time permits.
thanks!
Sorry to revive this topic but this is the closest I could find to what I am trying to achieve. I am trying to create a smart sprinkler and have found a smartapp that does the scheduling (which I thinned down) and created a piston to control my separate zones but want to pass a integer for the time to run each zone.
I have tried looking through this thread and others but am not quite versed enough to complete what I want to doā¦Can anyone tell me what I need to put into my smartapp and/or piston to transfer a value from the smartapp to the piston? Or is there a step by step guide anywhere?
I want to pass five separate integers from my smartapp to the piston. Such as:
zone1 = 10
zone2 = 18
zone3 = 25
ā¦
Hopefully that makes sense, if anyone can help that would be great!
If your smart app can make webcall, you can call the pistonās external url and pass the zone info you want in the formatā¦
http://pistonurl/?zone1=10&zone2=18
(and so on)
In your piston, you can access those passed values as
$args.zone1, $args.zone2 etc..
I honestly have no idea about webcall. I will look into that more or if you know where I can find out more about it I would appreciate it. The other lines are exactly what I was looking for. Now to try and make it work. Thank you!
if it helpsā¦here is the smartapp so far.
definition(
name: āSmart Sprinkler Timerā,
namespace: ābryulyā,
author: ābryulyā,
description: āSmartApp to create schedules for Smart Sprinkler in WebCoreā,
version: ā1.0.0ā,
iconUrl: āhttps://s3.amazonaws.com/smartapp-icons/Meta/water_moisture.pngā,
iconX2Url: āhttps://s3.amazonaws.com/smartapp-icons/Meta/[email protected]ā
)
preferences {
page(name: "sprinklerPage", title: "Sprinkler Controller Setup", nextPage: "schedulePage", uninstall: true) {
section("Zone Times...") {
input "zone1", "string", title: "Zone 1 Time", description: "minutes", multiple: false, required: false
input "zone2", "string", title: "Zone 2 Time", description: "minutes", multiple: false, required: false
input "zone3", "string", title: "Zone 3 Time", description: "minutes", multiple: false, required: false
input "zone4", "string", title: "Zone 4 Time", description: "minutes", multiple: false, required: false
input "zone5", "string", title: "Zone 5 Time", description: "minutes", multiple: false, required: false
input "zone6", "string", title: "Zone 6 Time", description: "minutes", multiple: false, required: false
input "zone7", "string", title: "Zone 7 Time", description: "minutes", multiple: false, required: false
input "zone8", "string", title: "Zone 8 Time", description: "minutes", multiple: false, required: false
}
}
page(name: "schedulePage", title: "Create An Irrigation Schedule", install: true) {
section("Minimum interval between waterings...") {
input "days", "number", title: "Days:", description: "minimum # days between watering", defaultValue: "1", required: false
}
section("Start watering at what time...") {
input name: "waterTimeOne", type: "time", required: true, title: "Turn them on at:"
}
}
}
// Scheduling
def scheduling() {
schedule(waterTimeOne, āwaterTimeOneStartā)
}
def waterTimeOneStart() {
state.currentTimerIx = 0
scheduleCheck()
}
def anyZoneTimes() {
return zone1 || zone2 || zone3 || zone4 || zone5 || zone6 || zone7 || zone8
}
I have done it all in webcore for now. Still working through some of it, as it seems my piston might have an issue somewhere in the logic. I really just donāt like having to sign into webcore on my phone or a computer and then edit all of the time variables. It is much easier (in my opinion) to edit in the smart app interface through smartthings. I currently like webcore for all of the ābackgroundā effort that doesnāt have to be modified with any regularity.
Have to edit my postā¦something about limiting new users to only 3 replies in the same topic.
@eibyer,
I have been looking into the URL optionā¦seems like there is a lot to go through and my programming is limited. I will see what I can do. As for the pistonURL how do you find that?