We have moved at community.getvera.com

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

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #15 on: May 15, 2011, 11:52:04 pm »
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

Offline MNB

  • Hero Member
  • *****
  • Posts: 689
  • Karma: +4/-9
Re: Luup Code Generator
« Reply #16 on: May 17, 2011, 09:17:57 pm »
@TimAlls, I take it that you've not released any new Generator and/or report code of late?
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 #17 on: May 17, 2011, 10:52:07 pm »
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
« Last Edit: May 18, 2011, 01:08:20 am by TimAlls »

Offline ballroller

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #18 on: May 17, 2011, 11:41:21 pm »
Well, I guess a congratulations is in order! Please pass along our congrats to the Bride from the Z-people!

Offline MNB

  • Hero Member
  • *****
  • Posts: 689
  • Karma: +4/-9
Re: Luup Code Generator
« Reply #19 on: May 18, 2011, 01:14:52 pm »
@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 ::) 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 #20 on: May 18, 2011, 11:54:29 pm »
You guys are too much! Thanks.
I am back in town and back to work.....more to come.
Tim

Offline michaelk

  • Hero Member
  • *****
  • Posts: 633
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #21 on: May 19, 2011, 05:54:22 pm »
1) congratulations

2) MCV should pay you a consultants fee for doing their job for them. Some time ago and on more than once occasion they mentioned creating a code generator such as this because it was too complex to fix the back end and create the UI for it anytime soon.


THANKS!

I'm always amazed when a single human being whips out a solution so quickly and for free while a related commercial concern can't seem to get right. Very impressive!

Offline umtauscher

  • Full Member
  • ***
  • Posts: 223
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #22 on: May 20, 2011, 04:12:02 am »
Hi Tim,

thanks for your hard work.
Just to let you know:
The reporting tool doesn't get my switches, dimmers and sceenes right. There is an awful lot missing. What firmware version do you test with?
I am currently on 1.1.1047  on Vera 1 and am just scared to change anything.
I have attached the json report that is collected by the verareport tool.
Maybe this this helps
Cheers
Umtauscher

Offline umtauscher

  • Full Member
  • ***
  • Posts: 223
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #23 on: May 20, 2011, 04:30:21 am »
Hi Tim,

sorry, I didn't realize that you are already on version 3.
Maybe this thread should me closed then.
Thanks again
Umtauscher

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #24 on: May 20, 2011, 09:32:00 am »
Hi Tim,

sorry, I didn't realize that you are already on version 3.
Maybe this thread should me closed then.
Thanks again
Umtauscher
I am going to move all my latest versions to the top of the thread.....I will try to make things less confusing.
I will look at you JSON today and see what's happening.
Regards
Tim

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #25 on: May 20, 2011, 11:11:46 am »
Hi Tim,

thanks for your hard work.
Just to let you know:
The reporting tool doesn't get my switches, dimmers and sceenes right. There is an awful lot missing. What firmware version do you test with?
I am currently on 1.1.1047  on Vera 1 and am just scared to change anything.
I have attached the json report that is collected by the verareport tool.
Maybe this this helps
Cheers
Umtauscher
The Json file you sent me is totally different in format from the ones I am parsing.....It has a lot of []] brackets that don't add up. Does any one else have a Json file from an older firmware they can share?
Rather than clipping personal data out of the file you can XXXXXX over passwords etc..
Thanks
Tim

Offline umtauscher

  • Full Member
  • ***
  • Posts: 223
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #26 on: May 21, 2011, 04:07:01 am »
Hi Tim,

I did a bit of homework myself and formatted the json file more friendly to the human eye.
There are no missing or analigned brackets in it.
Maybe you'll have a look at it now to help you better analyze the structure of it. (I hate such interfaces by the way). I find it very confusing that the properties of the devices don't even have the same lineup. Sometime the name is the first parameter, sometimes the status.
Good luck.

Umtauscher
« Last Edit: May 21, 2011, 04:09:04 am by umtauscher »

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #27 on: May 21, 2011, 10:38:38 am »
Hi Tim,

I did a bit of homework myself and formatted the json file more friendly to the human eye.
There are no missing or analigned brackets in it.
Maybe you'll have a look at it now to help you better analyze the structure of it. (I hate such interfaces by the way). I find it very confusing that the properties of the devices don't even have the same lineup. Sometime the name is the first parameter, sometimes the status.
Good luck.

Umtauscher
That's funny .... That's exactly what I did......separate it out and look at the formatting.
I have requested documentation from MCV on the format of the file because it has changed so much......my concern is will I be compatible with the next Firmware?
The part that surprised me about your file was that "[" brackets sometimes were not followed by the "]" opposite closeout bracket and that the section layout was totally different. In the new version there are Main sections that are easy to identify.......Rooms, Scenes, Devices, Categories, Etc.. My software grabs that section and separates it out. With the older format the sections around the devices is inconsistent......well let's say it just doesn't make sense to me. I will let you know what I find out. For reporting purposes I may have to switch to the XML output to maintain compatability. I chose this format so that I could use it to poll Vera and give updated information for my new UI......thanks for the feedback, it will help me build on a solid base, I am still new to this and learning.

As to the code Generator, I was slowed down a bit but will have something new to look at this weekend!

Regards
Tim Alls
AllSeas Yachts

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator
« Reply #28 on: May 21, 2011, 07:12:14 pm »
Hi all,
Just a quick update......
I have delayed releasing the new code generator. Thanks for your patience, it won't be much longer.
I am taking longer than projected because when I started testing the code I realized the need for more tools. The main thing that bugs me as a novice to Luup is trying to debug the code.....what went wrong!
The tool I am working on right now is a variable watch. It will be helpful for all of us to be able to see the variables in the code being displayed as they change. For example, I am working on the code for "run a scene if the door is open for a set amount of time". I want to have my program display all the variables in the code so that you can see the door status, watch the door timer, etc. Etc.. This will really help us see the code in action and debug it without pulling out the last remaining hair on our heads!
Stayed tuned.....good things are coming.
Regards
Tim Alls
AllSeas Yachts

Offline Henk

  • Hero Member
  • *****
  • Posts: 820
  • Karma: +3/-0
Re: Luup Code Generator
« Reply #29 on: May 22, 2011, 08:18:34 am »
@TimAlls

Tim, i was wondering, would your code generator be able to generate code like this?

http://forum.micasaverde.com/index.php?topic=6613.0
http://forum.micasaverde.com/index.php?topic=6309.0
or
http://forum.micasaverde.com/index.php?topic=6589.0

Im curious what your implementation could do!
| 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 |