Author Topic: Possible bug (scene editing) - Luup code for scene (Vera Plus)  (Read 2211 times)

Offline stefanradu5

  • Sr. Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
  • Vera Plus UI7
Possible bug (scene editing) - Luup code for scene (Vera Plus)
« on: February 01, 2018, 04:50:16 pm »
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.
« Last Edit: February 02, 2018, 03:48:49 am by stefanradu5 »

Offline Thorden

  • Full Member
  • ***
  • Posts: 124
  • Karma: +9/-5
Unable to edit code in some scenes
« Reply #1 on: February 13, 2018, 05:00:46 am »
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!   


Offline Sorin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +83/-10
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #2 on: February 13, 2018, 05:59:21 am »
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
« Last Edit: February 13, 2018, 06:03:21 am by Sorin M. »
Sorin M. ▾ Community Manager
Vera Control, Ltd. ▾ Smarter Home Control  ▾ support@getvera.com ▾www.getvera.com ▾ +1 (866) 966-2272

HOURS OF OPERATION for Customer Care Department - 24/7

Offline stefanradu5

  • Sr. Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
  • Vera Plus UI7
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #3 on: February 13, 2018, 06:09:48 am »
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.

Offline Sorin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +83/-10
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #4 on: February 13, 2018, 06:14:54 am »
Thanks, any info you can give, please do. Also, attach the sample codes in the ticket.
Sorin M. ▾ Community Manager
Vera Control, Ltd. ▾ Smarter Home Control  ▾ support@getvera.com ▾www.getvera.com ▾ +1 (866) 966-2272

HOURS OF OPERATION for Customer Care Department - 24/7

Offline stefanradu5

  • Sr. Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
  • Vera Plus UI7
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #5 on: February 13, 2018, 06:23:14 am »
In previous version I had this code:
Code: [Select]
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.

Offline Thorden

  • Full Member
  • ***
  • Posts: 124
  • Karma: +9/-5
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #6 on: February 13, 2018, 06:23:44 am »
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.

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


Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 10091
  • Karma: +764/-142
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #7 on: February 13, 2018, 02:06:24 pm »
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

Offline Corve

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #8 on: February 14, 2018, 01:06:42 am »
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...

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 10091
  • Karma: +764/-142
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #9 on: February 14, 2018, 12:15:52 pm »
You shoild just delete the scene and start over.

Sent from my SAMSUNG-SM-G935A using Tapatalk


Offline Thorden

  • Full Member
  • ***
  • Posts: 124
  • Karma: +9/-5
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #10 on: February 14, 2018, 02:59:51 pm »
You shoild just delete the scene and start over.

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.



Offline Tillsy

  • Full Member
  • ***
  • Posts: 207
  • Karma: +13/-5
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #11 on: February 14, 2018, 05:38:06 pm »
You shoild just delete the scene and start over.

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.

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.

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1382
  • Karma: +36/-35
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #12 on: February 14, 2018, 05:49:42 pm »
You shoild just delete the scene and start over.

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.

I keep my LUA code in text files on a NAS so I can copy and paste them as needed.
Vera 3, 1.7.1030, CT101, Everspring motion sensor, GE/Jasco switch, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, Weatherunderground, LB60Z-1 bulb, Hue, Alexa

Offline Corve

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #13 on: February 15, 2018, 04:04:54 pm »
You shoild just delete the scene and start over.

Sent from my SAMSUNG-SM-G935A using Tapatalk

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?  :P

And just my 2 cents for solve it : one of my bugged scene contain only this code, is there an error somewhere ?
Code: [Select]
-- CCTV ON :
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","RunScene",{ SceneNum="120" }, 0)

Offline Thorden

  • Full Member
  • ***
  • Posts: 124
  • Karma: +9/-5
Re: Possible bug (scene editing) - Luup code for scene (Vera Plus)
« Reply #14 on: February 15, 2018, 05:37:48 pm »
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.