Author Topic: Luup Code Generator new version 1.028  (Read 32288 times)

Offline MNB

  • Hero Member
  • *****
  • Posts: 689
  • Karma: +4/-9
Re: Luup Code Generator
« Reply #30 on: May 22, 2011, 12:05:08 pm »
TimAlls, I agree with you it is frustrating to not being able to debug one code without trial/error. On thing to consider especially with time based code or duration code of somehow being able to shorten the duration in order to watch the code real time execute without having to wait for sunset/sunrise or 11:30pm. Patiently awaiting

With all this work that your doing, me thinks you should be looking for donations (shareware wise) once the code becomes more stable, I for one will donate... ;D

Mike
Edge-1.7.2607, VRI06-1LX Dimr (6), VS05-1LX Sw (4), GE ZW3002 Dimr (1), HA01C Outlet (12), HA02C Sw (6), HA04C Sw (4), GE Sw (2), HA05 Sw (3), MiniMote Contr (5), HSM200/100 Sensor (2), ZW100A Sensor (8), Nest thermostat (1) & Protect Fire/CO (6) Kwikset Locks (3), F18918W (1) & IP3M-9 (6) Cam's

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #31 on: May 22, 2011, 01:41:27 pm »
@Michael,
I agree with what you are saying about watching time. My original ideas went out the window when I started writing and testing code.
I am a visual person.....show me what's going on! That's the way I learn. Just finished a variable watch routine and you sparked an idea....in addition to watching the variable it would be nice to change....or push time forward. I will work on that as well. One needs to create the code and accelerate the timing and watch events take place, other wise you will take days to debug the code.
I have to start another topic right now because I am creating new variables in the advanced tab of devices and using them in my code.that way I can watch them as well. Very easy but will it have any contrary reactions. I don't want to crash the little bugger!
More to come......
Regards
Tim

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #32 on: May 25, 2011, 08:16:22 pm »
Code Generator Version 1.0:http://www.box.net/shared/4sv0ocdfc8

Hi All,
I think the hard work is starting to pay off! The variable watch program is working well and it has allowed me to test code very quickly. I am able to place variables after every calculation or command if needed to see what is going on.
The Report Generator is now merging with the Code Generator....so they are the same from here on out.
The idea is that we parse the system and create a unique set of tables to draw off of for our drop down boxes.....in other words you don't have to remember your ID numbers, it remembers for you.
This is the first of the series I will be posting for code generation. This is version 1.0 and it needs you to try it out and give me feedback. Goto the tab for code and follow the line by line instructions...it walks you through a step at a time. When you are done you will have a scene that will operate only from timeA to timeB. You will be able to adjust the time by using the Vera UI....under the advance tab for the device. You will be able to watch variables update every minute when the scene timer runs and you can see the results of the math used.....
Check it out. If it makes sense and is easy to use, then I will push on.
Thanks for your help in this project.

Regards
Tim Alls
AllSeas Yachts

Offline MNB

  • Hero Member
  • *****
  • Posts: 689
  • Karma: +4/-9
Re: Luup Code Generator
« Reply #33 on: May 25, 2011, 10:14:40 pm »
@TimAlls, question I notice that both the report and code generator for some reason only display devices A-L all of my M-Z lettered devices are missing ??? Mike
Edge-1.7.2607, VRI06-1LX Dimr (6), VS05-1LX Sw (4), GE ZW3002 Dimr (1), HA01C Outlet (12), HA02C Sw (6), HA04C Sw (4), GE Sw (2), HA05 Sw (3), MiniMote Contr (5), HSM200/100 Sensor (2), ZW100A Sensor (8), Nest thermostat (1) & Protect Fire/CO (6) Kwikset Locks (3), F18918W (1) & IP3M-9 (6) Cam's

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #34 on: May 25, 2011, 10:33:12 pm »
@TimAlls, question I notice that both the report and code generator for some reason only display devices A-L all of my M-Z lettered devices are missing ??? Mike

I must have screwed something up...ha. I have your JSON.....I will plug it in and test it.

I would love it if you could look at the presentation of the code tab and give me feedback. I want to lay a foundation for a lot of code to be placed so now is the time to make adjustments. As a user trying to
learn code what could be better. Don't worry about nit pickin....it all helpful and you won't step on my toes. Same for the rest of you.
Regards
Tim

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator new version 1.024
« Reply #35 on: May 29, 2011, 01:08:35 am »
Here is the latest:
Rebuilt the parsing routines to read older Firmware.
Added new reports.....auto export straight into Excel for easy formatting
Added new UserData2 report
Added settings file to remember your IP
Fixed camera missing : on IP address
Reads German Json files
Easy drop down boxes for Variable Watch
Easy drop down box that fills in the Code.....just copy and paste

I still need feedback on the code generator......try it out.

Regards
Tim Alls
AllSeas Yachts

Offline umtauscher

  • Full Member
  • ***
  • Posts: 223
  • Karma: +0/-0
Re: Luup Code Generator new version 1.024
« Reply #36 on: May 29, 2011, 07:58:33 am »
Hi Tim,

I finanally had the time to check it out.
Its much better now, but my older firmware still seems to have a will of its own.
I get only 1 room, while as you can see from the snippet of usredata2 there are 8.
I suppose the json interface of my firmware simply doesn't do it.
Thanks
Umtauscher

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator new version 1.024
« Reply #37 on: May 29, 2011, 09:37:25 am »
Hi Tim,

I finanally had the time to check it out.
Its much better now, but my older firmware still seems to have a will of its own.
I get only 1 room, while as you can see from the snippet of usredata2 there are 8.
I suppose the json interface of my firmware simply doesn't do it.
Thanks
Umtauscher
The older firmware doesn't have as much information as the new firmware. I rewrote the coding to make sure the devices and scenes would come through. You should be able to run the Variable Watch as well as the new Code Generator. Just ignore the rooms and categories for now.....
I hope you find the program useful. I am adding more code examples as well as lock support today.
Just an interesting note:
When I ran your HTML reports using Google Chrome it ask me if I wanted it to translate the file from German to English......I said why not, and it automatically translated everything perfectly!

Ich hoffe, Sie genie├čen die Software

Regards
Tim

Offline Henk

  • Hero Member
  • *****
  • Posts: 820
  • Karma: +3/-0
Re: Luup Code Generator new version 1.024
« Reply #38 on: May 29, 2011, 10:00:45 am »
Hi Tim,

So you went for converging the Report tool and the Code generator? Not bad!

Here are a few remarks:

1. HTML report for devices
   - No header line for colums
   - Only 1 device is shown
   - Difficult to read dus to narrow columns

2. HTML report for scens
   - Clearly readable (well designed table)
   - No colum headers (what value is what?)

3. Rooms tab
   - Due to fixed column width not all data is readable to humans.

(option to have columnwidth scalable to contents (up till a max and then start to wrap text?)

As for the code page, after i have had some time to play with it ill write a How To following your 7 steps.
Maybe its usefull to get some of your work listed here:
http://wiki.micasaverde.com/index.php/Scripts_for_scenes

--edit--
Where are the settings (on IP) stored? The app says c:\settings.txt but i cant locate the file there.
What if i needed to change the IP manually?
Is it doable to store the settingsfile in the same path as the app?



« Last Edit: May 29, 2011, 10:05:48 am by Henk »
| Vera2 @ UI4 1.1.1350 / 3.20 | Vera Lite @ UI5 | Vera 3 @ UI5 | 2x Merten  504519 | 1x Duewi  064374 | 1x Everspring SM103 doorbell mod |1 Y-cam IP cam | various LUUP plugins |

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator new version 1.024
« Reply #39 on: May 29, 2011, 10:22:44 am »
Thanks Henk,

Code: [Select]
1. HTML report for devices
   - No header line for colums
   - Only 1 device is shown
   - Difficult to read dus to narrow columns
I added the Excel output to help with the problem. The JSON outputs vary widely as to the column formats and I can't keep up with the variations from Firmware to firmware. My solution is transfer the information into a spreadsheet and let the user edit the format to fit his system and firmware. I want to move on to the bigger task at hand......code generation and a PC based UI for touchscreen computers and laptops.
Please explain only one device is shown....Is the program not detecting all your devices?
I rewrote my code to read older firmwares so I am hoping I didn't break something in the process!

I regards to Coding, I am new to Luup coding so I am relying on code donations from other programmers....no offers yet.
I am hoping some Newbies will try out my example and let me know if the program helps bridge the fear of adding Luup code to their scenes.
We will see!

Regards
Tim

Offline Henk

  • Hero Member
  • *****
  • Posts: 820
  • Karma: +3/-0
Re: Luup Code Generator new version 1.024
« Reply #40 on: May 29, 2011, 10:26:34 am »
Thanks Henk,

Code: [Select]
1. HTML report for devices
   - No header line for colums
   - Only 1 device is shown
   - Difficult to read dus to narrow columns
I added the Excel output to help with the problem. The JSON outputs vary widely as to the column formats and I can't keep up with the variations from Firmware to firmware. My solution is transfer the information into a spreadsheet and let the user edit the format to fit his system and firmware. I want to move on to the bigger task at hand......code generation and a PC based UI for touchscreen computers and laptops.
Please explain only one device is shown....Is the program not detecting all your devices?
I rewrote my code to read older firmwares so I am hoping I didn't break something in the process!

I regards to Coding, I am new to Luup coding so I am relying on code donations from other programmers....no offers yet.
I am hoping some Newbies will try out my example and let me know if the program helps bridge the fear of adding Luup code to their scenes.
We will see!

Regards
Tim

The HTML report only shows 1 device (no others) in my particular case the DAD device.
As you might remember, im on 1.1.1245

more remarks;
Unable to close the app unless by going to the first tab and click quit... major annoyance!
| Vera2 @ UI4 1.1.1350 / 3.20 | Vera Lite @ UI5 | Vera 3 @ UI5 | 2x Merten  504519 | 1x Duewi  064374 | 1x Everspring SM103 doorbell mod |1 Y-cam IP cam | various LUUP plugins |

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator new version 1.024
« Reply #41 on: May 29, 2011, 11:09:52 am »
Henk,
Give the DAD control a name.....I suggest Z.DAD
This will place the device at the bottom. This plugin display tons of great information. Unfortunately, the JSON outputs all the data as well making a Display Table  fun to deal with when most devices only have a few pieces of data.
Try my new Excel Output if you have Excel....it's a much nicer output than HTML.

Your table is there.......you have to scroll to the right to find it!
I will be setting up a special place for the DAD information to go. Most likely it should have an entire table to itself.

I will change the stop button.....thanks for the feedback.

Regards
Tim

Offline Henk

  • Hero Member
  • *****
  • Posts: 820
  • Karma: +3/-0
Re: Luup Code Generator new version 1.024
« Reply #42 on: May 29, 2011, 11:18:43 am »
Henk,
Try my new Excel Output if you have Excel....it's a much nicer output than HTML.

How about creating comma seperated value lists (.csv) so any spreadsheet can open it, be it excel, calc or whatever)
| Vera2 @ UI4 1.1.1350 / 3.20 | Vera Lite @ UI5 | Vera 3 @ UI5 | 2x Merten  504519 | 1x Duewi  064374 | 1x Everspring SM103 doorbell mod |1 Y-cam IP cam | various LUUP plugins |

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator new version 1.024
« Reply #43 on: May 29, 2011, 01:19:34 pm »
Henk,
Try my new Excel Output if you have Excel....it's a much nicer output than HTML.

How about creating comma seperated value lists (.csv) so any spreadsheet can open it, be it excel, calc or whatever)
Sounds like a good idea.....

I found several small bugs and fixed that as well as giving you options on the way you view your Device Data......this will help with older firmwares
I moved the quit button to where it is always seen.

Latest Version: http://www.box.net/shared/rq4cvjf5e0

Regards
TimAlls

Offline ballroller

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +0/-0
Re: Luup Code Generator new version 1.027
« Reply #44 on: May 29, 2011, 04:02:15 pm »
The Excel option is wonderful!

My Schlage locks don't show up as an option in the code generator examples.

Is there a way to show the actual scene information other than whether it's active or not? IOW, what the scene is supposed to do?