Logging the value of the sensor, the event log produces the following:
Trigger run a script #1
Script dev: address : SBC3 1018 |a 4
batteryLevel : None
buttonGroupCount : 0
configured : True
description :
deviceTypeId : phIfKitSensor
displayStateId : state
displayStateImageSel : None
displayStateValRaw : 2030.0
displayStateValUi : 2030
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState :
folderId : 1142975935
globalProps : MetaProps : (dict)
com.perceptiveautomation.indigoplugin.Phidgets : (dict)
address : SBC3 1018 |a 4 (string)
buttonFlagSensor : false (bool)
cVal1 : 2 (string)
cVal2 : 40 (string)
decimalPlaces : 0 (string)
phIfKitSensorModel : 1142 (string)
phSensorIfKitAnalogInput : 4 (string)
phSensorIfKitId : 1737950388 (string)
phSensorIfKitSerial : 339669 (string)
phTemp1 : cel (string)
id : 1666063006
lastChanged : 2021-08-14 15:01:07
lastSuccessfulComm : 2021-08-14 15:01:07
model : InterfaceKit Sensor
name : #4 ambientLight
ownerProps : com.perceptiveautomation.indigoplugin.Phidgets : (dict)
address : SBC3 1018 |a 4 (string)
buttonFlagSensor : false (bool)
cVal1 : 2 (string)
cVal2 : 40 (string)
decimalPlaces : 0 (string)
phIfKitSensorModel : 1142 (string)
phSensorIfKitAnalogInput : 4 (string)
phSensorIfKitId : 1737950388 (string)
phSensorIfKitSerial : 339669 (string)
phTemp1 : cel (string)
pluginId : com.perceptiveautomation.indigoplugin.Phidgets
pluginProps : emptyDict : (dict)
protocol : Plugin
remoteDisplay : True
sharedProps : com.indigodomo.indigoserver : (dict)
states : States : (dict)
brightness : 2030 (real)
lastUpdate : 2021-08-14 15:01:07 (string)
state : 2030 (real)
subModel :
subType :
supportsAllLightsOnOff : False
supportsAllOff : False
supportsStatusRequest : False
version : None
The value I'd like to use is either 'brightness' or 'state' - 2030. Both are logged as 'real'. But the test script below ignores the value and proceeds as if true -
- Code: Select all
dev = indigo.devices[1666063006] # amb light
indigo.server.log(" dev: {}".format(dev))
if dev > 10000:
indigo.device.turnOn(1580115691)
if dev > 10000:
indigo.device.turnOff(1580115691)
even though both conditions are false, the device is turned on and off.