webCoRE for Hubitat Updates

I hit a bug this morning where a while loop that used to end properly ran infinitely. Sample piston below. Does this update fix that issue?

Try changing the outermost "if" statement to an "only when" filter.

you might want to look try:

  • adding the switch is on to each nested if statement (and un-nest the the if statements with 'changes' in them. That would move the trigger comparisons to out level (left to right) vs. nested.
  • extra credit for keeping the trigger comparison first in the ifs that are 'AND'.

You want the if statements with 'changes' in them to be crossed on each execution (so that 'changes' can be tracked). What is currently happening is 'changes' is only tracked when the switch is on, which may sound right, but on first runs after switch becomes on may be wrong...

What do you mean by filter?

What if using the switch to pause/resume the piston - I could create a piston that pause/resume pistons regarding that automation switch. Is it healthy? Increases processing?

It is ok to have a switch control the execution of the piston. In this short piston you are subscribed to the events being tracked by 'changes' so if you watch the piston it is waking up when those things change, it just runs the first if statement then exits.

Having it run 2 if statements (if you follow my earlier suggestion) vs. one is negligible to additional overhead.

I would suggest follow this tip:

I meant that if you click this button in the editor:

image

You will see a bunch of "only when" blocks pop up on the screen. Put your outermost "if" condition in the "only when" block that's above the "execute" statement, then you can move your two inner conditions to top level.

1 Like

What about groups of condidtion+triggers? I am using groups like the one below - disregard the "automation switch at the beginning which I will take out and include on each conditions bellow. Like this is a problem of overhead?:

Upgrade failed then,

Error Occurred During Installation

An error occurred while installing the package: Failed to upgrade app https://raw.githubusercontent.com/imnotbob/webCoRE/hubitat-patches/smartapps/ady624/webcore-piston.src/webcore-piston.groovy. Please notify the package developer..

After doing a repair on my C4,

One of my C7's went through ok, I'll hold back on my other C7

Error Occurred During Installation

I had this happen on my C-3 a couple of updates ago; I rebooted the hub, retried the package repair and the update then succeeded. The current update went through on the first try.

Nope same result

Are you getting a warning on this? I don't expect it to off hand.

No warnings at all. Just asking if this would be a good way of putting to not increase the overhead. I have read the page you sent out but in there I dont see anything related to groupas of conditions nested in groups of conditions and processing overhead. :grinning:

I have no concerns on 'overhead'. The main thing to watch is if you code a piston that it wakes up all the time (and does nothing).

if I put the static conditions before the trigger event, do it wake up all the time?

Might want to let the hub settle a bit after rebooting; I usually wait an hour or so before doing anything that would make it busier before stressing it with an app update (at least a sizeable one).

In the end, you piston 'wakes up' for any event it is subscribed to.

So wakeups depend on # of events that occur.

The piston could do something or nothing when it wakes up...

I would suggest just get things working as you want for automation. Then there can be a discussion/review if you think there are too many events. In general it should not be a big issue.

I have followed the instructions in note 2 and used the commands from @Tony (thank you!). Cleared all cache registries and security tokens and now I am not getting an error but also not seeing my pistons. Also, anytime I click on any of the links in the UI (dashboard, fuel streams, backup pistons, etc.) it redirects me back to the register browser prompt. I have logged out and back in a dozen times. I've rebooted the RPi twice and cleared all data and cache from my browser. Any other ideas?

If you go into webcore main app

HE -> apps -> webcore

what happens when you select 'dashboard'?

When I select dashboard I get this:

Download the Hubitat app