Pete.
I haven't had a chance to test this properly, but think this is close.
First setup a trigger on the Tariff device for "Current Electricity Rate" for "Has any Change"
Then in the condition try the python below
- Code: Select all
variable_threshold = float(indigo.variables[34475465].value) # use ID of your Indigo variable
tariff_device = indigo.devices[84950009] # use ID of your Indigo device
return indigo.devices[tariff_device].states['Current_Electricity_Rate'] < variable_threshold # not sure if you want to use <, <=, >, or >= here.
I need to wait 30 minutes for the rate to change to test it, but is should be close.
I am also interested in what manual logic you are using to set the variable value. I am contemplating some functionality that determines the optimum period to run an action (Say you want to run a Tumble dryer and it will take 3 hours) which is the best time to run it on a given day. No idea how to approach this yet, but the latest pre-release version publishes device states for all upcoming rates so it opens the door to this kind of logic.
Neil