- Code: Select all
# Get the two humidity values
bathHumidity = indigo.devices[288098054].sensorValue # ID of bathroom humidity device
bedroomHumidity = indigo.devices[1185510746].sensorValue # ID of bedroom humidity device
# Calculate the difference and check to see if it's greater than or equal to 20
if (bathHumidity - bedroomHumidity) >= 20:
# Difference is greater than or equal to 20, so turn on the device(s) for 10 minutes
indigo.device.turnOn(404137540, duration=600) # ID of exhaust fan
indigo.device.turnOn(116176458, duration=600) #ID of toilet fan
The script seems to be functioning correctly with Indigo 2022.1.1 but I wanted to check if it will still function when Python 2.7 goes away.