Hi,
I am new to python and I am currently trying to get Electric usage into an Indigo Variable via an existing python script which talks to my Loop energy monitor. This works fine when running from the host command line as follows:
Python 2.7.10 (default, Feb 7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyloopenergy
>>> import time
>>>
>>> elec_serial = 'xxxxxxxxxx';
>>> elec_secret = 'yyyyyyyyyy';
>>>
>>> le = pyloopenergy.LoopEnergy(elec_serial, elec_secret)
>>>
>>> print(le.electricity_useage)
1.284
But when I try to run the same via an Indigo embedded python script I get no errors but also no update to the variable, it just reads - no value -
import pyloopenergy
import time
elec_serial = 'xxxxxxxxxx';
elec_secret = 'yyyyyyyyyy';
le = LoopEnergy(elec_serial, elec_secret)
indigo.variable.updateValue(932431696, le.electricity_useage)
Any thoughts where I may be going wrong? If I replace le.electricity_useage in the variable update with a string then the variable updates with the string so the variable id is correct.
Thanks!