Patched webCoRE for Hubitat (2018/09/09)

Sorry. Both. I updated my local webCoRE on my RaspberryPi for the changes on Saturday morning and I updated the hub to the latest firmware (1.0.8.711) when it was released.

DOH!!!!!!!!!!!!!!!!
That could be the reason. I haven't updated anything on my Pi.

@jp0550 Now you have me thinking (always dangerous). I still have the previous version of webCoRE code in my 'Apps Code' section and I never updated that. Do I need that code since it is running off the RaspberryPi? Can I/Should I remove that webCoRE 'Apps Code?' If it is needed, then I should at least update it to the same version that I have on the RaspberryPi, right? What is the right thing to do here??

Very good question. I have the latest on my Hub but have done nothing with the Pi.
What did you do to update the Pi.

That is a few posts up ....

On the raspberry Pi:

> cd
> cd webCoRE/
> git pull

Thanks.
Just completed that and now I can access my pistons again.
My current state is this.
Completed the 'git pull' on my RPi.
Updated the 4 webCoRE apps to the latest version on github.
Hub is at 711.
So I suppose to answer your question, I'm at the latest of everything and its working OK. Go on. Bite the bullet.

All joking aside, thanks for the information. I completely forgot about my RPi.

I did just update the main webCoRE and webCoRE.piston apps (the two that changed) on my hub to the latest version. At least I am consistent now.

I am still curious .... do we need both the hub apps code and the local RaspberryPi code if we are using RaspberryPi?

You are using the RaspberryPi as a GUI for creating and editing the apps on your Hubitat Hub. The code on the Hub is used to create pistons, change their config, delete them, run them, etc.

The code on your Pi is used to give you a nice web interface to the app running on the Hub to tell it to create/ change/ remove a piston, etc.

Your automation can run without the Pi, just would be very hard to change things, but you have no functionality without the Hub.

So, whenever I update the webCoRE code I should do both the Hub code and Pi code at the same time. That helps. Thanks.

1 Like

That is not a mandatory requirement.
The webCoRE UI code (in your local server) needs to be updated only if a recent change (like the one putnamjwp did a few days back) impacts both, the Hubitat and local server pieces.

Else, updating them at different times shouldn't cause any issues. From now on, I'll try to make it a point to post a recommendation on what needs to be updated, every time commit is submitted.

Eventually, we could even try to make a notification come up on the webCoRE UI about which component is outdated and needs updation (which would need an external server call I presume). But this is more of a longer term solution.

I fully understand that pistons will be running locally and do not need to talk to the webCoRE server or my RPi if I host changes locally, but after I updated the 4 main app files on Saturday, I have been getting some weird things happening. Global variables not triggering pistons etc.
I just updated my RPi so I will see what happens now.

I too did the "git pull" a couple of days ago but forgot to update my HE webcore app files until I read this. Everything was working great though. Now that I've also updated my webcore apps, I get the following message in the log when trying to create a new piston. The piston does show up in the 'paused piston' and in HE apps webcore section. I have to hit the blue 'i' in the HE apps section to delete them.

app:null2018-05-07 17:07:31.254:errorNo signature of method: com.hubitat.hub.dao.InstalledAppDao.saveState() is applicable for argument types: (null, java.util.LinkedHashMap) values: [null, [created:1525727251235, modified:1525727251236, build:0, ...]] Possible solutions: saveState(long, java.util.Map) on line 1067

Were you on the hubitat-patches branch when you updated your files?

I always use the link at the top of this thread...brings me to this...

Can you open the webcore.groovy file in your app code section, find this method, and post the contents?

api_intf_dashboard_piston_create

Here you go...I think. :slight_smile:

private api_intf_dashboard_piston_create() {
	def result
    debug "Dashboard: Request received to generate a new piston name"
	if (verifySecurityToken(params.token)) {
    	def piston = addChildApp("ady624", "${handle()} Piston", params.name?:generatePistonName(), [:])
        if (params.author || params.bin) {
        	piston.config([bin: params.bin, author: params.author, initialVersion: version()])
        }
        result = [status: "ST_SUCCESS", id: hashId(piston.id)]
	} else {
    	result = api_get_error_result("ERR_INVALID_TOKEN")
    }
    render contentType: "application/javascript;charset=utf-8", data: "${params.callback}(${groovy.json.JsonOutput.toJson(result)})"
}

Thanks, I'll do some digging. Just to confirm, what you posted wasn't from the link at the top of this thread, but from the hub? I only ask because there used to be a line in there that caused this problem in the past.

piston.installed()

Yes, I just took that right off of the Hub/apps.

thanks

Thanks for bringing this up. That line was mistakenly removed. It looks like it was added in the past to get around the saveState error that happens in the code a few lines above in addChildApp..

@ajayjohnm has merged the fix and it's available in the top link.

That file worked, I can make new pistons again :wink:

Thanks!