Luup Code Generator new version 1.028

Download the latest code generator:
[url=http://www.box.net/shared/cs0bxr7ho1]http://www.box.net/shared/cs0bxr7ho1[/url]
The screenshots are from my original program…the new version is quite different and incorporates a view of all your scenes and devices. Take a look and give me feedback, hopefully this will help Newbies get started with custom Luup code…all copy and paste, no experience needed. I currently have one example and will be adding lots mnore very soon!
END EDIT…

Hi All,
Take a look at the screen shots from the Luup code generator…the basics are tested and functioning perfect.
The first screen shows a dimmer being staged as the “if” input and the second shows the “If / Then” code being generated.
The “If / Then” tab has a pull down control where you select where the staged code is coming from…eg dimmers levels, thermostat level, zone status, etc. and the second pull down box selects the actions to perform…eg trigger a scene, dim a light, etc.
Getting closer and would love feedback if you are interested.
This will help all of us who are new to Luup coding get started and learn more rather than be overwhelmed!
It will be easy to expand off of this idea with more function.
Regards
Tim Alls
AllSeas Yachts

Nice job man !!! :smiley:
Where can i get that program to test too?
best regards.

The code generator is still in developement but still useful even though it is not finished. I recommend you download the Vera Report Generator first which will give you device number and names for dimmers, scenes, and security zones. It will generate two reports…one is a table of your devices with device numbers and names and the other report will give you your raw JSON output.[url=http://www.box.net/shared/jhq6sxojrm]http://www.box.net/shared/jhq6sxojrm[/url]
Then download and play with the Code Generator.[url=http://www.box.net/shared/es8jd1k323]http://www.box.net/shared/es8jd1k323[/url]
Labview runtime engine is required to run any of my programs…free at [url=http://ftp.ni.com/support/softlib/labview/labview_runtime/8.0/windows/LabVIEW_8.0_Runtime_Engine.exe]http://ftp.ni.com/support/softlib/labview/labview_runtime/8.0/windows/LabVIEW_8.0_Runtime_Engine.exe[/url]

Regards
Tim Alls
AllSeas Yachts

Tim, Great start… Like your tabs construction logical and makes sense. :-* will play with it and provide any observations.

As a luup noob, this will be a tremendous help. I’ve had a Vera forever, but only recently got communication gong to my alarm panel, which opens up interesting possibilities for doing things automatically when doors open and such. Luup seems powerful but the syntax is pretty ugly, especially when you’re spoiled with auto-complete in Microsoft IDE’s.

I look forward to trying this!

Really interesting work, Tim! While it’s not finished, it’s light years ahead of anything else out there. Especially when MCV told us that it was immensely complicated and probably not going to happen from them anytime soon.

I can’t wait for the final polished version. If I can add my .02 from a basic user’s point of view- the final version needs to be in a very simple format that anyone can use easily. Pick x,y,z etc from a drop down menu and have a final code produced that can be copied and pasted into the LUUP tab on the UI (with directions). My point-don’t assume we know what you are talking about! Sometimes programmers talk to programmers at a level that doesn’t translate to the bottom rung. And while it might work beautifully, the masses can’t figure out what to do with it!

I’ll be happy to be the guinea pig anytime you need me!

Thanks for the feedback…the next version is going to have a few very straight forward examples in it that will allow you to pick your devices and copy / paste the code. I am a little bogged down in learning the best way to handle time events. It won’t be much longer so stay tuned!
I will need help from someone using thermostats and sensors, so let me know if your game! Just to intice you, give me the senario you want the code for and I will use it in my next version.
Regards
Tim

I have 3 thermostats (Trane) and 3 HSM100’s. And Schlage locksets. Let me know what you want me to do and I’ll do my best to help out.

A quick question on the thermostats…do any of them read temperature in tenths of a degree. I was thinking about adding a trend chart for temperature but it would be more useful if it was more accurate than a single degree.
Thoughts?
Tim

Nice application.

Some of my devices have device IDs as high as 16800. LCG seems to limit the device ID to 255.

If LCG would parse Vera’s configuration data, LCG could present the user with a list of device names (instead of device IDs).

‘If and Time Then’ and ‘Read Variables’ seem to be non-functional in the current release.

My Trane’s only read in 1 deg increments.

[quote=“TimAlls, post:9, topic:168307”]A quick question on the thermostats…do any of them read temperature in tenths of a degree. I was thinking about adding a trend chart for temperature but it would be more useful if it was more accurate than a single degree.
Thoughts?
Tim[/quote]

[quote=“Ap15e, post:10, topic:168307”]Nice application.

Some of my devices have device IDs as high as 16800. LCG seems to limit the device ID to 255.

If LCG would parse Vera’s configuration data, LCG could present the user with a list of device names (instead of device IDs).

‘If and Time Then’ and ‘Read Variables’ seem to be non-functional in the current release.[/quote]
I must have defined the IDs as byte, I will change them to I32 and look for others that might be limiting. Your system is a good test…you have a lot installed!
You are correct on the non functioning tabs, I am working on them.
I am going to merge the report generator with the LCG and do exactly what you said…drop down boxes that let you select you devices. It will make it really easy.
I have been studying another insteon controller and there cognitional logic…in a thread you steered me to, lots of good ideas.
Thanks for the feedback
Tim

[quote=“TimAlls, post:9, topic:168307”]A quick question on the thermostats…do any of them read temperature in tenths of a degree. I was thinking about adding a trend chart for temperature but it would be more useful if it was more accurate than a single degree.
Thoughts?
Tim[/quote]
Internally in MiOS, it’s being “held” as an int (i4), so you’ll see whole values only.

[quote=“guessed, post:13, topic:168307”][quote=“TimAlls, post:9, topic:168307”]A quick question on the thermostats…do any of them read temperature in tenths of a degree. I was thinking about adding a trend chart for temperature but it would be more useful if it was more accurate than a single degree.
Thoughts?
Tim[/quote]
Internally in MiOS, it’s being “held” as an int (i4), so you’ll see whole values only.[/quote]
Is that true for sensors as well? In the Wiki they have example code of temperature in a xx.x format.
Regards
Tim

The UPnP service definition also has it as i4 for the CurrentSetpoint value both as a StateVariabke and via the actions/methods

Thanks Guessed, you are right as usual!
This example is what confused me:

local lul_temp=luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”,“CurrentTemperature”,3)
if( (tonumber(lul_temp)<26.6
and tonumber(lul_temp)>25)
or tonumber(lul_temp)<23 ) then
return false
end

As it turns out the reason they used the fraction was to convert Celcius to Fahrenheit.
I was going to add trending to the temperature readouts from the thermostats, we do that on our yachts and it is very helpful. Maybe I will add it anyway and see if users like it.
Regards
Tim

@TimAlls, I take it that you’ve not released any new Generator and/or report code of late?

No, I am currently out of town…my daughters wedding!
I will have a revised Report Generator out tomorrow and by the weeks end I will have the new code generator. It took me a while to learn the time functions…I am brand new to this language!
You will like the new code generator…it uses the report generator to feed drop down boxes for picking your devices. You pick the device name and the code picks up the device number. Time is displayed in real world values but the code is converted to seconds making it easier on the Vera…less calculations. Degree conversions for Celcius and Farnht.
A couple of questions for you…
Does your report Generator have scenes in the table that were generated by notifications? (assuming you are using notifications) Corrected
Second, can you give me an example of a Luup code you would like to generate? EG Turn the lights off in the living room if there is no motion and it is after midnight.
Let me know and thanks for testing out the software.
Regards
Tim

Well, I guess a congratulations is in order! Please pass along our congrats to the Bride from the Z-people!

@TimAll, no rush, there are more important things in life than VERA and Wedding are one of them. Wish your son-in and daughter nothing but the best and my sympathy to your wallet ::slight_smile: Mike