I’m sorry for the long post, but I believe it deals with an important aspect in respect of which I’ve not seen much discussion:
As some of you know, I’ve been having lots of problems with my ST setup which eventually led to me migrating to a new hub. I did the migration over the weekend and by yesterday lunchtime, I had completed the hardware part of things and started with the software side of things (moving apps and pistons to the new hub). Up to that stage, I was extremely excited as all my Things were responding snappy and reliable.
At some stage late yesterday afternoon, I realised that the Z-wave switches have stopped responding - in general, I was experiencing the same behaviour as what had moved me to migrate to a new hub (apart from the “Not functional” state in respect of the Z-wave module). At the time when I realised all my problems were back, I had completed re-creating all the global variables I use in webCoRE (about 30 in total, containing about 60 - 70 physical devices) and had migrated 16 of my pistons to the new hub.
I would never have expected the new issue would have anything to do with webCoRE, but I started backtracking my steps. My last step was the migration of the pistons, and I started disabling them, without doing anything else to the hub (like a further z-wave repair, etc.) Within 10 minutes after I had Paused all the pistons, everything started working perfectly again. It is now more than 12 hours later, and all is still 100% with all my Smartthings.
My questions:
(a) Could it be that my pistons are overloading the hub to such an extent that it stops responding / can’t communicate with devices?
(b) I know some people are running much more pistons than what I do, so what could be wrong with the design of my pistons and in this regard:
(i) What type of triggers should one avoid/use more processing?
(ii) Currently, I try to stay away from using physical devices in the pistons - instead, I create Global Device Variables for the devices and use the variables in the pistons. Could that be the issue? (The reason is obvious I suppose - doing it that way, I only have to update the Variable in a case where a device fails/changes, instead of going into each piston individually to make the changes.)
(iii) If I do not use a global variable for a device, I define variables for devices in the piston and use the variables in the statements - is that a bad way of doing things?
(iv) Because I’ve had so many issues with devices not responding, many of my statements repeat a task until the device is turned on, instead of only turning it on - is it bad to do it like that?
(v) Which is better: use ten pistons at sunset each turning on one light; use one piston to turn on ten lights in one task which turns on all ten lights (mostly Hue bulbs); or use one piston containing ten tasks, each turning on one bulb.
(vi) Is it better (resource wise) to rather use 2 pistons (one turning on, the other turning off e.g.), than using one piston putting the second part (Off command) in the “else” part of the statement (Hope you understand what I’m trying to ask, but it comes down to which is better - keeping the piston alive until the “else” condition is true, or rather have another piston check when the condition for turning the device off, becomes true);
(vii) Does the “set piston state” function take up many resources?
In general, do we have a wiki or have I missed a discussion dealing with the most efficient way is to design pistons?
What general principles should we adhere to in this regard?