Patched webCoRE for Hubitat (2018/09/09)

@mike.maxwell

Hey Mike,
We're seeing different behavior from adding child apps using the app() method in the parent preference section and from the addChildApp method in smartapps.

Lets say there was a child app with this installed method

def installed(){
log.debug "App Id: ${app.id}"
state.testing = true
atomicState.testing = true
}

If this child app was added from a parent's preference section with the following
app(name: "childApps", appName: "Switch Group Child", namespace: "jp0550", title: "New Child App", multiple: true)

We would see the app id in the logs and atomicState would work

If its added using this from the parent
addChildApp("jp0550", "Switch Group Child", "New Child App", [:])

It shows App Id: null and atomicState will fail with a null reference exception.

Is this a known issue? In this case it's causing the child app to not run the initialization code and it has to be called manually with childapp.installed() from the parent after it's been added.

It is now...
I'll create an internal issue for it.

2 Likes

Another issue has reared its head for me.
On my desktop using chrome, I can access my webCoRE dashboard and can go into pistons and define/edit/delete them.
If I try on my android mobile I can get the dashboard to load and list all my pistons, but when I click on a piston all I get is the three spinning circles.
The piston doesn't open.
I have tried Firefox, chrome and incognito mode to no avail. Even tried changing to desktop mode and got no joy.
This happens if I try opening via my local RPi or the webCoRE server.
I am running the latest updated webCoRE and hub software.
Anyone else suffering with this?

EDIT:Also getting this on an iPad that has never been used for accessing webCoRE before.
EDIT2: Now my local instance of webCoRE is doing it. This ain't good.

EDIT3:::: Defined another instance of webCoRE and I'm getting exactly the same thing on the new instance.
Nothing in the logs. I really do need some guidance on this as webCoRE will become unusable if I lose my webCoRE edit/define/delete functionality to the webCoRE server from my desktop. It's all gradually falling apart.

There was a bug for a short amount of time for the pi webcore code on Saturday that prevented part of webcore from loading. Can you update your pi code again and clear cache in your browser to try again?

cd
cd webCoRE/
git pull

If that doesn't work you can open the developer console in chrome or firefox to look for errors in the network tab (red entries) or javascript errors in the js console.

Remember that if you want to switch back to using the dashboard.webcore.co link you must disable custom endpoints in settings as their site doesn't allow foreign urls.

1 Like

I installed Saturday night but couldn't create a piston so I assumed it was an issue with using the Hubitat with the dashboard.webcore.co site. I followed the instructions to build out on the raspberry pi and I'm getting the same error when I try to create a piston. I just did a git pull (hubitat-patches branch) and the issue still exists.

"Sorry, an error occurred while retrieving the piston data."
image

A "piston" is created with the name that I gave it but it's listed under Paused Piston's and I can't enter/edit it. I have to delete it from the Hubitat Apps page.

Hubitat is at 1.0.8.711.

Any idea's?

Try updating the webcore piston groovy file to the latest. Someone was having this same issue yesterday and the code had to be updated.

1 Like

That did it! (I updated the Piston code but noticed the WebCoRE main code also was updated recently regarding a save state error so I updated it as well.)

Awesome, Thank you @jp0550 !

I have a piston that I want to fire every minute (It was working on the other platform; although at some point recently it quit. I'm not sure if it showed the same issue).

image

The top of the piston states:
image

The logging shows:
image

@jp0550
OK. Here's an update for you.
All my files were up to date but I over wrote them again just to make sure nothing had got corrupted.
My git pull was also up to date as it said 'Already up to date'.
I did pick up on something you posted though.
I have never had "Use Custom Endpoints" - On.
I could use either my local server IP address, 192.168.x.x, OR dashboard.webcore.co. Both would open my dashboard window and I would be able to edit/define/delete pistons.
I'm assuming it was the update that has caused things to go awry.
I have now enabled custom endpoints and can now get into my pistons to edit/define/delete.
I'm assuming from this then that it is either one or the other, local or server, and you cannot use them both. Is that correct?
To swap over it would just a matter of disabling custom end points and putting back in the servers.
Thanks for you help with this.
What little hair I had left was being pulled out. :older_man:

@jp0550
OK. I am getting really confused now.
Here is how I have my webCoRE instance defined.
image
I can edit my pistons using my local address but not using dashboard.webcore.co.
When I use dashboard.webcore.co I can list my pistons. But when I open pistons I get the 3 spinning circles and the following errors:-
NETWORK TAB.
No red entries.
CONSOLE.

Hope this all makes sense.

The 502 red error in the console was one of the reasons I added custom urls (I'd recommend removing your picture as it shows your hub id, app id, and part of your auth token). Hubitat's cloud api doesn't respond well to data above a certain size. To get around this you can use a custom hub url in the top input. Only problem with that is that dashboard.webcore.co doesn't allow urls outside of smartthings and hubitat so it will fail so the second input lets you use a custom webcore dashboard link (your raspberry pi) that will allow a custom hub endpoint.

1 Like

@jp0550
What I'm having a problem understanding is, if I have no data in the custom url fields and custom end points is NO, shouldn't it be using the webcore server.
Why is my local PIi address working and webcore server isn't. Baffling me.

It can still communicate with your hub just like dashboard.webcore.co can. It's just your own personal instance of it with less restrictions. The second link in the settings input just updates the links in the apps section so they open your local instance for convenience, but it isn't necessary for the pi instance to work. When you use "Register" or "Open Dashboard" it will pass the website you use the info it needs to connect to your hub.

As far as why it isn't working, if the piston data has already been loaded from a previous visit to the site, it doesn't need to grab as much data when you look at other pistons. If you go to the site after awhile or from a fresh instance, when you view a piston it has to grab all the database information which goes over the size limit and causes it to fail.

Also, if you registered with a custom url, it will cache that url until you logout and will work even if you disable custom endoints.

I have a local (RaspberryPi) webCoRE instance and all works well. Can I also use the webCoRE Presence driver? When I installed the android webCoRE app on my phone and try to open/register an instance it errors out saying something like 'there was a problem loading your dashboard' and it does not open? I used the registration code from the local webCoRE instance on the phone.

Is it possible to use the webCoRE Presence driver on a local instance of webCoRE? If so, what am I doing wrong?

Thanks.

1 Like

I have the same thing as well and would like to see if the webCoRe Presence can work with the Rpi instance.

I'm thinking its not so much the RPI vs WebCore instance, but rather the mobile application is configured to hit the ST Cloud end points ... looking at the driver, I am not seeing any other way ...

Thinking about it - the phone is the presence sensor and it communicates to your ST hosted hub endpoint... I think the mobile application would need to be changed not the WC Presence Driver - it collects the data sent to it via ST

If I am looking at this right, the Phone sends ST Cloud the Lat/Long and Accuracy info. ST Feeds that to the WebCore Presence Sensor which processes the data and updates location, maps, present/not-present etc in the 'app'

Am I on point here? If so, then there would need to be a new mobile app for hubitat that would allow for custom endpoints - or have the functionality built into the yet-to-be-released Hubitat mobile app (hint hint nudge nudge)

Has anyone gotten SMS messaging to work via WebCore or is that just not a gonna happen?

Yes, it works for me.

Hmmm.. back to the drawing board - i didnt get texts from a piston i expected... I went and changed it to email to my phone's email to text address phoneNumber@vtext.com

I'll see if that works and if not go back to mucking around with SMS again

I was following on the docker discussion and this seems appealing to me with a Synology NAS.

Has anyone crafted a 'webcore docker container' they would want to share?