Cannot save piston editing session, State Character Limit Exceeded Exception


#21

I am running out of things to say, other than this simple analogy:

If 10 basketball players are crammed into a closet, even if one left, you would likely STILL feel crowded.

I know you don’t want to hear this, but you are way too close to the maximum piston size. The more complex the piston is, the more ‘elbow room’ I would recommend. Yes, I believe you could get this piston running, but the moment you needed to tweak your code, or add another device, you would be back in the same boat you are in now.

The only two choices I see is to (A) simplify the code, or (B) split it into two pistons.

Personally I like (B) better because that gives you more options and more room for growth… but that is just me. Either way, keep us posted.


#22

I notice that lines 54-93 in the long example above could be moved to a separate piston if you used global variables… That would likely drop a chunk or two… Although, I am not sure how well webCoRE can track changes to global variables. I know they cannot be written to and then have the new data read back during the same execution. but if one piston is writing the globals, and shortly thereafter, another piston is reading the globals, then you should be fine.


#23

WebCoRE autonatically reduces memory usage from logs etc as required so you really don’t need to worry about the value returned by the browser.

Using the rebuild data cache function you can force it to reduce immediately but really not necessary for that purpose.


#24

About chunks:

Because ST does not allow CORS, webCoRE uses jsonp from the browser. The problem with jsonp is it uses the query string, which means you have a size limit of about 3kB. If the piston is larger than that, It needs to be split into chunks. But each chunk counts as a request to ST (there is a limit per minute).

If you are getting errors, try waiting one minute before hitting that Save button, see if it helps.


#25

Thanks for all the replies. It has allowed me to decide that webCoRE is not the best solution for my problem. Instead, this is what I have come up with.

While developing this alternative, I stumbled on a way to investigate state (and other) information of your SmartApps in the ST IDE: My Locations: <location>: List SmartApps: <smartapp>. Not only was this very helpful in developing my own SmartApp, it is enlightening (genearally and with regard to the subject of this thread) when looking at webCoRE written smartapps.