- Code: Select all
poolMax = indigo.variables[1141597781] # "pool_temp_max" variable that is reset each morning
poolTemp = indigo.devices[102542860] # "Pool Temperature" sensor via MQTT
message = poolTemp.states["topicMessage"] # MQTT message payload from temperature sensor
# If the daily maximum temperature is less than our new temperature, update the daily max to the new value
if float(poolMax.value) < float(message):
indigo.variable.updateValue(poolMax, message)
This is much nicer. I hadn't found this reference in any documentation for scripting using custom plugin devices.