OpenSprinkler App bug when zone named Null

@ui677fik I have a vera and an opensprinkler, and I saw your plugin and thought it’d be cool to tie them together.

But I can’t seem to get it to connect right.

What i see in the holy blue bar on the top is:
OpenSprinkler Control [186] : Startup Lua Failed

In the log file, I see references to calling my opensprinkler ip / ja and it gets http 200. cv gets a 200 as well.
LuaInterface::CallFunction_Timer-5 function updateFromController failed [string “module(“L_VeraOpenSprinkler1”, package.seea…”]:439: attempt to index local ‘jsonResponse’ (a nil value) <0x74690520>

I hit the cv url via curl and the cv one was able to disable/undisable my sprinkler controler. Cool!
I also checked, and toggling the on/off in the vera interface does eventually disable/enable my sprinkler controller. but its like the vera doesn’t know it changes when it changes. I think the vera is not interpreting the data it gets back from /ja. Here is a copy of it:

{“settings”:{“devt”:1595899592,“nbrd”:1,“en”:0,“rd”:0,“rs”:0,“rdst”:0,“loc”:“39.02362,-94.69357”,“wtkey”:"",“sunrise”:376,“sunset”:1236,“eip”:2147483647,“lwc”:1595898821,“lswc”:1595898821,“lupt”:0,“lrun”:[4,99,125,1595877510],“sbits”:[0,0],“ps”:[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],“wto”:{“baseETo”:0.154,“elevation”:980},“ifkey”:“redactediftttkey-adshfisudhhkjsh”},“programs”:{“nprogs”:6,“nboards”:1,“mnp”:34,“mnst”:4,“pnsize”:20,“pd”:[[0,80,0,[20540,2,12,0],[120,240,120,0,0,0,0,0],“Front&South”],[0,80,0,[20540,0,0,0],[0,0,0,900,0,0,0,0],“Back”],[1,105,0,[20540,3,10,0],[0,300,0,300,0,0,0,0],“Front and back”],[0,1,0,[0,1,3,0],[0,60,60,60,0,0,0,0],“Niñas”],[4,1,0,[0,24,5,0],[0,60,0,0,0,0,0,0],“Front in spurts”],[1,120,0,[0,10,20,0],[0,0,50,0,0,0,0,0],“South Lawn WaterIn”]]},“options”:{“fwv”:218,“tz”:28,“hp0”:80,“hp1”:0,“hwv”:64,“ext”:0,“sdt”:-5,“mas”:8,“mton”:0,“mtof”:-5,“urs”:1,“rso”:1,“wl”:0,“den”:0,“ipas”:1,“devid”:0,“con”:150,“lit”:100,“dim”:50,“uwt”:131,“ntp1”:50,“ntp2”:97,“ntp3”:210,“ntp4”:169,“lg”:1,“mas2”:0,“mton2”:0,“mtof2”:0,“fwm”:1,“fpr0”:100,“fpr1”:0,“re”:0,“dns1”:8,“dns2”:8,“dns3”:8,“dns4”:8,“sar”:0,“ife”:255,“sn2t”:0,“sn2o”:0,“reset”:0,“dexp”:-1,“mexp”:8,“hwt”:255},“status”:{“sn”:[0,0,0,0,0,0,0,0],“nstations”:8},“stations”:{“masop”:[127],“ignore_rain”:[0],“masop2”:[0],“stn_dis”:[32],“stn_seq”:[127],“stn_spe”:[0],“snames”:[“Mulch Bed”,“Front”,“South”,“Rear”,“North”,“S06”,“Null”,“Master”],“maxlen”:24}}

I was reading through that paste, and noticed I had a zone named Null and thought huh. Null, Nil. problem? so I renamed it ‘unused’ and what do you know… No more errors…

So I think I found a bug. The app is allowing a string literal to be re-classed as a null value if the string is the four chars “Null” That zone is null/unused, so I called it null years ago, and it bit me in the ass today.

Now I want to see how to control individual zones or do fancier stuff than just disable/enable the controller with a binary switch in vera.

1 Like

Thanks for reporting. I’ll try to fix it in a future update.

1 Like