Page 1 of 1

Advanced Heat Schedule Wiki Error

PostPosted: Tue Nov 22, 2016 9:55 pm
by Sharek326
Tonight I noticed that the Wiki tutorial on on scheduling Thermostats was causing an error. The code I was using in the trigger to change the variable and fire the Action Group was giving me an error. Below is the code and the error. I was wondering if this was because of any changes in I7 and if so how can I correct it?


Script

from variable_watcher import processVariable
processVariable("home")


Error

Schedule Set Night
Trigger home change
Script Error embedded script: No module named variable_watcher
Script Error Exception Traceback (most recent call shown last):

embedded script, line 1, at top level
ImportError: No module named variable_watcher

Re: Advanced Heat Schedule Wiki Error

PostPosted: Tue Nov 22, 2016 11:45 pm
by jay (support)

Re: Advanced Heat Schedule Wiki Error

PostPosted: Wed Nov 23, 2016 5:49 am
by Sharek326
Thanks Jay....Your right when I reloaded the computer a few days ago I never downloaded the script again and put it in the python folder.

Re: Advanced Heat Schedule Wiki Error

PostPosted: Wed Nov 23, 2016 10:42 pm
by Sharek326
Jay,

Question when I installed the script and tried it. It seems to fire correctly with everything except night . Here is Evening firing.

Nov 23, 2016, 11:38:49 PM
Schedule Set Evening
Trigger home change
Action Group evening
Z-Wave sent "Downstairs Thermostat" change heat setpoint to 69.0°
Z-Wave sent "Upstairs Thermostat" change heat setpoint to 68.0°
Z-Wave sent "Downstairs Thermostat" mode change to heat
Z-Wave sent "Upstairs Thermostat" mode change to heat


But when I fire Night

Z-Wave received "Meter Clamp 2" energy total to 14.127 kWh
Schedule Set Night
Trigger home change
Variable Watcher Error action group execution error: u"object named 'false' not found in database"
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/variable_watcher.py", line 21, in processVariable
actionGroup = _getIndigoObject(indigo.actionGroups, var.value)
File "/Library/Python/2.7/site-packages/variable_watcher.py", line 38, in _getIndigoObject
raise KeyError("object named '%s' not found in database" % input)
KeyError: u"object named 'false' not found in database"



I rebuilt the Night Schedule Event and the Action Group. I also set the Variable Trigger 10 times. Nothing seems to fix it. Any ideas?

Re: Advanced Heat Schedule Wiki Error

PostPosted: Wed Nov 23, 2016 10:54 pm
by jay (support)
I think maybe you're setting your variable value to False rather than "night" or whatever.

Re: Advanced Heat Schedule Wiki Error

PostPosted: Sat Nov 26, 2016 7:13 am
by Sharek326
Thanks Jay,

I double checked it and it was set to insert night into the variable but in the off chance something was bugged with the schedule I deleted it and built a new one. When I ran it I got the error again. But when I ran my weekend one following that it fired correctly.

Variable Watcher Error action group execution error: u"object named 'false' not found in database"
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/variable_watcher.py", line 21, in processVariable
actionGroup = _getIndigoObject(indigo.actionGroups, var.value)
File "/Library/Python/2.7/site-packages/variable_watcher.py", line 38, in _getIndigoObject
raise KeyError("object named '%s' not found in database" % input)
KeyError: u"object named 'false' not found in database"


Image

Re: Advanced Heat Schedule Wiki Error

PostPosted: Sat Nov 26, 2016 9:01 am
by Sharek326
I think I solved it. Because I have a House status variable that watches if the house is set to home, away, night or vacation and fires a action group accordingly. I had a Action Group for that named night which was causing a conflict for the action group for HVAC Night. This forced me to change the HVAC Night to NightHVAC in the action group but I never changed the value to reflect it in the Home variable.

Re: Advanced Heat Schedule Wiki Error

PostPosted: Sat Nov 26, 2016 1:47 pm
by jay (support)
Glad you solved it.

Re: Advanced Heat Schedule Wiki Error

PostPosted: Sat Mar 21, 2020 12:15 pm
by hamw
Had this working until I got my new computer. Downloaded and placed the variable watcher script in the Library... Python 2.7 folder, reloaded, restarted, etc, but still throwing this error.

Code: Select all
  Script Error                    embedded script: No module named variable_watcher
   Script Error                    Exception Traceback (most recent call shown last):

     embedded script, line 1, at top level
ImportError: No module named variable_watcher

   Stopping embedded script executor host2 (pid 52048)
   Stopped "embedded script executor host2"
   Stopping embedded script executor host1 (pid 51643)
   Stopped "embedded script executor host1"
   Embedded script executor host2 started
   Script Error                    embedded script: No module named variable_watcher
   Script Error                    Exception Traceback (most recent call shown last):

     embedded script, line 1, at top level
ImportError: No module named variable_watcher


Thoughts?

Re: Advanced Heat Schedule Wiki Error

PostPosted: Mon Mar 23, 2020 3:08 pm
by jay (support)
I don't think you have it in the right spot, as it works for me. Here's the relevant stuff:

Code: Select all
Mac-mini:~ jay$ ls /Library/Application\ Support/Perceptive\ Automation/Python2-includes/
variable_watcher.py   variable_watcher.pyc
Mac-mini:~ jay$ indigo-host
Python 2.7.10 (default, Feb 22 2019, 21:55:15)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)]
Connected to Indigo Server v7.4.1, api v2.3 (localhost:1176)
>>> import variable_watcher
>>> dir(variable_watcher)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '_getIndigoObject', 'indigo', 'processVariable', 'traceback']
>>>


The .pyc version of the file is generated automatically by Python the first time its imported. As you can see, the script loaded correctly and is showing the processVariable method. Make sure you installed it in the correct place. And, of course, make sure you're running it from Indigo (not directly from python).