We have moved at community.getvera.com

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

Offline ballroller

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +0/-0
Re: Luup Code Generator new version 1.027
« Reply #45 on: May 29, 2011, 04:12:55 pm »
Just saw something else- A scene is showing as active (showing "1") although the timer is turned off on that scene. Am I reading this correctly?

Edit to add: The code report generator is showing incorrect Device ID matchup. The "Pick Device" name doesn't match the Device ID, and the data as such is incorrect.

Ie My front porch light is actually device ID #7 and is showing up as #8. It also shows the temperature is set at 70 and it's cooling!! And I don't think I have a Device ID #8 at all...
« Last Edit: May 29, 2011, 04:32:06 pm by ballroller »

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator new version 1.027
« Reply #46 on: May 29, 2011, 07:05:12 pm »
Just saw something else- A scene is showing as active (showing "1") although the timer is turned off on that scene. Am I reading this correctly?

Edit to add: The code report generator is showing incorrect Device ID matchup. The "Pick Device" name doesn't match the Device ID, and the data as such is incorrect.

Ie My front porch light is actually device ID #7 and is showing up as #8. It also shows the temperature is set at 70 and it's cooling!! And I don't think I have a Device ID #8 at all...

 { "name": "Front Porch Light", "altid": "7", "id": 8, "category": 3, "room": 6, "parent": 1, "status": "0", "heatsp": "70" }
                                                                (it is easy to mix up altIDs with ID's.....your front porch light is #8)

As for the thermostat and scene, search your Json Report and it will show if the program is reading incorrectly.
EG: { "name": "Den Thermostat", "altid": "5", "id": 6, "category": 5, "room": 22, "parent": 1, "mode": "CoolOn", "temperature": "71", "heatsp": "63", "coolsp": "69", "status": "1", "humidity": "67", "state": -1, "comment": "" }

I give you the Heat Set Point (63) and the CoolSet Point (69), temperature (71) and the Mode ("CoolOn")

The purpose of the Example One Code generator is to set a variable called "Between?" to yes or no. Let me explain where I am going from here.....
I believe that code writing for those of us new to Luup (me included) needs to be modular. You create one piece of the code and test it, play with it, an learn to understand how it works. In this case, the larger project could be :
If the door sensor is tripped and it is Between Time A and Time B, and there is no motion, then turn on Light A,B,C and D and blink the porch lights on and off.

That is a lot of code to write for a Newbie. So here is my proposed method:
Write code that sets a variable if between time A and Time B (Var-1)
write code that sets a variable if the motion detector has shown no motion for X minutes (Var-2)
set up a scene and code to blink the light on and off (Sc-1)
create a scene that turns on light A,B,C, and D(Sc-2)

after all this is tested and working write a timer scene that has the following Luup code added:
If tripped and Var1 and Var-2 (all true)
then    turn on scene Sc-1 and Sc-2
else return false

The example is not real code .....but the method is easy to follow and debug one step at a time.
Thoughts?

I hope that makes sense!

Added Locks: http://www.box.net/shared/cs0bxr7ho1

Regards
Tim






« Last Edit: May 29, 2011, 10:05:09 pm by TimAlls »

Offline ballroller

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +0/-0
Re: Luup Code Generator new version 1.028
« Reply #47 on: May 30, 2011, 12:12:58 am »
Okay, I did get confused between ID and altID, sorry. And then the temperature and heat mode threw me off-until I realized that THAT data was included in my advanced file- for what reason I don't understand. Why would a light switch show temps and heating mode??

I will look at the Json report and see if there is some strange data in there- if my eyes don't roll back into my head before I'm done!

Thanks.

Edit: thanks for adding the locks.
« Last Edit: May 30, 2011, 12:14:36 am by ballroller »

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator new version 1.028
« Reply #48 on: May 30, 2011, 01:54:19 am »
Quote
Okay, I did get confused between ID and altID, sorry. And then the temperature and heat mode threw me off-until I realized that THAT data was included in my advanced file- for what reason I don't understand. Why would a light switch show temps and heating mode??
I was hoping you could explain the light!
Tim

Offline ballroller

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +0/-0
Re: Luup Code Generator new version 1.028
« Reply #49 on: May 30, 2011, 09:17:06 am »
I can't. Nor can I explain why my Garage Door Lock-inside is showing a temp of 66, and my main patio lights with a temp of 158!!

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Luup Code Generator new version 1.028
« Reply #50 on: May 30, 2011, 09:24:53 am »
I can't. Nor can I explain why my Garage Door Lock-inside is showing a temp of 66, and my main patio lights with a temp of 158!!
Your patio light must be overheating. ;) Do you also see these values in UI4, say in the Advanced tab of the device?
Dezwaved at the moment...

Offline ballroller

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +0/-0
Re: Luup Code Generator new version 1.028
« Reply #51 on: May 30, 2011, 09:35:29 am »
Yes, it's showing up in the advanced info. Weird.

Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator new version 1.028
« Reply #52 on: May 30, 2011, 09:42:40 am »
Yes, it's showing up in the advanced info. Weird.
Perhaps your dimmers report back the dimmer temperature.....a handy thing if they do! What brand of dimmers?
The 158 degrees would be correct if you have a lot of lights connected.
Tim

Offline ballroller

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +0/-0
Re: Luup Code Generator new version 1.028
« Reply #53 on: May 30, 2011, 09:58:24 am »
The main patio light switch is not a dimmer. It's a Leviton switch-not sure if it's the 5 amp or 15. It only has 2 LED lights drawing max 15 watts!

I knew it was going to be warm out today, but....

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Luup Code Generator new version 1.028
« Reply #54 on: May 30, 2011, 10:17:18 am »
It's a Leviton switch-not sure if it's the 5 amp or 15.
No temperature on the VRS05, or VRS15.
It could be that some wrong coding / Luup experiments got those variables in there. Are those values changing at all?
Dezwaved at the moment...

Offline ballroller

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +0/-0
Re: Luup Code Generator new version 1.028
« Reply #55 on: May 30, 2011, 10:24:55 am »
The stateid is changing for the temperature sensor, but the temp remains constant at 158.. The serviceid shows TemperatureSensor1 which is quite odd for a switch!


Offline TimAlls

  • Hero Member
  • *****
  • Posts: 722
  • Karma: +0/-0
Re: Luup Code Generator new version 1.028
« Reply #56 on: May 30, 2011, 10:46:27 am »
It's a Leviton switch-not sure if it's the 5 amp or 15.
No temperature on the VRS05, or VRS15.
It could be that some wrong coding / Luup experiments got those variables in there. Are those values changing at all?

Most likely coding with the wrong ID numbers. If you read or write to variables in a device that doesn't have those variables, it will create them for you. They will show up in the advanced tab and as far as I know can't be deleted. It is nothing to worry about.
The variable watch tab of my program will pull up everything variable the device has and gives
you the values. Have you tried any Luup code regarding your thermostats? The variables you are seeing are normal thermostat variables.

Example: go into the Luup tab of a scene and add " luup.variable_set("urn:user-com:serviceId:myvar","Ex1_Between?","No",76) "
    substitute a valid device number into 76.....save luup......refresh UI
activate the scene and the variable "Ex1_Between?" shows up automatically in my variable watch tab or with the standard UI look under advanced tab for that device.

Regards
Tim
« Last Edit: May 30, 2011, 11:30:52 am by TimAlls »

Offline Henk

  • Hero Member
  • *****
  • Posts: 820
  • Karma: +3/-0
Re: Luup Code Generator new version 1.028
« Reply #57 on: June 01, 2011, 12:48:07 pm »
Suggestion to either move this thread to Vera Luup & Development and/or lock it as its replaced by the 1.005 thread here
http://forum.mios.com/index.php?topic=6515.0
| 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.028
« Reply #58 on: June 01, 2011, 09:43:21 pm »
This software has merged with a larger one that now does Reports, Code, and UI control of devices. The software is functional but still under Development.
Goto this thread for the latest:
http://forum.micasaverde.com/index.php?topic=6515.0