Do I need to change this script?

Posted on
Sat May 28, 2022 9:22 am
jalves offline
Posts: 745
Joined: Jun 16, 2013

Do I need to change this script?

I've got a couple of devices that I control via an embedded script. The script is triggered by a change in humidity level and it turns on a bathroom exhaust fan if the humidity in the bathroom gets significantly higher than the rest of the house. I do this so that the fan will automatically turn on when somebody showers. With that background, and help from Matt/Jay a few years ago, I've got the following script.
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.

Running Indigo 2023.2 on a 24" iMac M1), OS X 14.4
Jeff

Posted on
Sat May 28, 2022 9:43 am
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Do I need to change this script?

jalves wrote:
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.


If it's running in 2022.1.1 then it's already using Python3 and nothing will change when 2.7 goes away.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat May 28, 2022 2:26 pm
jalves offline
Posts: 745
Joined: Jun 16, 2013

Re: Do I need to change this script?

Good to know Joe. Appreciate the response and your many Indigo plugins!

Running Indigo 2023.2 on a 24" iMac M1), OS X 14.4
Jeff

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests