Patched webCoRE for Hubitat (2018/09/09)

Could a pi hole on my network cause issues?

Can't answer that because I don't have a pi hole to know if it could cause a problem, but if the pi hole is on the network with it's own IP address I would say no to it causing problems. I do remember running into a blank screen at some point. First make sure the Apache web server is setup properly. Maybe make a simple HTML file and get that working first. Once you know the server is working as it should, then move on to getting webCoRE setup correctly. As I said before, I didn't have much experience with the web server and I didn't know if it was a problem with that, or a problem with the webCoRE dashboard setup.

Now I'm confused. If I turn off the custom endpoints in the WC and i tell it to go to http://localhost it loads the dashboard...

Same results if go to the pi's address from another device. It appears to be hosting properly but the Webcore app and the hubitat don't appear to be linking properly.

EDIT: It's working now. It seems as if disconnecting it from the hub, reconnecting back through the cloud and then trying it from another browser while having recently been reauthorized through the cloud did the trick. Either that or hitting the generate auth code 25 times did it haha.

1 Like

@nh.schottfam

A minor bug: when I back up my pistons (using the backup button on the dashboard), it creates a file that includes the current time in the filename -- but the time is in GMT instead of the hub's local time zone.

A question: Is it possible to easily see which pistons reference a given global variable? If not, is that something that's easy to add? It would be really useful.

Will have to ask @ipaterson to also have a look.

Do note that the hub actually does not set local time, and it runs itself in GMT. The local time is part of HE / groovy settings, not the JVM.

I'm not sure why but yes it is named GMT for everyone regardless of automation platform or hub configuration.

Easily, not quite but it is possible. The backup file is encrypted with a password, but once you upload that file back into webCoRE to begin importing pistons all of your piston data is available in a usable form in the browser.

  1. Generate a backup file
  2. New Piston > Import to load the file into the dashboard. This will not actually import or duplicate any of your pistons it just loads them into the import wizard.
  3. Open your browser's developer tools and find the console
  4. Paste the following, then change the varName value on the second line to the actual text you want to find (e.g. change (varName = '@myVarName') to (varName = '@maxTemp')).
console.log(
    (varName = '@myVarName'), 
    '\n', 
    (await dataService.getImportedData()).flatMap(
        (p) => (JSON.stringify(p.piston).includes(varName) 
            ? `https://dashboard.webcore.co/piston/${p.meta.id}/` 
            : []
        )
    ).join('\n')
);
  1. Press enter and the console will show clickable links to each of the pistons that probably use the global variable.

This is just a simple text search, the actual piston data is too grotesque to parse for exact matching. It can be used with more than variable names of course – any content of the piston – for example finding pistons that reference a URL or email address that no longer exists.

Ok I put this on top of a pi-hole running a PiVPN. All 3 run successfully. However, now (I'm assuming because of the script that was changed in sites-available) I am unable to access my pihole gui unless I stop the apache server from starting on boot.

The hub platform backups are named in local time. Is it possible to fix the piston backups?

Sounds like a feature to click on a global variable and see which pistons reference it in a live environment is not going to happen... I'd love to be wrong on this :grinning:

You might have to check on how to change port number for the pihole as I believe it runs its own webserver daemon. Both of them are listening on 80.

I did end up getting it. I have a pihole running on it now with a pivpn to get into my home network and WC running on an apache server on different ports.

I also figured out the trick in getting past the blank screen while installing WC. The machine that requests the Dashboard 4 digit auth code must be on the cloud endpoints...

The local endpoints still go to the Raspi ip address but they must have a registration code from the cloud or they will never receive a proper auth. You have to do this for each device. I believe once they are registered you can then use the local server to generate keys. It appears that first registration has to come from the cloud, however.

@ipaterson @nh.schottfam

I've been having an issue with restoring pistons from backup recently.

I like to take a full webcore backup before I do any major development. This way, if I make any big mistakes, I can import that backup and restore the piston back to its old version. The problem is, I tried that yesterday, and it didn't work. It loaded the backup file, showed me the list of pistons it had, (correctly) marked them as already present, and offered a "Restore again" button by each. When I pressed "Restore again" on the piston I wanted to revert, it gave me a strange error about being unable to load the piston data from the backup. My backup file has no password.

Can someone try to reproduce this? I'm willing to help get any information you might need.

I am running my own webCoRE server locally.

Thanks

Is there any way at all to use my PWS, an Acurite that reports directly to WU, for $weather?

I put it as a variable in the Pistons I need as an expression "[PWS : temperature]" but for some reason it's not showing up in all of the device details pages as being part of the piston. It shows as part of several of them but not all of them. It's weird it seems to work properly and send the right info when requested but it's the only device I have that if I search it thru the hub and look at the pistons it's a part of it doesn't show on all of them.

I guess you would need to change webcore-storage app to teach it to work with WU apis.

It is webcore storage that polls/populates $weather, and it understands how to interact with the weather apis (that it understands).

Several parts of the webcore graphics are missing. It is effecting the use of the dashboard as well. Such as the arrows to move things aren't there and I can't move things. This is like this on my phone and laptop. If I go to Chromium on the pi localhost it's normal. Any ideas how to fix this?

Upper left side of the piston edit screen:

Notice if you look at the upper left side of my edit screen those buttons are just blank boxes. I have the same box as you have clicked but the arrows that allow me to move pistons don't pop up. So I'm unable to choose them to move the piston. If I go to my dashboard that's hosting my WebCoRE server, a Raspberry pi, everything is normal. However, this behavior is occurring on any other client...including another raspberry pi.

Image 4

Notice it happens on the webCoRE cloud dashboard too. I tried staging.dashboard too with the same results.

I think I figured it out. I blacklisted fontawesome on my pihole. That was blocking these from loading properly.

1 Like

Hi, I've used the guide to install webcore on mi Pi.
It runs smoothly. I used git clone with the hubitat-patches branch

I installed the hubitat app from HPM including all the apps/drivers
so everything is supposed to be well updated.

I added my ip in the app's settings (without api call, otherwise it doesn't work) and used browser register to get a code and log in to the webcore dashboard.
I enabled all the devices in the hubitat app.

however, i can not see any devices in the webcore dashboard.

Please help :raised_hands:

If i turn on API
when i click dashboard in the hubitat app i get this:
image
and if i use browser register i get this:


either way, i can not see my devices in webcore

Also, this is definatly not my hub'w ip:
image

UPDATE:
after clearing all cache and data and enabling api urls access. now when i log in i just get an error message.. looks like this:

I would suggest try it first with superstation (NPM) package to see if that works.

Do ensure you have the right files, as not using the current branch will cause it to fail.

Otherwise you need to turn on logging on webcore to see what is going on.