Has anyone written Lua scenes for the WDTC-20 Thermostat? I would like to write some scripts to read the temperature using the plugin that reads the local temperature from the net (this is working for me) and then set the thermostat mode to heat or cool depending on the outside temperature.
Not being a programmer per se, I have fooled around with Lua code using simulators and such, but would do a lot better if I had some code specifically directed at the WDTC-20 to build-on. It seems like a natural application for Lua seeing as how the WDTC-20 lacks the basic setback and other features of more complex thermostats, but otherwise works very well.
I have another thread here where I am trying to get some real simple code to set the controlpoint temperature. It doesn’t work yet but it is real close and I am hoping someone gives me that last missing clue.
I am still a bit surprised given Vera’s purpose to make this stuff accessible and easy that there is no way to schedule your temperatures. It seems like a very basic thing for a thermostat to do (since all but the most basic ones have had this feature for years).
I would have thought that by now, there would have been a “Library” of code snippets and such that people have written on which us that are not programmers, could draw from and learn. It seems that there is a certain, albeit unintentional, “them and us” division of users who are skilled in Lua programming and those that are not. I guess I’m in the middle ground in that I have some coding experience with industrial controllers using ladder logic, but program code is a stretch for me.
I would at least feel better if MCV would start believing that Lua is NOT a simple macro language, but rather a complex programming environment of which requires a special skill. I know I have said this before, but my Elk M1 system (different location than Vera) has a very simple set of macro commands that enable you to do almost anything, without knowledge of programming. It uses simple combinational logic and, or, if, then, else, etc. MCV should have put their energy into something similar and we would all be much further along.
Sorry to ramble, but I really like my Vera, and feel frustrated that I cannot do things I feel should be simple.
Everyone of you that has done some Lua code, is using it and it works, if he/she wants, post it on a Wiki page or here on the forum. We will make an organized place for all of them soon.
I believe MCV is still planning on providing some way of turning simple conditional logic into lua code.
It was mentioned awhile back that they would be doing a web-based application that would allow users to apply simple IF, THEN, AND, OR type logic to their scenes via luup/lua. Right now, this is still a manual coding process that does require some background with the lua language… but hopefully this will become a more visual process in the future.
Maybe mcvovidiu can chime in here and confirm/deny if this is still in the works… possibly part of the new flash-based ui that is rumored to also be in the works…
Currently, we are working of making as stable as possible what we have now on Vera, all new features, X10 and Insteon. We will see later how we can make this request feasible. For now, the architecture of Vera (Scenes, Timers, Events) and some Lua code should do the IF, THEN, AND… as much as possible. We know that you would like more; so do we! Thanks.
It also has a snippet example of how to “get” the temperature from a certain device, notably:
local lul_temp=luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature",3)
if( tonumber(lul_temp)<26.6 ) then
return false
end
It doesn’t fully answer your questions, but it at least contains most of the pieces of script now, hopefully this will get you a little closer