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/cs0bxr7ho1Regards
Tim