Thanks
Sully
DaveL17 wrote:I think that I would do this with an embedded script within a trigger.
Trigger settings:
Type: Device State Changed
Device: Bathroom Humidity Sensor - Sensor Value - Has Any Change
Actions:
Server Actions - Script and File Actions - Execute Script
Embedded Python
Untested:Certainly not the only way to do it.
- Code: Select all
humidityBathroom = indigo.devices[BATHROOM HUMIDITY ID].sensorValue
humidityKitchen = indigo.devices[KITCHEN HUMIDITY ID].sensorValue
humidityBedroom = indigo.devices[BEDROOM HUMIDITY ID].sensorValue
if (humidityBathroom > humidityKitchen) or (humidityBathroom > humidityBedroom):
indigo.device.turnOn(BATHROOM FAN ID)
elif (humidityBathroom <= humidityKitchen) and (humidityBathroom <= humidityBedroom):
indigo.device.turnOff(BATHROOM FAN ID)
Dave