In Indigo when I click on this device it shows the current wattage consumed within the values shown at the bottom of the window.
How do I read this value in Python and assign it to a variable.
There are some similar examples given in the documentation, but I don't see where it is described how to get the desired parameter name or list of parameters available.
The closest I've seen is an example for sending an email. Rather than send an email I would just use the value obtained:
- Code: Select all
# Putting device data into the subject and body
theDevice = indigo.devices[980532604]
theSubject = "Summary of %s" % (theDevice.name)
theBody = "%s is %s\n%s is %s" % ("onState", str(theDevice.onState), "lastChanged", str(theDevice.lastChanged))
indigo.server.sendEmailTo("emailaddress@company.com", subject=theSubject, body=theBody)
Using the above code as an example, how would I find out the list of item values available: such as onState and lastChanged?
Another example: In a few days, I should receive a Zipato multi sensor. This. Includes an ambient light detector. How would I go about finding the name of the parameter which corresponds to the Lux value of detected ambient light?
Thanks,
Barry.