webCoRE for Hubitat Updates

I have a new version of webCoRE for HE that needs a few testers. If you are interested (you can go back to the released version at any time), contact me via a PM.

These changes further reduce the overhead / improve the performance.

1 Like

So i have some fairly complex rules in Webcore on ST. Is the latest rule machine on par with webcore in HE?
o honestly dont know) - my hub is in the post right now :slight_smile:

EDIT: It seems it is ahead with stays x for y minutes and the importing feature etc... also it's far more efficient that RM - . that's pretty cool and is used a lot in my setup. Does RM4 have this level of parity ?

That's not correct RM is always going to be more efficient. This is just because of the extra steps WC takes to run the rule.

I guess I mean more from being able to build a piston that could handle more than many rules can. Happy to be told im wrong. So you mean it's not as efficient as running them ? Regardless of structure. That makes sense.

Honestly I'd much rather use RM if I can. I guess I'll try it out and report back :slight_smile:

Correct, it's something about it being a interpreted language on top of an already intrrpreted language (groovy)

That's what most people do for all rules they can port then for rules they can't work out yet they use WC untill they get the hang of RM. Also I believe there is a few things still that RM can't do that WC can but with the last couple of updates it's made that list very small to one or 2 odd things. I still prefer the UI of WC but that is just a current limitation with hubitat UI. I would think with all the added functions to hubitat and RM that now allows you endless possibilities that Hubitat's next stage would be improving the UI to help new users and home automation novices.

2 Likes

I view RM is becoming more interpreted as it adds more language features.

It has been thru a lot of change lately and retiring of older versions - hence my view it is a moving target as far as longevity.

1 Like

You can already do this in RM. A typical example would be a trigger of "sensor X changes," then you'll split your actions sections using an IF ...ELSE ... END-IF. Your IF will test for one of the desired conditions (e.g., a contact sensor being open). You can achieve the "stays" part in different ways, but a typical example is to use a "Delay x minutes" action. You'll likely also want to set the "cancel" flag on this delay action and use a "Cancel delayed actions" action in your ELSE, which will un-schedule the commands set to run after the delay if the sensor state changes (truly making it a "stays," not a "was x minutes ago").

There are more examples in the docs, which I'd suggest reading.

There is nothing wrong with multiple rules. :slight_smile: (They're free, as people often say--but you'll find this far less necessary in Rule 3.0 and later compared to earlier versions due to the actions being an ordered script and the introduction of conditionals.)

2 Likes

Thanks for to all the testers of the new release. Some of the features in this beta:

  • ability for pistons to subscribe to attribute values (ie not all changes of the attribute)

    • for example, if you only do things like "if switch changes to on", the subscription will be to on state vs. all switch changes. If you do multiple triggers (example on and off), it will subscribe to switch state changes (vs attribute value)

    • this also works for "device gets value"

    • if you don't want this, use "if switch changes" rather than "changes to"

  • Faster operation

    • a lot of optimizations in place that reduce typical piston execution by up to 50%.

If you would like to try this beta, send me a PM.

2 Likes

Couple of notes from the webCoRE form that may be helpful for HE users.

Resolving dashboard loading issues:

2 Likes

I have gone through all I can do and I can't get my Chrome browser to edit any pistons.
Sorry for the long detail but I wanted to list all the steps I have gone trough.

Everything was working great until a few hours ago when I went to edit a piston and received the error message that my pistons wouldn't load.
Things I did;
Clicked Done in the webCore app
Cleanup and rebuild data cache (in webCore)
Rebooted the hub.
Restored the hub with a backup I did this morning.
Cleared all my all my browser data, including cookies and cached web pages.
Restored my computer to an earlier time.

Here is the problem. I am able to load the page where I can see all the pistons (no loading errors) however if I try and edit any piston it hangs forever or if I'm lucky I sometimes get an error "Sorry, an error occurred while retrieving piston data." I cannot create, duplicate, or restore pistons from a backup, but I can back all of them up to a file.

I have tried other browsers such as Microsoft Edge, Internet Explorer, Firefox and none will even bring up the first page listing all the pistons. (Yes I am properly entering the Browser Registration Code and the proper password.) I have even tried two other computers and I still can't get it to come up.

Now for something even more strange. I can bring up and edit pistons on one of my laptops. I was having the same problem as all the other computers but for some reason it works after registering the browser and inputting the password. If I use the same laptop and try and register webCore through Microsoft Edge, it won't even bring any piston listing up

This seems to point to a computer and/or a browser issue but I have tried using a fresh windows install and still can't get it to work.

Here is something from the Hubitat hub I forgot to add;
app:362019-08-03 06:59:54.936 pm warnTrimming 131KB response to smaller size
app:362019-08-03 06:59:54.890 pm debugDashboard: get piston :{pistion id removed}: needs new db current: v0.3.10c.20190531 in server undefined
This error orrors only on computers that can't edit piston. If I use my laptop this error doesn't popup.
BTW Upgraded webCore to v0.3.10d.20190627 and now I can't edit or change any pistons at all anywhere. staging.webcore.co say to hard reload the page to get the update but hard loading doesn't update.

Does anyone have an idea why this is happening?

Check the post linkted by @nh.schottfam above. The log you posted is similar to what was in that thread.

Thanks, I have followed those threads and I can't edit any pistons at all. I had one computer working and shot myself in the foot by upgrading webCore to the latest release. I'm dead in the water. I am so frustrated from hours and hours of trying everything I know and I can't do anything with pistons other than look at them. If I delete webCore and install it from scratch with zero pistons I can create new ones, or restore old pistons. My problem is I don't remember all the dozens of system variables I setup. Its frustrating because there is no definition of what the webCore cloud does and what this database thing is. Sorry, I don't know what else to do. Thinking of moving back to SmartThings

When I bring up staging.webcore.co it continues to give me the message;
A newer UI version (v0.3.10d.20190627) is available, please hard reload this web page to get the newest version.
I hard reload and nothing
I try and create or edit a small piston and it hangs.

You did read this note?

Yes, In the webCore app on Hubitat "Register a browser" Then take that code and enter it into the Chrome browser ie. staging.webcore.co, then enter the password for webCore
At the webCore dashboard I click on a small piston and it hangs forever.

in the Hubitat logs it says;
app:12232019-08-03 11:46:59.237 pm warnTrimming 124KB response to smaller size

app:12232019-08-03 11:46:59.170 pm debugDashboard: get piston :1190fc965eafb4f3a0250550d959ae4: needs new db current: v0.3.10d.20190627 in server undefined

This is after I deleted all traces of webCore and reinstalled it blank. Created one small piston and then saved it. I was able to bring it up again so I then used a backup of webCore pistons to restore about 80 pistons. I have only one browser able to edit pistons, the same computer I painstakingly restored each piston one by one. Other computers on my network can bring up the dashboard but hangs when I click on any piston.

Also, on the one browser that still works the dashboard continues to report;
A newer UI version (v0.3.10d.20190627) is available, please hard reload this web page to get the newest version.
Problem is, I am already running that version.

On the other computers when I display the dashboard it does not display that message.

The instructions in the post I referenced say to open a small piston first after logging in.

You effectively did that with what you did above...however you did not need to go to such trouble..

I did that before deleting all the pistons and uninstalling webCore. I tried opening an existing small piston and it hung. Sometimes I would get a popup "Sorry, an error occurred while retrieving piston data." Next I tried creating a piston. Same situation. That is when I removed everything and reinstalled. After reinstalling webCore and before attempting to restore all my pistons, I created a small piston which then it worked. I then restored all my pistons (it wasn't as bad as I thought though)

What I don't understand is why it hangs bringing up a piston on one computer and not on another. I have a laptop setup the same way as my desktop and one worked, the other didn't. I finally gave up and went to bed and this morning I opened my laptop and tried to bring up and edit a piston and it works normally. I didn't reboot anything, or change any setting, it just started working on its own. I am happy with having two systems able to work on pistons, but I have three other computers on my network that still can't edit or create pistons. This is what is throwing me off thinking its a problem on my end but I'm not so sure. I've tried Chrome, Microsoft Edge, Firefox, and even the old Internet explorer. None of them worked. At this point I'm being extra cautious about keeping backups of the pistons and the Hubitat hub. Which, speaking of that, I even tried restoring the hub back to several weeks ago and I still couldn't bring up and edit a piston. As best I can tell I left no stone un-turned and yet after doing nothing further the laptop that couldn't bring up or edit pistons worked. One last thing. After updating webCore to the latest release I still get the message "A newer UI version (v0.3.10d.20190627) is available, please hard reload this web page to get the newest version." even though that is the release. If you have any other ideas of what happened, and in some way, still is, I'm open for suggestions. Thanks much,

Significant updates to webCoRE on HE to reduce overhead and improve performance

As always, before upgrade, do take backups of your hub, and store the backup off the hub on your computer. (HE console -> Settings -> Backup and Restore)

It is good practice to reboot your hub prior to upgrading, and to let it settle its internal DB for a few mins, then install the new webCoRE version (HE console -> Settings -> Reboot Hub)

Install the main webCoRE.groovy application last when updating the groovy components (HE console -> Apps Code -> webCoRE Piston; webCoRE Storage then webCoRE (main app).

After upgrading recommendation:

  • go into the HE console, Apps -> webCoRE and then scroll down to hit "done"
    • wait about 1 minute for updates to occur as part of the upgrade
  • open the webCoRE dashboard/IDE in a new browser window
  • select a small piston so that db uploads to the IDE will not exceed HE limits

Improvements

  • much improved performance due to many optimizations - These together can reduce overhead by up to 50%
    • reduction of state usage (HE database)
    • improved locking performance
    • code optimizations to improve performance
  • Added new trigger capability
    • if Device receives attributeValue or if Device gets attributeValue (for momentary devices like buttons)
      • receives / gets triggers have the piston only subscribe to attributeValue (vs all state changes) of the attribute.

Many thanks to the beta testers for helping resolve issues. As always kudos to the original authors of webCoRE and the team that works on the webCoRE servers.

If you have any issues, a private message with piston example and HE console -> Logs output is helpful for diagnosis.

5 Likes

Are we still supposed to be using staging.webcore.com as the interface?

I made sure to back everything up. Did a reboot. Waited 10 minutes for everything to calm down.

First Imported webCoRE Piston and saved
Then Import webCoRE and saved.

Let everything settle for 10 minutes.

Launched Chrome browser going to staging.webcore.co

Page loads saying a newer UI version exists and to to a hard reload.
Pressed F12 then right clicked on the small reload symbol and clicked on Hard Reload
Page reloads with the same message as before.
Clicked on small piston.
Says "loading piston....." and that is where it hangs forever.

In the log is the following;

Rebooted the hub. waited 10 minutes. Tried editing small piston again. Just hangs trying to bring small piston up. Tried creating a small piston. Same problem, hangs loading piston.

Restored my previous backup. Waited 10 minutes. Verified the old versions of webCoRE were in place. Brought up Chrome browser. Tried to edit a small piston and it just hangs trying to load piston. Same problem, hangs trying to load small piston.

I am at a loss as to why this is happening. Even restoring seems to not bring it back. All pistons are firing I just can't edit them anymore.

Looking at the log am I correct that it is saying the size it too big? I am editing a piston that has maybe 5 lines in it. I do have two rather large pistons the largest being 19-23 chunks, sorry can't remember. Could that be the problem?

I hope you have some idea of how to fix this. Thanks much.

You don't need to use staging (earlier note, and note 1 mention HE changes are in dashboard.webcore.co)

The logs you show are warning "it is not a very small piston" you are opening. You may try to create a new blank piston instead given the warnings.

Sorry for the trouble - I do want to speak with webCoRE IDE / server folks on a method to reduce these uploads (I have spoken with HE, but they do not have plans to raise the 128KB - headers limit).

Another option is to check how many devices you have configured in the webCoRE app
(HE console -> Apps -> webCoRE) and remove a few if you are not using them now (and done/save your way out)

Again, I am very certain I am opening a very small piston. I have also tried creating a piston with the same hanging result. This is the log output when I click on create new piston;

I will now check into your other question/option. I know I have about 80 pistons, two of them large. I will delete them through the hub interface to see if that is causing the problem. I'll get back with you.

Edited: I have 72 devices and all of them are configured in webCoRE I don't have many that are not in use. Also, I don't have any fancy devices, lots of bulbs, contact switches, motion, etc. I have a weather tile and three message devices. No Alexa or Chrome