Piston Missing Actions


#1

1) Give a description of the problem
While developing a piston in one of the “then” sections I pasted some actions from another part of the piston, however the actions did not appear as expected. Now when I try to add a new actions the webCoRE interface won’t let me click the “Add a task” button. Is there a way to view the underlying code to remove whatever is bad in there?

2) What is the expected behavior?
Allow me to add the task, close dialogue box and display in the piston code.

3) What is happening/not happening?
On click the “Add a task” button does not react and the dialogue box remains open.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
17/04/2018, 21:24:25 +824ms
+4ms ╔Starting piston… (v0.3.104.20180323)
+245ms ║╔Subscribing to devices…
+324ms ║║Subscribing to Hallway motion.motion…
+424ms ║╚Finished subscribing (190ms)
+476ms ║Comparison (enum) present is (string) present = true (4ms)
+484ms ║Comparison (string) off is_not (string) off = false (1ms)
+493ms ║Comparison (boolean) false is (boolean) false = true (1ms)
+516ms ║Comparison (enum) present is (string) present = true (0ms)
+518ms ║Comparison (enum) present is (string) present = true (2ms)
+524ms ║Comparison (string) off is (string) off = true (1ms)
+532ms ║Comparison (enum) inactive stays (string) inactive = true (2ms)
+535ms ║Comparison (boolean) false is (boolean) true = false (0ms)
+603ms ║Comparison (enum) closed did_not_change = true (60ms)
+613ms ║Comparison (enum) present is (string) not present = false (0ms)
+615ms ║Comparison (enum) present is (string) not present = false (1ms)
+621ms ║Comparison (string) off is (string) off = true (0ms)
+627ms ║Comparison (enum) inactive stays (string) inactive = true (1ms)
+630ms ║Comparison (boolean) false is (boolean) true = false (0ms)
+689ms ║Comparison (enum) closed changed = false (53ms)
+708ms ╚Piston successfully started (705ms)
17/04/2018, 21:23:19 +482ms
+1ms ╔Starting piston… (v0.3.104.20180323)
+150ms ║╔Subscribing to devices…
+168ms ║║Subscribing to Hallway motion.motion…
+234ms ║╚Finished subscribing (87ms)
+260ms ║Comparison (enum) present is (string) present = true (2ms)
+269ms ║Comparison (string) off is_not (string) off = false (1ms)
+277ms ║Comparison (boolean) false is (boolean) false = true (0ms)
+286ms ║Comparison (enum) present is (string) present = true (1ms)
+287ms ║Comparison (enum) present is (string) present = true (1ms)
+292ms ║Comparison (string) off is (string) off = true (1ms)
+298ms ║Comparison (enum) inactive stays (string) inactive = true (2ms)
+301ms ║Comparison (boolean) false is (boolean) true = false (1ms)
+402ms ║Comparison (enum) closed did_not_change = true (95ms)
+411ms ║Comparison (enum) present is (string) not present = false (0ms)
+412ms ║Comparison (enum) present is (string) not present = false (1ms)
+417ms ║Comparison (string) off is (string) off = true (0ms)
+423ms ║Comparison (enum) inactive stays (string) inactive = true (0ms)
+425ms ║Comparison (boolean) false is (boolean) true = false (0ms)
+451ms ║Comparison (enum) closed changed = false (21ms)
+458ms ╚Piston successfully started (458ms)
17/04/2018, 21:23:14 +329ms
+93ms ╔Stopping piston…
+163ms ╚Piston successfully stopped (72ms)


#2

You should really put each of those ELSE IF blocks into their own separate IF blocks :slight_smile:


#3

I only ever want one condition to be run though, if they were in separate IF blocks I’d need to nest them and it would look weird due to indentation.


#4

First thing I’d do is move all the Motion Sensor triggers (the ones with orange lightning bolt) to the top of the condition list (for my ocd sake ;D)


#5

That can, and will, be done as it makes sense to show what triggers the piston to run as the first condition.

However, to the point in hand, is there a way to make webCoRE let me add a task to that final then section? At the moment I am getting the behaviour outlined iny first post. Or, do I just have to rebuild the whole piston? :unamused:


#6

I was having trouble dragging the handles when I imported your piston… I had to reboot to get it working. I rearranged the trigger and split into IFs as @jkp suggested. OOps, also take note that I used a single presence and used it twice since I only had one simulated sensor.


#7

@eibyer, thanks for taking the time to look at it, I have noticed some funny things like handle dragging not working and this “Add a task” button not being clickable. Are there any known bugs which produce these affects? Do you think I need to reboot my hub to resolve these issues in the short term?

As for refactoring to individual IF statements it stop the logic being the same. As now all three IFs could technically run on a single run of the piston, I don’t want that and I need to ensure only one set of conditions is let per run, hence using ELSEIFs. Are the ELSEIF statements known to be less robust and hence why you’re trying to avoid them?


#8

The only time this happens to me is when I have not closed my browser windows for days a time, I am unable to reproduce that behavior on demand.

In my opinion separate IFs are easier to work with especially when dragging sections around. All three IFs will evaluate on each piston run but only the IFs that evaulate true will have its tasks executed.


#9

Cheers @eibyer. It’s not the browser as I have it shut all the time, seems like if using complex IFs I currently can’t have more than one action set (so they are useless).

I have got round the issue of all IFs being evaluated one a single run by adding the EXIT action to them all. The problem was some of the IFs could end up making the next one true, but this way it drops out so I am happy with it.