Change device attribute value


#1

1) Give a description of the problem

I have a virtual device (particle Photon) as my irrigation system, the device has multiple attributes showing temp, humidity, last irrigation and LAST CANCEL.

I’m tying to change via webCore the Last Cancel attribute using Restore Attribute function, I also try Capture attribute function.

Is this the right way to do this? using Json?

2) What is the expected behavior?

Change the attribute value of the device using a webCore global variable.

The change should be visible via Smartthings app Tile.

3) What is happening/not happening?

No change is showing in the App.

4) Post a Green Snapshot of the pistonimage
This is only a TEST code to make the changes

5) Attach any logs (From ST IDE and by turning logging level to Full)

`4/10/2017 13:27:59 +100ms
+10ms ╔Received event [Puerta De Hierro].time = 1508869680000 with a delay of -901ms
+145ms ║RunTime Analysis CS > 29ms > PS > 79ms > PE > 32ms > CE
+161ms ║Runtime (37317 bytes) successfully initialized in 79ms (v0.2.0fa.20171011) (150ms)
+167ms ║╔Execution stage started
+193ms ║║Cancelling statement #2’s schedules…
+219ms ║║Executed virtual command [Riego Jardin].loadStateGlobally (12ms)
+258ms ║║Executed virtual command [Riego Jardin].sendPushNotification (32ms)
+262ms ║╚Execution stage complete. (100ms)
+268ms ║Setting up scheduled job for Wed, Oct 25 2017 @ 1:28:00 PM CDT (in 86400.637s)
+284ms ╚Event processed successfully (284ms)
24/10/2017 13:27:18 +484ms
+4ms ╔Starting piston… (v0.2.0fa.20171011)
+195ms ║╔Subscribing to devices…
+261ms ║║Subscribing to Riego Jardin…
+262ms ║╚Finished subscribing (71ms)
+300ms ║Setting up scheduled job for Tue, Oct 24 2017 @ 1:28:00 PM CDT (in 41.221s)
+320ms ╚Piston successfully started (320ms)

Tnx in advance guys!!!


#2

I have a related, but unsimilar, issue lol
I have an ecobee thermostat. I would like to execute various tasks based on the status of the following attribute:

⌂ currentProgram

It shows up as an available attribute in webcore, in the same list as coolingSetPoint.

I can use coolingSetPoint to drive actions, but not ⌂ currentProgram. I can’t even get it to report what value it contains. How do I write a piston that would simply report the value contained in a given attribute?
Any assistance would be appreciated.


#3

@alx, you can just use text for the global state container name rather than a variable. If you have another piston that first captures the attributes from that device into a global state container with the same name, then the restore should work if the device handler supports changing that attribute. Using the @RiegoJardin_CANCELADO variable in this way is not actually taking any attributes from that variable but rather using it to look up the name of a global state container.

Maybe that is exactly what you’re trying to do and @RiegoJardin_CANCELADO is a string value that is set by the piston that captures the initial value, but I can’t quite tell from the example.

@Glen_King, please create a new topic for this.

Edit: Sorry, I didn’t realize how old this topic was, were you able to figure out the irrigation setup?