embarassing question

Posted on
Mon Feb 24, 2020 12:50 pm
trevorsmith offline
Posts: 86
Joined: Oct 08, 2016

embarassing question

I recently lost all my scripts due to a HD fault and ensuing fight with Time Machine. Anyway, can someone remind me how to read the current temp from a TRV that reports it?

as in

Code: Select all
i_currenttemp = indigo.devices["mydevicename"].currenttemp or whatever

I'm sure I used to know how to print a log of all the commands/statuses a device can handle. Can you remind me of that too please? I thought it was

Code: Select all
indigo.server.log(indigo.devices["mydevicename"])

but that fails with

Code: Select all
   Script Error                    embedded script: Python argument types in
    ServerInfo.log(ThermostatDevice)
did not match C++ signature:
    log(CCString message, CCString type='', bool isError=False)
   Script Error                    Exception Traceback (most recent call shown last):

     embedded script, line 2, at top level
ArgumentError: Python argument types in
    ServerInfo.log(ThermostatDevice)
did not match C++ signature:
    log(CCString message, CCString type='', bool isError=False)

Posted on
Fri Feb 28, 2020 4:17 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: embarassing question

The property is temperatures and it returns an array, so you'll want something like:

Code: Select all
dev = indigo.devices[599378754] # "downstairs thermostat"
curTemp = dev.temperatures[0]
indigo.server.log(str(curTemp))

To dump the entire device instance to the Event Log cast it as a string (or better yet, unicode) object:

Code: Select all
indigo.server.log(unicode(dev))

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 8 guests