WebCore Running Locally!

I was a fan of Webcore back in my SmartThings days. I mistakenly thought somehow that Webcore was running locally on Hubitat. I guess I should have been more aware of the fact that the URL was pointing to the cloud.

So, I use Rule Machine and I have lots of RM, RM legacy and simple automation rules. They all work great, but Webcore takes control to the next level. I ended up creating a LXD Ubuntu container on one of my servers and I installed the Webcore Github project which is the same version as the Webcore in the cloud.

I was able to backup all 59 of my Webcore pistons running in the cloud and import them all into my locally hosted Webcore. There were a few annoying steps, but I can report that in the end, everything is working great.

If anyone wants help with this, I am willing to help you along.

1 Like

Glad you got a 100% local solution working! However, to this point, it should be noted that pistons always execute locally. They become just apps on your hub, like everything else (even on SmartThings, the cloud execution is only so because SmartThings doesn't let custom Groovy run locally, only the few things they bake into the firmware; this is supposed to change with their "new" model, but I'm long gone and can't speak more to that). The only thing that requires the cloud by default is the piston editor, which only affects creating, viewing, and modifying them--but not their execution.

Still probably something good to have if it's important for you, though! :grinning:

5 Likes

Well good to know. From all I had read, I could for sure see that the piston editor was running in the cloud. I guess now that you mention it, it makes complete sense that the groovy code that backs really all HE apps would have to execute locally. Thanks for the explanation. If I could get a voice assistant running completely local I would be in heaven!

Yeah, local voice control would be great. I try not to use voice control too much, and what I do use is pretty reliable--despite requiring the cloud--but I'd still prefer local if possible. :smiley: I've experimented with Genie (formerly Almond) and never got it to work quite to my liking, but I bought a few SBCs to run it on and keep telling myself I'll come back to it some day...

There's also MyCroft, which I've never used but know some people here have bought/pre-ordered their upcoming hardware. I suppose Siri is the most local of the big players, but (aside from not working natively with Hubitat), it still needs the cloud to process most voice.

All good points. I have looked into Mycroft, but the price performance basis leaves much to desired. We use voice for everything. I just despise using an app on a phone or tablet for control. The only exception to that is where I have a wall mounted tablet running in kiosk mode. When I do interface with dashboard controls my desire is a large screen web interface on a desktop. I can see gesture based home control gaining more popularity if it can become more ubiquitous. Face it, automation is about having the home act accordingly based on change in the environment. My emphasis has been to add more sensors to try and enable more real automation. I still mostly use a remote for video. That being said, voice commands for play, pause, rewind or show me a camera will always trump running some app. Voice commands for music are my exclusive choice for that media. My hopes for an expanded Hubitat is one that tracks trends in usage around the house and can produce reports on energy consumption in kwh or hours of use and could optionally do predictive analytics.

So glad I found this thread, as I also though pistons were running in the cloud and was contemplating re-writing all my rules in Rule Machine as part of my migration from ST to HE!

1 Like

You can definitely use webcore (even if you use the cloud editor). And @nh.schottfam has done a fantastic job optimizing webcore for the Hubitat platform. More details in the post below:

1 Like

I went that extra mile and self-hosted the piston editor. I also had no realized that my pistons ran locally because during an Internet outage I couldn't get to the editor. I like having the editor local as well and I self host tons of apps.

2 Likes

Hey, anyone here know how one can set up webCoRE to run locally with Ubuntu Server (Virtualbox in Windows) as opposed to Raspberry Pi? I just can't get this to work with the instructions provided by others for the RPi.

1 Like

@ralph.vasquez Ralph, Yes. Webcore code runs locally just like Rule Machine. However, the Webcore editor runs in the cloud. In order to run a local copy of the Webcore editor, you have to set up a webserver instance to run it. My recommendation would be a configuring LXD inside of your Virtualbox Windows VM. That would allow you to run multiple instances of different apps on the one VM that are isolated. My channel goes into depth on this. https://youtube.com/@scottibyte.

To confgure your webserver on your instance, you would do the following:

sudo apt install apache2 -y
sudo apt install git
git clone https://github.com/ady624/webCoRE
cd webCoRE
git checkout hubitat-patches
cd dashboard
sudo ln -s `pwd` /var/www/webcore

Then edit the conf file:

sudo nano /etc/apache2/sites-available/000-default.conf

Put the following in the file:

    <VirtualHost *:80>
        ServerAdmin webmaster@localhost
        #The DocumentRoot is changed to the webCoRE 
        #installation symlink directory
        DocumentRoot /var/www/webcore/

        #We need to allow all overrides for the 
        #dashboard directories
        <Directory "/var/www/webcore">
                AllowOverride All
        </Directory>
        #These are not changed - they are the 
        #default log directives - change as you need/want
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
     </VirtualHost>

Enable the Webserver with the new configuration:

sudo a2enmod rewrite && sudo service apache2 restart
sudo service apache2 status

Finally, go into HE and configure the webcore app with the address of your local server.

2 Likes

Thanks, but is something supposed to happen when I enter "sudo ln -s pwd /var/www/webcore"? I think this is the issue for me, when I enter that command, nothing happens. Also, is there a missing step "cd webCoRE" and "git checkout hubitat-patches"? I saw someone else's instructions with this.

@ralph.vasquez That's what I get just typing from memory. I edited my post above to have the proper commands and tested it. I installed my instance on a LXD container.

Here is what worked for me. I uninstalled everything, then started from scratch by performing all of the above steps. Note that the step for "git checkout hubitat-patches" will throw off an error but you can disregard that. Then, I did the following (replace admin with your username):

$ sudo chmod -R +x /home/admin/

$ sudo service apache2 stop
$ sudo service apache2 start

Hope this helps somone out there!

Has anyone gotten a docker image to run on a synology? This is where I would want to run the local editor.

1 Like

@mjruotolo I do this on a QNAP. However, there is an article about Docker on Synology here. How to use Docker on a Synology NAS in 2023 | WunderTech

Docker image in Synology.
Use File Station to make a "webcore" folder under your shared docker folder. (not sure if doing this is essential - but I did this)
In Docker, Registry, download bmcgair/webcore-docker (thanks Bill for this!)
In Image, Launch it.
Select "Use the selected networks". Otherwise the Docker image will use port 443 which will conflict with some DSM functions.
Makes sure "bridge" is selected
In "Port Settings" enter something for "Local Port" (I used 1700).
Next, next, etc. That's it.
In the Hubitat app use your DSM ip address and the port you chose.
Hope this helps.

1 Like

so I got the server up and running on my synolgy. I do have vlans setup so i ran docker compose and got things up and running. I go through setup and edit to use local server settings. I have a domain setup in my dns to put to its ip. Can I use this or do I need the ip? I have used the domain and it seems to work but no devices show in the piston. I created a blank piston and it shows on the hubitat page. Thoughts?

1 Like

I apologize up front if this is a dumb question, but could someone please clarify whether WebCore pistons that are edited remotely with the cloud dashboard affect WebCore pistons that are running locally on Hubitat? In other words, I switched from Smart Things WebCore where pistons were in the cloud to Hubitat WebCore where pistons are run locally. However, the WebCore piston editor/dashboard is still running in the cloud. I know when I'm gone from home, I cannot access my Hubitat via my local IP and am limited to the Hubitat app features. However, when I'm gone from home, I do still have access to WebCore editor/dashboard cloud, but I'm not certain whether changes I'm making remotely in the cloud are then pushed back to those pistons which are running locally on Hubitat. Thanks in advance!

There is an explanation of the webCoRE servers here:

How webCoRE on HE works

2 Likes

Many thanks. Just the explanation I needed!

Download the Hubitat app