Possible bug (scene editing) - Luup code for scene (Vera Plus)

In scene editing dialog “Also, execute the following Luup code:
If I want to edit the Luup code of a scene it should show the current added code and button for save or edit.
instead of the normal thing, the interface adds a blank field everytime i try to press the arrow to edit the existing code… and it is frustrating because I have to edit a previously wrote code and I don’t have it in another place.

Firmware version 1.7.3532
Google Chrome 63.0.3239.132
It manifests on Edge too.

Hi all,

Just noticed that for some of my scenes, I can’t edit the LUA code anymore! For some it works like normal.
What happens is that I click the “Also, execute the following Luup code:” right arrow as normal to edit the script.
It then opens a new and empty code section below the “Finish” button. All that’s there is the “Enter your Luup code here…” message. But the scene clearly has existing code, it just don’t open it in the editor.

I have had similar issues before, but I believe it was fixed by saving the scene and reloading. That does not help now, neither does a full restart of the unit.
Unit is VeraPlus with latest firmware 1.7.3532.
Browser or PC is not the issue, tried them all. Local or remote access does not change anything. Some scenes/code can be edited, others not.

Please see screenshot attached.

Very frustrating, any help is highly appreciated!

Hello there,

I have merged the topics.
I have personally tested this as we speak and could not replicate. Can you please log a ticket with our Customer Care team and also mention what browser are you using? Google Chrome seems alright tho. Is this a new scene or an existing one. You say that it replicates for “some” of the scenes. Do these scenes have something in common?

Thanks

The bug appears only on a longer code…
For example the standard code for “conditional execution by date” … the code posted on forum …as tutorial.

Thanks, any info you can give, please do. Also, attach the sample codes in the ticket.

In previous version I had this code:

local mdStart = "12/01" -- Start of period (MM/DD) local mdEnd = "12/31" -- End of period (MM/DD) local allow = true -- true runs scene during period, false blocks it local smS, sdS = string.match(mdStart,"(%d+)%/(%d+)") local smE, sdE = string.match(mdEnd,"(%d+)%/(%d+)") local mS = tonumber(smS) local dS = tonumber(sdS) local mE = tonumber(smE) local dE = tonumber(sdE) local tNow = os.date("*t") local mN = tNow.month local dN = tNow.day if (mE > mS) or ((mE == mS) and (dE >= dS)) then return (((mN > mS) or ((mN == mS) and (dN >= dS))) and ((mN < mE) or ((mN == mE) and (dN <= dE))) == allow) else return (((mN > mS) or ((mN == mS) and (dN >= dS))) or ((mN < mE) or ((mN == mE) and (dN <= dE))) == allow) end

after update
I can’t edit it. The UI is adding a blank edit box every time I press the arrow to edit.
Maybe you find a workaround to edit this code in scenes.

[quote=“stefanradu5, post:4, topic:198479”]The bug appears only on a longer code…
For example the standard code for “conditional execution by date” … the code posted on forum …as tutorial.[/quote]

That could be coincidental, I have long code that can be edited fine, and short code which can’t.

Yep … using < in code in Vera … can be tricky … because they use XML wrappers at time … and it gets confused …
Flip your comparisons around to always is > …

OR … put your code in an LUA file and load it at startup … then you will not have to fight with the poor Vera design flaws …

http://forum.micasaverde.com/index.php/topic,33226.0.html

I have the same behavior, but if your are right, how to edit scene to modify the scripts?

I mailed support but without answer at this time.
I hope the upgrade will come soon from micasaverde…

You shoild just delete the scene and start over.

Sent from my SAMSUNG-SM-G935A using Tapatalk

You got to be kidding. People have tens of hours of code invested in scenes, and you suggest just delete it because of a bug that prevents editing? The code is still there, and it was completely editable until recently. It exists in backups too, no reason to delete it.
I thought my code was safe within the scenes, with both automatic and manual backups. I realize it isn’t, will back it up in local files from now. But first, MCV needs to get back and fix this nasty bug.

You got to be kidding. People have tens of hours of code invested in scenes, and you suggest just delete it because of a bug that prevents editing? The code is still there, and it was completely editable until recently. It exists in backups too, no reason to delete it.
I thought my code was safe within the scenes, with both automatic and manual backups. I realize it isn’t, will back it up in local files from now. But first, MCV needs to get back and fix this nasty bug.[/quote]

I was thinking the exact same thing this morning about the Apple HomePod saga - people are having a lot of problems getting them connected, and the advise is to clear your HomeKit setup and try and pair it again.

That makes sense to all the people trying this and many are having success.

But I’m sitting here thinking - so what about those invested in HomeKit, the official stance to fix the HomePod is to completely delete your entire home automation setup and start from scratch?

Officially pleased to have gone Z-Wave instead and then integrate that back into HomeKit - thus all the benefits of HomeKit but the entire setup in it is simply an import.

Slightly off topic, but just sharing your horror in having to delete a major investment because of a quirk.

You got to be kidding. People have tens of hours of code invested in scenes, and you suggest just delete it because of a bug that prevents editing? The code is still there, and it was completely editable until recently. It exists in backups too, no reason to delete it.
I thought my code was safe within the scenes, with both automatic and manual backups. I realize it isn’t, will back it up in local files from now. But first, MCV needs to get back and fix this nasty bug.[/quote]

I keep my LUA code in text files on a NAS so I can copy and paste them as needed.

[quote=“RichardTSchaefer, post:10, topic:198479”]You shoild just delete the scene and start over.

Sent from my SAMSUNG-SM-G935A using Tapatalk[/quote]

Thank you Richard ???

These scenes worked before an update from micasaverde… Until they work on this bug and find a way to solve it, I’m not sure deleting scene then re-create, re-delete it because there’s already a bug, then re-delete… is a good choice.

Maybe the good choice is to not using scripting… Then why not change for another box? :stuck_out_tongue:

And just my 2 cents for solve it : one of my bugged scene contain only this code, is there an error somewhere ?

-- CCTV ON : luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","RunScene",{ SceneNum="120" }, 0)

I have several scenes that is affected that I am sure have no < > operators. They have worked without a glitch for months and years. The reason for this situation has to be a bug recently introduced. I really hope the guys at Vera will look into it soon. No response from support yet.

Hi,

They had issues with handling “special” characters before in UI7. Typically ones that are special in HTML. Just a bit of poor coding if you ask me. In those cases a special character in one scene could impact a number of others as well as a file storing all got “corrupted” so the read routines would not be able to read back the LUA code for you to edit. This made it especially hard to isolate the one scene causing the issue. However, back then the scenes LUA was stored in plain text so at least you could find the problematic one by looking at the user data. To remediate the special character issue they now encode the LUA code in the user data so you cannot read it that way anymore.

[update] If you want to centralize all your Scenes code you start with what I put together. You can plugin your scenes LUA in the ScenesCode_1 table. Note that is you want to use luup.call_delay or luup.call_timer you cannot put that code in the ScenesCode_1 table, but have to add those functions to the end of the file else they will not be visible to the LUA compiler.

Success, Rene

BTW, I just found a trick to get all you scenes code, but use at your own risk. Make a backup of your Vera before you try.
All scenes LUA code are loaded with the Start up LUA. If you deliberately put an error in the start up lua you will see a readable dump of all your scenes code in the log file. If you already have the Error in LUA for Scenes at startup you will see the dump as well.

Support reached out to me with a firmware downgrade link this weekend. Applied it yesterday, all back to normal again regarding code in scenes.

However, it seems like my frequent restarts are back. Will monitor it closely.

For me, 2 request and no answer from support… Sinc?res at least 1 week!

Edit : Support answer me the 2 times. But there mails was considered as spam by my mailbox. Apologize about this.

They consider this as a bug. So I will try to downgrade soon.

Same problem here. Longer scenes with lots of logic in cannot be edited. The scenes still run, but I cannot edit code. Since the most recent firmware finally added the Fibaro FGS-223 I had to reinstall these - and they are now working fine, so a firmware downgrade is really not what i want.
But if the have acknowledged this as a bug, can we hope for a fix in the next firmware version? I can hold up on editing my scenes for a bit more as long as I know i get a working version.
Really crappy behaviour though introducing this kind of bug to a very central function of the Vera. >:(

This is ready for QA and will be part of 7.26 (next) firmware. Sorry for the inconvenience.