URGENT HELP ! OH **** PLEG just died

Let me clarify, I was able to use the fix noted in this thread to downgrade my PLC and PLEG apps and for the most part this fixed the issue, however, 1 of my 3 PLEG devices lost the service=“urn:rts-services-com:serviceId:ProgramLogicC” variable=“Actions” and therefore all actions for that device were missing.

In an attempt to solve the issue, I tried several of the Vera automatic backups between 10/17 and 10/28. Each time I restored, I was able to hop over to the Apps tab and disable auto update on PLC and PLEG before the system tried to update again. Each restore completed successfully, yet each time the same PLEG device was missing service=“urn:rts-services-com:serviceId:ProgramLogicC” variable=“Actions”.

After browsing all the files in /etc/cmh-ludl on both the Vera and inside of some old backups I was unable to locate the data previously contained in service=“urn:rts-services-com:serviceId:ProgramLogicC” variable=“Actions”. - If anyone knows if it’s possible to extract this data from a backup and which file contains this data I could just copy that out and restore it.

Since I was unable to find the lost service=“urn:rts-services-com:serviceId:ProgramLogicC” variable=“Actions” data, I gave up and just went to the device, added new service service=“urn:rts-services-com:serviceId:ProgramLogicC” variable=“Actions” and started inputting the actions again from some old notes. I was able to successfully input actions through the PLEG device actions GUI and those actions were successfully saved in the service=“urn:rts-services-com:serviceId:ProgramLogicC” variable=“Actions” block on the advanced tab.

Unfortunately, after all that, the actions for this PLEG device won’t run, even when commanding it with the run button on the actions tab. I hate to have to delete the device and start over, but it looks like that’s what I’ll have to do.

I see so the Actions variable was totally missing, I was going to suggest then to manual add that Actions variable again in the Services tab. But looks like you have done this already.

So if you manually create the actions variable so its there and present and then you do a backup restore what happens?

Does the actions variable then vanish again ?

Yes, I manually created the variable and tried another restore and it brought me back to the same place, missing actions variable.

The current UI is terrible at maintaining sync with Luup. Things like restores, adding and removing devices, installing/uninstalling plugins, all pretty much require that you do a hard-reload of your browser to restore sync Otherwise, you may see empty state variables (when they are not) and invalid device information all over the place. It’s even possible to get errors when going into various plugins that expect the data to be set/synced. In the worst case, a plugin may decide that something is uninitialized and default it.

You may be chasing your tail…?

Hard refresh browser: How to do Hard Refresh in Chrome, Firefox, Edge and Mac’s Browser?

Rigpapa’s Rule #1: any time things don’t look the way you think they should, hard refresh.

Rigpapa’s Rule #2: If that doesn’t work, reload Luup and repeat #1.

2 Likes

Thank you for the insight. Each time I have made changes, performed restores, or reloaded Luup, I wait for the action to finish and I hard refresh Chrome with Ctl+F5

1 Like

Ok, I made a little progress. Turns out it looks like the newly created actions are running with the run command from the PLEG device, but any of the actions that contain Luup code seem to run without executing the Luup code…

Do I have to have a “return True” in my Luup entries here?

Don’t think so, any LUA code in your pleg action should be executed when the action is run.

Thanks, I didn’t think so either, I tried with return true and no change.

Basically, it looks like I have everything reconfigured for this PLEG device and it’s mostly working, but not running any of my Luup actions.

Test the Lua code actually works on the Vera menu App - Develop Apps - Test Luup Code.

Or maybe try creating a new PLEG device and quickly setup one in that device, does the action run OK and also execute the Lua code?

1 Like

Ok, there does seem to be an issue with my code, even though I’m pretty certain it’s the same as I used before. When I tried to test it on the Test Luup Code page I got a failure message, and backed it up until I got successful. For some reason, it’s not liking my Vera Alerts message code:

local speakTell = "{tone:tts} Low tonight is " .. lowTemp .. " and Vera just triggered Bedtime!"

If I remove the concat and second phrase it works

local speakTell = "{tone:tts} Low tonight is "

Am I missing some quotes or braces? I’m am certain this code has been working for years before this issue because I pulled the code from an old PLEG status report.

There seems to be to many periods, and there’s pretty quotes, that may just be forum as you posted without backticks ```

local speakTell = "{tone:tts} Low tonight is "  .. lowTemp  .. " and Vera just triggered Bedtime!"

Hmm, maybe I’m blind but that looks the same to me:

local speakTell = "{tone:tts} Low tonight is " .. lowTemp .. " and Vera just triggered Bedtime!"

That’s double quotes around string 1, the 2 periods to concat lowTemp, then 2 periods to concat string 2, which is in double quotes.

Do we have to escape characters on the forum even when using code blocks? It seems to show correctly in my browser.

Well here is what i just copied from your previous post.

local speakTell = “{tone:tts} Low tonight is " … lowTemp … " and Vera just triggered Bedtime!”

Yeah, that’s odd. I did edit to put the code inside of a codeblock, but I didn’t change the number of dots.

May be look at your edits will show what happened. Either way what you have now should work.

Thanks for the help. Still seems broken, best to walk away and try again later. I just made it into one string for now so that the following actions can run. I’ll post back when I reattack the problem.

Wait, if this works:

local speakTell = "{tone:tts} Low tonight is "

… and this does not

local speakTell = "{tone:tts} Low tonight is "  .. lowTemp  .. " and Vera just triggered Bedtime!"

then my suspicion is that lowTemp is nil for some reason. Change your line to this (nil-proof) and see what happens:

local speakTell = "{tone:tts} Low tonight is "  .. tostring(lowTemp)  .. " and Vera just triggered Bedtime!"

Thank you Sir!! That was it! My device had changed from Wunderground to Dark Sky since I made those notes, so I just had to correct the service ID and device number. Much appreciated!

Still not sure how I lost just that one variable from just one PLEG, but it’s rebuilt now pretty close to what it was and I have fresh backups.

Thanks all for assistance!

2 Likes

Mine failed too. Seems ok after loading the older versions. All respect to RTS who gave us such a good App that has otherwise worked faultlessly. Good luck as he works on the fix.

Thanks to the guys who made the workaround to revert to an earlier version. It worked perfectly for me as an interim until the latest version is repaired.