WebCore Cannot View/PAUSE Piston: State cannot be greater than 100000.0 characters


#23

Thanks that’s a great idea! However before I can do that, do you know if there’s any way to erase global variables without having access to the webcore piston editing interface. I’m kinda dead in the water until I can gain some sort of access.


#24

I am sorry, I have never encountered that issue before.

Three steps worth trying (not in your list above) is:

  • Hard refresh the Dashboard in your web browser by pressing Ctrl-F5
  • Try alternative browser(s) on a PC (Firefox, Chrome, etc)
  • If those still fail, perhaps try those browsers in private or incognito mode?

Beyond this, perhaps one of the @webCoRE_Minions can step in?


#25

Once again, thanks for trying to help me out. I have now tried all of the following:

  1. Clean up and rebuild data cache
  2. Disable all pistons
  3. Logging out and logging in
  4. Trying to access the Dashboard from a mobile browser.
  5. Praying to the Web-core gods
    New
  6. Pressing Cntrl + F5 to refresh Chrome browser
  7. Tried to access pistons using chrome in incognito mode
  8. Tried using Firefox
  9. Tried to access pistons using Firefox in private mode mode
  10. Tried Internet explorer

Any other suggestions?


#26

I just want to confirm that you did a Ctrl-F5 (hard refresh) instead of a F5 (soft refresh).


#27

Confirmed, Ctrl-F5 had no effect.


#28

It sounds like you can access the dashboard, just not individual pistons so:

  1. Go to dashboard.webcore.co
  2. Open your browser developer console (steps to open it vary by browser, may need to search for your browser)
  3. Paste the following command in the console and press enter to see the current global variables
console.table(scope.instance.globalVars)
  1. Paste the following command in the console and change @name and value to the new value, probably just blank '' in your case
(function(name, value) {
	dataService.setVariable(name, { t: 'dynamic', n: name, v: value}).then(function(result) { scope.instance.globalVars = result.globalVars; console.log('variable set'); });
})('@name', 'value');
  1. Press enter to run the command, you will see a confirmation that the variable was set
  2. Try to access the piston again and repeat steps 3 through 6 until you can

#30

First and foremost, thanks for jumping in!

I followed your instructions as requested. And a picture of the results is below. The blue arrow is where I typed in the command. The result was the following:
VM256:1 Uncaught ReferenceError: data is not defined
at :1:15
Perhaps I’m typing the command in the incorrect location?


#31

Also,
I opened a test instance of Webcore where I only have 4 “test” pistons. In this instance I can access the individual piston editing window and your command works there. However the furthest I can get in my main instance is the window that lists out all of the pistons in the webcore instance. Let me know if that makes sense.

i.e. I can access this (developer console command does not work here)

and I cannot access this (developer console command will work here)


#32

Oh sorry the globals must only be available there after visiting a piston. If you remember the variable names you can use the second command, otherwise I’ll find the correct way to get the current variables and values tomorrow.


#33

Thank you, standing by.


#34

I updated the code posted earlier; the piston page adds that data.instance variable but on the dashboard the same data is available under scope.instance.


#35

I used the updated code “console.table(scope.instance.globalVars)” and was able to see my variables. Interestingly, it didn’t show them all. zzquotes0071 - zzquotes0110 where missing or were not displayed.

After I saw the variables I tried typing the following to clear one of my variables:

(function(name, value) {
dataService.setVariable(name, { t: ‘dynamic’, n: name, v: value}).then(function(result) { scope.instance.globalVars = result.globalVars; console.log(‘variable set’); });
})(‘zzquotes0070’, ‘’);

and the result was undefined

Is my syntax correct?


#36

Use @zzquotes0070 with the @ sign if those are global variables. If you need to change local variables on pistons that can be done as well but with different code.

Failing the console.table line you can also see all the global variables at account.smartthings.com > My Locations > smartapps > webCoRE then look for vars in the Application State section. However, that is not as human-friendly as console.table and will look like an even bigger mess if the variables contain a lot of text.


#37

That was a silly typo, thanks for the catch. I’m able to change the Global variables now thank you. Just curious, is there a command to delete global variables?


#38

This variation will delete the global variable:

(function(name) {
	confirm('Delete ' + name + '?') && dataService.setVariable(name, null).then(function(result) { scope.instance.globalVars = result.globalVars; console.log('variable deleted'); });
})('@name');

#39

@WCmore and @ipaterson THANK YOU! Piston editing access has been restored!

In summary, it seems like there is a hard limit to the amount of global variables webcore can support before you’ll lose access to the ability to edit ALL pistons.

If anyone else comes across this issue complete the following steps:

  1. Go to the webcore dashboard screen where you can see a listing of all of your pistons
  2. Right click (if in chrome) and select inspect element
  3. Click on “console” in the new window that opens after clicking inspect element
  4. Type:
    console.table(scope.instance.globalVars)
    in the console section to show a listing of all of the global variables
  5. Assuming one of your variables is named “@zzquotes0100” Type:
    (function(name, value) {
    dataService.setVariable(name, { t: ‘string’, n: name, v: value}).then(function(result) { scope.instance.globalVars = result.globalVars; console.log(‘variable set’); });
    })(’@zzquotes0100’, ‘’);
    in the console window and this will update the variable value to "
  6. Continue to clear variable values until access to the piston editing screen is restored. (in my case I had to clear 18 variables)

#40

For your use case it may be more appropriate to store the data in a third-party service. For example, with https://www.npoint.io/ you could store an array of quotes and then access them for use in your pistons with the web request action. SmartThings has hard limits on the amount of data that can be stored in any smart app, so a huge amount of text will eventually cause problems whether global or local to a piston.

Here is an example using this npoint store to show a random quote each time a piston runs:

Since the response from that request is never stored to the app’s state you’re not limited. Plus it’s much easier to use an array than individual incrementally-named quote variables.


#41

Always learning some new tricks from you :slight_smile:


#42

Perfect! Your solution worked like a charm. This solution allowed me to delete 3 pistons (the quote orchestrators) and 106 quote variables! Interestingly enough, usually when I save pistons, the maximum chucks that WebCore would allow was 11. Since eliminating all of those variables, my maximum chuck size has gone up to 14. Thank you so much!


#43

Yep that’s accurate, the chunks also vie for memory on the webCoRE smart app until the piston is fully saved.